StarMagicStarMagic
English
简体中文简繁體中文繁EnglishEN日本語日EspañolES한국어KO
Integration Guide
Doubao Seed 2.0 - 快速开始Doubao Seed 2.0 - 完整参数文档Doubao Seed 2.0 Responses API - 快速开始Doubao Seed 2.0 Responses API - 完整参数文档
StarMagicStarMagic
English
简体中文简繁體中文繁EnglishEN日本語日EspañolES한국어KO
TextDoubaoDoubao.Seed.2.0

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
<Note> **BaseURL**: The default BaseURL is `https://api.starmagic.ai`, which has better support for text models and long-lived connections. `https://api.starmagic.ai` is the primary endpoint for multimodal services and serves as a fallback address for text models. </Note>

Authorization

AuthorizationstringheaderRequired

##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_KEY

Request body

application/json
modelenum<doubao-seed-2.0-pro | doubao-seed-2.0-lite | doubao-seed-2.0-mini | doubao-seed-2.0-code>Required

Chat 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"
messagesobject[]Required

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"
  }
]
thinkingobject

Control whether the model enables deep thinking mode Different models may vary in support and default values

{
  "type": "enabled"
}
streamboolean

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

false
stream_optionsobject

Options for streaming responses. Can be set when stream is true

{
  "include_usage": true,
  "chunk_include_usage": false
}
max_tokensinteger

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

4096
max_completion_tokensinteger

Controls 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

16384
temperaturenumber

Sampling 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.7
top_pnumber

Nucleus 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.9
stopobject

The 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"
]
reasoning_effortenum<minimal | low | medium | high>

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"
response_formatobject

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_penaltynumber

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

0
presence_penaltynumber

Presence 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

0
logprobsboolean

Whether 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

false
top_logprobsinteger

Specify 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

0
logit_biasobject

Adjust 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

{}
toolsobject[]

List of tools to be called; the model response may contain tool call requests

[
  {
    "type": "function",
    "function": {
      "name": "string",
      "description": "string",
      "parameters": {}
    }
  }
]
parallel_tool_callsboolean

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

true
tool_choiceobject

Whether 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/json
成功

Response body

idstring

Unique identifier for this request

"0217714854126607f5a9cf8ed5b018c76e4ad3dc2810db57ffb50"
modelstring

Actual model name and version used for this request

"doubao-seed-2-0-pro-260215"
objectenum<chat.completion>

Response type, always chat.completion

"chat.completion"
service_tierenum<default | scale>

Service tier for this request - `default`: Default service tier - `scale`: Used reserved capacity quota

"default"
createdinteger

Unix timestamp (in seconds) of when this request was created

1771485416
choicesobject[]

Model 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"
  }
]
usageobject

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
  }
}
POST/v1/chat/completions
curl --request POST \
  --url https://api.starmagic.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "doubao-seed-2.0-pro",
  "messages": [
    {
      "role": "user",
      "content": "Please introduce yourself"
    }
  ]
}'
Response: 成功
{
  "id": "0217714854126607f5a9cf8ed5b018c76e4ad3dc2810db57ffb50",
  "model": "doubao-seed-2-0-pro-260215",
  "object": "chat.completion",
  "service_tier": "default",
  "created": 1771485416,
  "choices": [
    {
      "index": 0,
      "message": {
        "role": null,
        "content": null,
        "reasoning_content": null,
        "tool_calls": null
      },
      "finish_reason": "stop",
      "logprobs": {
        "content": [
          null
        ]
      },
      "moderation_hit_type": "severe_violation"
    }
  ],
  "usage": {
    "total_tokens": 271,
    "prompt_tokens": 15,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens": 256,
    "completion_tokens_details": {
      "reasoning_tokens": 0
    }
  }
}