Routescope APIRoutescope API
Chat Completions

Doubao

Doubao text, code, and character conversation model overview

Doubao text models use the OpenAI-compatible Chat Completions endpoint. This page groups common models and parameters for chat, code generation, and character conversation.

Endpoint Path

MethodPathPurpose
POST/v1/chat/completionsCreate a Doubao text, code, or character conversation request
POST
/v1/chat/completions
curl -X POST "https://api.routescope.ai/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{    "model": "gpt-4o-mini",    "messages": [      {        "role": "user",        "content": "Hello, please introduce yourself in one sentence."      }    ]  }'
{
  "id": "task_01JZ8M9Q4R7V2K8N9P0Q",
  "object": "string",
  "created": 1,
  "model": "gpt-4o-mini",
  "choices": [],
  "usage": {
    "prompt_tokens": 1,
    "completion_tokens": 1,
    "total_tokens": 1,
    "input_tokens": 1,
    "output_tokens": 1
  }
}
{
  "error": null,
  "message": "success"
}

Authorization

BearerAuth

AuthorizationBearer <token>

Model relay interface recognition. Request heading: Autoration: Bearer .

In: header

Request Body

application/json

model*string

The model name to call.

messages*

Can not open message Can not open message Scope: At least 1 message.

temperature?number

Sampling temperatures spread more and more. Sample temperature. Range: 0 to 2; the larger the value, the more random.

Range0 <= value <= 2
top_p?number

Nuclear sampling parameters. Nuclear sampling parameters. Range: 0 to 1; usually no large adjustments with temperature.

Range0 <= value <= 1
max_tokens?integer

Maximum output number of Tokens. Maximum output number of Tokens. Scope: 1 to the maximum of the context of the model.

Range1 <= value
stream?boolean

Whether to enable SSE flow output. Whether or not to enable flow output. Scope: True or false.

stream_options?

Stream extension options. Upstream support varied.

enable_thinking?boolean

Whether or not to start deep thinking mode. Qwen/Ariyuncrery OpenAI compatible extension parameters: _FD_PROTECT_0 _ Start thinking, _FD_PROTECT_1 _ Close thinking; part of the thinking model is always open and does not support closure. Python OpenAI SDK can be imported through FD_PROTECT_2.

tools?

Tool definitions for which models can be called. . Scope: The length of arrays and the complexity of schema are based on upstream limits.

tool_choice?string|

Tools call policies, such as _FD_PROTEC_0, FD_PROTEC_1 or visible specifying functions. Tool call policy. Scope: auto, none, required or visible tool objects.

response_format?object

Structured output constraints, such as JSON Schema.

user?string

End-user identification for audit and control.

Response Body

application/json

application/json

Model Selection

Model IDCapabilityTypical Use
doubao-seed-1-8-251228Chat completionsGeneral text conversation
doubao-seed-2-0-lite-260215Chat completionsLightweight text conversation
doubao-seed-2-0-mini-260215Chat completionsLightweight text conversation
doubao-seed-2-0-pro-260215Chat completionsMore complex text conversation
doubao-seed-2-0-code-preview-260215Code generationCode-related tasks
doubao-seed-code-preview-251028Code generationCode-related tasks
doubao-seed-character-251128Character dialogueRole-play or persona conversation

Common Parameters

FieldTypeRequiredDescription
modelstringYesDoubao model ID.
messagesarrayYesOpenAI-style conversation message list.
temperaturenumberNoSampling temperature. Range follows the endpoint description or backend configuration.
top_pnumberNoNucleus sampling parameter.
max_tokensintegerNoMaximum output tokens.
streambooleanNoWhether to stream output.
toolsarrayNoTool definitions.
response_formatobjectNoStructured output constraint.
userstringNoEnd-user identifier.

Model-Specific Notes

FieldApplicable ModelsDescription
modelAll Doubao text modelsUse model to choose the concrete model in the request body.
Code promptsdoubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028These are code-generation models, but the endpoint and parameters remain Chat Completions-compatible.
Character promptsdoubao-seed-character-251128This model is intended for character conversation, but the endpoint and parameters remain Chat Completions-compatible.
Other dedicated fieldsAllNo unified model-specific fields are listed here. Follow API responses or the actual console display.

Example Code

curl https://api.routescope.ai/v1/chat/completions \
  -H "Authorization: Bearer $ROUTESCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seed-2-0-pro-260215",
    "messages": [
      { "role": "user", "content": "Give me a one-sentence introduction to an API gateway." }
    ]
  }'

Response Structure

Doubao text pages use OpenAI Chat Completions-style responses, including fields such as choices and usage.

How is this guide?

Last updated on