Doubao Seed 2.0 - Complete API Reference
- Call Doubao Seed 2.0 series models using OpenAI SDK format
- Synchronous processing mode, real-time response
- Text Chat: Single or multi-turn contextual conversation
- System Prompts: Customize AI role and behavior
- Multimodal Input: Supports text + image + video mixed input
- Deep Thinking: Supports enabling chain-of-thought mode for deep reasoning
- Tool Calling: Function Calling support
- Structured Output: Supports JSON Object / JSON Schema format output
- Quick start? Check the Quick Start Guide
Authorization
##All APIs require Bearer Token authentication## **Get API Key:** Visit the [API Key Management Page](https://starmagic.ai/app/api-keys) to get your API Key **Add to request headers:** ``` Authorization: Bearer YOUR_API_KEY ```
Authorization: Bearer YOUR_API_KEYRequest body
application/jsonChat model name - `doubao-seed-2.0-pro`: Flagship, strongest overall capability, ideal for complex reasoning and high-quality generation - `doubao-seed-2.0-lite`: Lightweight, faster speed, cost-effective - `doubao-seed-2.0-mini`: Ultra-fast, quickest response, suitable for simple tasks - `doubao-seed-2.0-code`: Code-specialized, optimized for code generation and understanding
"doubao-seed-2.0-pro"List of conversation messages, supports multi-turn conversation and multimodal input (text, image, video)
[
{
"role": "user",
"content": [
null
],
"reasoning_content": "string",
"tool_calls": [
{
"id": "string",
"type": "function",
"function": {
"name": null,
"arguments": null
}
}
],
"tool_call_id": "string"
}
]Control whether the model enables deep thinking mode Different models may vary in support and default values
{
"type": "enabled"
}Whether to stream the response content - `false`: Model generates all content before returning the result at once - `true`: Returns model-generated content incrementally via SSE protocol, ending with a `data: [DONE]` message. When stream is true, you can set the stream_options field to get token usage statistics
falseOptions for streaming responses. Can be set when stream is true
{
"include_usage": true,
"chunk_include_usage": false
}Maximum length of model response (in tokens) **Note**: - Model response does not include chain-of-thought content (model response = model output - model chain-of-thought) - Total output token length is also limited by the model's context length - Cannot be set simultaneously with max_completion_tokens
4096Controls the maximum output length of the model, including both response and chain-of-thought content (in tokens) **Note**: - Value range: [0, 65536] - When configured, the default value of max_tokens becomes ineffective; the model outputs content (response and chain-of-thought) as needed until reaching this value - Cannot be set simultaneously with max_tokens - Recommended when deep thinking mode is enabled
16384Sampling temperature, controls output randomness **Note**: - Value range: [0, 2] - Lower values (e.g., 0.2): More deterministic, more focused output - Higher values (e.g., 0.8): More random, more creative output - A value of 0 means the model only considers the token with the highest log probability - It is recommended to adjust only temperature or top_p, not both
0.7Nucleus sampling probability threshold **Note**: - Value range: [0, 1] - The model considers tokens within the top_p probability mass - 0.1 means only considering the top 10% of tokens by probability mass - Higher values produce more random output, lower values produce more deterministic output - It is recommended to adjust only temperature or top_p, not both
0.9The model will stop generating when it encounters the string(s) specified in the stop field. The stop string itself will not be included in the output. Up to 4 strings are supported **Note**: Deep thinking models do not support this field
[
"hello",
"weather"
]Limits the amount of thinking effort, reducing thinking depth can improve speed and consume fewer tokens - `minimal`: Disable thinking, answer directly - `low`: Lightweight thinking, prioritizes quick response - `medium`: Balanced mode, balances speed and depth - `high`: Deep analysis, handles complex problems
"medium"Specify the model response format Supports three formats: text (default), json_object, json_schema
{
"type": "text",
"json_schema": {
"name": "string",
"description": "string",
"schema": {},
"strict": false
}
}Frequency penalty coefficient **Note**: - Value range: [-2.0, 2.0] - Positive values penalize new tokens based on their frequency in the text so far, reducing the likelihood of the model repeating the same content verbatim
0Presence penalty coefficient **Note**: - Value range: [-2.0, 2.0] - Positive values penalize new tokens based on whether they have appeared in the text so far, increasing the likelihood of the model talking about new topics
0Whether to return log probabilities of output tokens - `false`: Do not return log probability information - `true`: Return log probabilities for each output token in the message content **Note**: Deep thinking models do not support this field
falseSpecify the number of most likely tokens to return at each output token position, each with an associated log probability - Value range: [0, 20] - Can only be set when logprobs is true **Note**: Deep thinking models do not support this field
0Adjust the probability of specified tokens appearing in the model output **Note**: - Accepts a map where keys are token IDs from the vocabulary and values are bias values - Bias value range: [-100, 100] - -1 reduces the likelihood of selection, 1 increases the likelihood of selection - -100 completely prohibits selection of the token, 100 causes only that token to be selectable **Note**: Deep thinking models do not support this field
{}List of tools to be called; the model response may contain tool call requests
[
{
"type": "function",
"function": {
"name": "string",
"description": "string",
"parameters": {}
}
}
]Whether the model response is allowed to contain multiple tool calls for this request - `true`: Allow returning multiple tool calls - `false`: The number of tool calls returned is <= 1
trueWhether the model response should contain tool calls for this request **String mode**: - `none`: Model response does not contain tool calls - `required`: Model response must contain tool calls - `auto`: Model decides whether to include tool calls (default when tools are provided) **Object mode**: Specify the scope of tools to be called
Response
application/jsonResponse body
Unique identifier for this request
"0217714854126607f5a9cf8ed5b018c76e4ad3dc2810db57ffb50"Actual model name and version used for this request
"doubao-seed-2-0-pro-260215"Response type, always chat.completion
"chat.completion"Service tier for this request - `default`: Default service tier - `scale`: Used reserved capacity quota
"default"Unix timestamp (in seconds) of when this request was created
1771485416Model output content for this request
[
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! Doubao Seed 2.0 is a next-generation large language model from ByteDance, featuring enhanced reasoning, multimodal understanding, and deep thinking capabilities.",
"reasoning_content": "string",
"tool_calls": [
null
]
},
"finish_reason": "stop",
"logprobs": {
"content": [
{
"token": null,
"bytes": null,
"logprob": null,
"top_logprobs": null
}
]
},
"moderation_hit_type": "severe_violation"
}
]Token usage for this request
{
"total_tokens": 271,
"prompt_tokens": 15,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens": 256,
"completion_tokens_details": {
"reasoning_tokens": 0
}
}
