Documentation
Everything you need to integrate bytedash into your applications. OpenAI SDK compatible, works out of the box.
Quick Start
bytedash is fully compatible with the OpenAI SDK. Simply change the base URL and you're ready to go.
1. Install the OpenAI SDK
npm install openai2. Make your first request
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.tokenrouter.io/v1',
apiKey: 'YOUR_API_KEY',
});
const response = await client.chat.completions.create({
model: 'volcengine/doubao-pro-32k',
messages: [
{ role: 'user', content: 'Hello, world!' }
],
});
console.log(response.choices[0].message.content);Or use cURL
curl https://api.tokenrouter.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "volcengine/doubao-pro-32k",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Authentication
All API requests require authentication using an API key.
Getting an API Key
- Sign up for a bytedash account
- Navigate to the Dashboard
- Click "Create Key" in the API Keys section
- Copy your key and store it securely
Using Your API Key
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY⚠️ Security Best Practices
- Never expose your API key in client-side code
- Use environment variables to store keys
- Rotate keys regularly
- Revoke compromised keys immediately
Models
bytedash provides access to ByteDance (Doubao) models through a unified API.
Model Naming Convention
Models are identified using the format: provider/model-name
volcengine/doubao-pro-32kDoubao Pro 32K by ByteDancevolcengine/doubao-lite-32kDoubao Lite 32K by ByteDancevolcengine/doubao-vision-pro-32kDoubao Vision Pro 32K by ByteDanceAPI Reference
Complete API documentation for all endpoints.
POST
/v1/chat/completionsGET
/v1/modelsPOST
/v1/embeddings