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 openai

2. 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

  1. Sign up for a bytedash account
  2. Navigate to the Dashboard
  3. Click "Create Key" in the API Keys section
  4. 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 ByteDance
volcengine/doubao-lite-32kDoubao Lite 32K by ByteDance
volcengine/doubao-vision-pro-32kDoubao Vision Pro 32K by ByteDance
View Model List

API Reference

Complete API documentation for all endpoints.

POST/v1/chat/completions
GET/v1/models
POST/v1/embeddings