Skip to main content
POST
BaseURL: The default BaseURL is https://direct.evolink.ai, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.
Only Seed 2.1 and doubao-seed-evolving support web search. Each actual search is billed according to its source. Explicit caching adds a storage charge. See caching and expire_at for details. Both explicit-cache examples in the request menu omit expire_at, so storage is billed for the default three-day lifetime.

Build a cache request that expires in one hour

Run this Python snippet just before sending and use the printed JSON as the request body. Leave PREVIOUS_RESPONSE_ID unset for the first request. To continue, set it to the actual id returned by the previous request and run the snippet again. Each run calculates a fresh expire_at.

Authorizations

Authorization
string
header
required

All APIs require Bearer Token authentication

Get API Key:

Visit API Key Management Page to get your API Key

Add to request header:

Body

application/json
model
enum<string>
default:doubao-seed-2-1-pro
required

Choose a model

Seed 2.1 model IDs use a hyphen (2-1). Seed 2.0 IDs use a period (2.0).

Available options:
doubao-seed-2-1-pro,
doubao-seed-2-1-turbo,
doubao-seed-2-1-lite,
doubao-seed-evolving,
doubao-seed-2.0-pro,
doubao-seed-2.0-lite,
doubao-seed-2.0-mini,
doubao-seed-2.0-code
Example:

"doubao-seed-2-1-pro"

input
required

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.

instructions
string | null

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
previous_response_id
string | null

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
expire_at
integer

Expiry time for store and caching, in UTC Unix seconds. It must be after creation and at most 604800 seconds (7 days) later. Values outside that range return an error. Default: creation + 259200 seconds (3 days).

Explicit cache storage is billed upfront for the entire lifetime. Each clock hour touched is charged as a full hour, including partial hours. Early deletion is nonrefundable. Set an earlier expire_at for short-term reuse.

max_output_tokens
integer | null

Maximum output tokens including reasoning and the answer. Allow enough tokens for reasoning. If the budget runs out, status is incomplete and only reasoning may be returned.

Example:

32768

thinking
object

Controls whether the model enables deep thinking mode

reasoning
object

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

caching
object

Omit this field or use disabled for automatic caching. Prefixes shared with recent requests may be billed at the cache-hit rate with no storage fee. Hits are not guaranteed.

With {"type": "enabled"}, the current input is cached explicitly. Continue via previous_response_id and send caching: {"type": "enabled"} again on every turn. Hits use the cache-hit rate. Storage is billed separately for newly cached tokens × storage hours at the model’s rate, until expire_at.

Combining explicit caching with instructions or any tool other than functions (including web search) returns 400.

store
boolean | null
default:true

Whether to store the generated model response for later retrieval via API

  • true: Store the current model response
  • false: Do not store
stream
boolean | null
default:false

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
temperature
number | null
default:1

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
Required range: 0 <= x <= 2
top_p
number | null
default:0.7

Nucleus sampling probability threshold

  • Value range: [0, 1]
  • It is recommended to adjust only one of temperature or top_p
Required range: 0 <= x <= 1
text
object

Format definition for model text output

tools
object[]

All Seed models accept custom function tools. Only Seed 2.1 and doubao-seed-evolving support web_search. doubao-seed-2.0-mini returns 400 if web search is declared. Other built-ins such as doubao_app and knowledge_search also return 400. Each search performed is billed separately from tokens at the source-specific model rate.

tool_choice

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

Available options:
none,
auto,
required
max_tool_calls
integer

Maximum tool rounds, from 1 to 10, with no call limit per round. Web search defaults to 3 rounds. This is a best-effort limit. The actual count depends on the model’s reasoning.

Required range: 1 <= x <= 10
context_management
object

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

Response

Response generated successfully

id
string

Unique identifier of this response

Example:

"resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e"

object
enum<string>

Object type, fixed as response

Available options:
response
Example:

"response"

created_at
number

Creation Unix timestamp (seconds)

Example:

1771486674

model
string

Model used for this request.

Example:

"doubao-seed-2-1-pro"

status
enum<string>

Response status

  • completed: Generation completed
  • in_progress: Generation in progress
  • incomplete: Incomplete
  • failed: Failed
Available options:
completed,
in_progress,
incomplete,
failed
Example:

"completed"

output
(Chain-of-thought output · object | Message output · object | Tool call output · object | Web search call · object)[]

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

instructions
string | null

System instructions used for this request

previous_response_id
string | null

Referenced previous response ID

max_output_tokens
integer

Maximum output token count

Example:

32768

temperature
number | null

Sampling temperature used

top_p
number | null

top_p value used

thinking
object | null

Thinking mode configuration used

tools
array | null

List of tools used

tool_choice
any | null

Tool choice configuration used

parallel_tool_calls
boolean | null

Whether parallel tool calls are allowed

text
object | null

Text output format configuration

usage
object

Token usage statistics

caching
object

Cache configuration for this request. type=enabled means an explicit cache was written and incurs storage charges.

store
boolean

Whether the response was stored

expire_at
integer

Expiry time for the stored response and explicit cache, in Unix seconds.

Example:

1756539922

error
object | null

Error information, null on success

incomplete_details
object | null

Detailed reason for incompleteness