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 Responses API - Complete API Reference

  • Use Responses API format to call Doubao Seed 2.0 series models
  • Server-side context storage: Implement multi-turn conversations via previous_response_id, no need to manually pass conversation history
  • Multimodal input: Supports text + image + video + file (PDF) mixed input
  • Deep thinking: Supports thinking chain-of-thought mode
  • Tool calling: Supports Function Calling, web search, image processing, MCP tools, private knowledge base, Doubao App
  • Context caching: Supports caching mechanism to reduce costs
  • Structured output: Supports JSON Object / JSON Schema format
  • Context management: Supports context_management strategy
  • Quick start? Check out 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 - `doubao-seed-2.0-lite`: Lightweight, faster speed - `doubao-seed-2.0-mini`: Ultra-fast, quickest response - `doubao-seed-2.0-code`: Code-specialized

"doubao-seed-2.0-pro"
inputobjectRequired

Input content. Supports two formats: **1. Plain text string**: Equivalent to text input from the user role **2. Element list (array)**: Contains multiple input types including messages, context, tool calls, etc.

instructionsstring

Insert a system message or developer instruction as the first instruction in the model context **Note**: - When used with previous_response_id, instructions from the previous response are not inherited - Cannot be used together with caching

"string"
previous_response_idstring

Unique identifier of the previous model response, used to implement multi-turn conversations **Note**: - When provided, it will include the input and response content from the previous round, and the input tokens for the current request will increase accordingly - In continuous multi-turn conversations, it is recommended to add approximately 100ms delay between each request

"string"
expire_atinteger

Storage expiration time, UTC Unix timestamp (seconds) **Note**: - Value range: (creation time, creation time + 604800], i.e., maximum retention of 7 days - Default: creation time + 259200 (3 days) - Applies to both store and caching - Cache storage is billed by time, less than 1 hour is counted as 1 hour

0
max_output_tokensinteger

Maximum number of output tokens from the model, including model response and chain-of-thought content

32768
thinkingobject

Controls whether the model enables deep thinking mode

{
  "type": "enabled"
}
reasoningobject

Limit deep thinking workload, reducing it can make responses faster and use fewer tokens

{
  "effort": "medium"
}
cachingobject

Whether to enable context caching **Note**: Cannot be used together with instructions field or tools field (except Function Calling)

{
  "type": "disabled",
  "prefix": false
}
storeboolean

Whether to store the generated model response for later retrieval via API - `true`: Store the current model response - `false`: Do not store

true
streamboolean

Whether to stream the response content - `false`: Return all content at once after the model finishes generating - `true`: Return chunks progressively via SSE protocol, ending with a `data: [DONE]` message

false
temperaturenumber

Sampling temperature, controls output randomness - Value range: [0, 2] - Lower values are more deterministic, higher values are more random - It is recommended to adjust only one of temperature or top_p **Note**: doubao-seed-2.0-pro and doubao-seed-2.0-lite are fixed at 1, manual specification will be ignored

1
top_pnumber

Nucleus sampling probability threshold - Value range: [0, 1] - It is recommended to adjust only one of temperature or top_p **Note**: doubao-seed-2.0-pro and doubao-seed-2.0-lite are fixed at 0.95, manual specification will be ignored

0.7
textobject

Format definition for model text output

{
  "format": {
    "type": "text",
    "name": "string",
    "schema": {},
    "description": "string",
    "strict": false
  }
}
toolsobject[]

List of tools the model can call Supported tool types: - `function`: Custom function (Function Calling) - `web_search`: Web search - `doubao_app`: Doubao App - `image_process`: Image processing - `mcp`: MCP tools - `knowledge_search`: Private knowledge base search

[
  {
    "type": "function",
    "name": "string",
    "description": "string",
    "parameters": {},
    "strict": true,
    "feature": {
      "chat": {
        "type": "disabled",
        "role_description": "string"
      },
      "deep_chat": {
        "type": "disabled",
        "role_description": "string"
      },
      "ai_search": {
        "type": "disabled",
        "role_description": "string"
      },
      "reasoning_search": {
        "type": "disabled",
        "role_description": "string"
      }
    },
    "user_location": {
      "type": "approximate",
      "country": "string",
      "region": "string",
      "city": "string"
    },
    "sources": [
      "toutiao"
    ],
    "limit": 0,
    "max_keyword": 0,
    "point": {
      "type": "enabled"
    },
    "grounding": {
      "type": "enabled"
    },
    "zoom": {
      "type": "enabled"
    },
    "rotate": {
      "type": "enabled"
    },
    "server_label": "string",
    "server_url": "string",
    "headers": {},
    "require_approval": null,
    "allowed_tools": null,
    "knowledge_resource_id": "string",
    "doc_filters": {},
    "dense_weight": 0.5,
    "ranking_options": {
      "rerank_switch": false,
      "retrieve_count": 25,
      "get_attachment_link": false,
      "chunk_diffusion_count": 0,
      "chunk_group": false,
      "rerank_model": "base-multilingual-rerank",
      "rerank_only_chunk": false
    }
  }
]
tool_choiceobject

Controls whether the model calls tools **String mode**: - `none`: Do not call tools - `required`: Must call tools - `auto`: Model decides (default) **Object mode**: Specify a particular tool to call

max_tool_callsinteger

Maximum number of tool call rounds (unlimited calls per round) - Value range: [1, 10] - Web Search default: 3 - Image Process default: 10 (modification not supported) - Knowledge Search default: 3 **Note**: This parameter operates on a best-effort basis; the actual number of calls is influenced by model inference performance and other factors

0
context_managementobject

Context management strategy to help the model effectively utilize the context window

{
  "edits": [
    {
      "type": "clear_thinking",
      "keep": null,
      "exclude_tools": [
        "string"
      ],
      "clear_tool_input": false,
      "trigger": {
        "type": "tool_uses",
        "value": 0
      }
    }
  ]
}

Response

application/json
成功

Response body

idstring

Unique identifier for this response

"resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e"
objectenum<response>

Object type, fixed as response

"response"
created_atnumber

Unix timestamp (seconds) of creation time

1771486674
modelstring

Actual model name and version used

"doubao-seed-2-0-code-preview-260215"
statusenum<completed | in_progress | incomplete | failed>

Response status - `completed`: Generation completed - `in_progress`: Generation in progress - `incomplete`: Incomplete - `failed`: Failed

"completed"
outputobject[]

Model output content list, including chain-of-thought output, message output, tool call output, etc.

[
  null
]
service_tierstring

Service tier for this request - `default`: Default service tier - `scale`: Used guaranteed package quota

"default"
instructionsstring

System instructions used for this request

"string"
previous_response_idstring

Referenced previous response ID

"string"
max_output_tokensinteger

Maximum number of output tokens from the model

32768
temperaturenumber

Sampling temperature used

0
top_pnumber

top_p value used

0
thinkingobject

Thinking mode configuration used

{}
toolsunknown[]

List of tools used

[
  null
]
tool_choiceobject

Tool choice configuration used

parallel_tool_callsboolean

Whether parallel tool calls are allowed

true
textobject

Text output format configuration

{}
usageobject

Token usage statistics

{
  "input_tokens": 88,
  "input_tokens_details": {
    "cached_tokens": 0
  },
  "output_tokens": 230,
  "output_tokens_details": {
    "reasoning_tokens": 211
  },
  "total_tokens": 318
}
cachingobject

Caching configuration

{
  "type": "enabled"
}
storeboolean

Whether the response was stored

true
expire_atinteger

Storage expiration time (Unix timestamp)

1756539922
errorobject

Error information, null on success

{}
incomplete_detailsobject

Detailed reason for incompleteness

{}
POST/v1/responses
curl --request POST \
  --url https://api.starmagic.ai/v1/responses \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "doubao-seed-2.0-pro",
  "input": "Please introduce yourself"
}'
Response: 成功
{
  "id": "resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e",
  "object": "response",
  "created_at": 1771486674,
  "model": "doubao-seed-2-0-code-preview-260215",
  "status": "completed",
  "output": [
    null
  ],
  "service_tier": "default",
  "instructions": "string",
  "previous_response_id": "string",
  "max_output_tokens": 32768,
  "temperature": 0,
  "top_p": 0,
  "thinking": {},
  "tools": [
    null
  ],
  "tool_choice": null,
  "parallel_tool_calls": true,
  "text": {},
  "usage": {
    "input_tokens": 88,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 230,
    "output_tokens_details": {
      "reasoning_tokens": 211
    },
    "total_tokens": 318
  },
  "caching": {
    "type": "enabled"
  },
  "store": true,
  "expire_at": 1756539922,
  "error": {},
  "incomplete_details": {}
}