Skip to main content
POST
Create a Message
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.

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>
required

Body param: The model used to generate the response. Select one of the supported model IDs listed below.

Available options:
claude-haiku-4-5-20251001,
claude-sonnet-4-5-20250929,
claude-opus-4-5-20251101,
claude-opus-4-6,
claude-fable-5,
claude-opus-5,
claude-opus-4-8,
claude-opus-4-7,
claude-sonnet-4-6,
claude-sonnet-5
Example:

"claude-opus-5"

max_tokens
integer
required

Body param: The maximum number of tokens to generate before stopping.

The model may stop before reaching this limit. Supported models can have different maximum output limits.

Required range: x >= 1
Example:

1024

messages
object[]
required

Body param: Input messages.

Our models are trained to operate on alternating user and assistant conversational turns. When creating a new Message, you specify the prior conversational turns with the messages parameter, and the model then generates the next Message in the conversation. Consecutive user or assistant turns in your request will be combined into a single turn.

Each input message must be an object with a role and content. You can specify a single user-role message, or you can include multiple user and assistant messages.

If the final message uses the assistant role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response.

Example with a single user message:

json [{ "role": "user", "content": "Hello, Claude" }]

Example with multiple conversational turns:

json [ { "role": "user", "content": "Hello there." }, { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, { "role": "user", "content": "Can you explain LLMs in plain English?" } ]

Example with a partially-filled response from Claude:

json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ]

Each input message content may be either a single string or an array of content blocks, where each block has a specific type. Using a string for content is shorthand for an array of one content block of type "text". The following input messages are equivalent:

json { "role": "user", "content": "Hello, Claude" }

json { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }

Note that if you want to include a system prompt, you can use the top-level system parameter — there is no "system" role for input messages in the Messages API.

There is a limit of 100,000 messages in a single request.

Required array length: 1 - 100000 elements
container

Body param: Container identifier for reuse across requests.

output_config
object

Body param: Configuration options for the model's output, such as the output format.

stop_sequences
string[]

Body param: Custom text sequences that will cause the model to stop generating.

Our models will normally stop when they have naturally completed their turn, which will result in a response stop_reason of "end_turn".

If you want the model to stop generating when it encounters custom strings of text, you can use the stop_sequences parameter. If the model encounters one of the custom sequences, the response stop_reason value will be "stop_sequence" and the response stop_sequence value will contain the matched stop sequence.

stream
boolean

Body param: Whether to incrementally stream the response using server-sent events.

system

Body param: System prompt.

Use this parameter to provide context and instructions, such as assigning the model a specific goal or role.

temperature
number
Required range: 0 <= x <= 1
Example:

1

thinking
object

Body param: Configuration for enabling extended thinking.

When enabled, responses include thinking content blocks before the final answer. budget_tokens must be at least 1,024 and counts toward max_tokens.

tool_choice
object

Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.

tools
object[]

Body param: Definitions of client tools that the model may use.

If you include tools in your API request, the model may return tool_use content blocks that represent the model's use of those tools. You can then run the tools using the generated input and return results in tool_result content blocks.

Each tool definition includes:

  • name: Name of the tool.
  • description: Optional, but strongly recommended description of the tool.
  • input_schema: JSON schema for the tool input.
top_k
integer
Required range: x >= 0
Example:

5

top_p
number
Required range: 0 <= x <= 1
Example:

0.7

Response

Message object

id
string
required

Unique object identifier.

The format and length of IDs may change over time.

Example:

"msg_013Zva2CMHLNnXjNJJKqJ2EF"

type
string
required

Object type.

For Messages, this is always "message".

Allowed value: "message"
role
string
required

Conversational role of the generated message.

This will always be "assistant".

Allowed value: "assistant"
content
(Text · object | Thinking · object | Redacted thinking · object | Tool use · object | Server tool use · object | Web search tool result · object | ResponseWebFetchToolResultBlock · object | Code execution tool result · object | ResponseBashCodeExecutionToolResultBlock · object | ResponseTextEditorCodeExecutionToolResultBlock · object | MCP tool use · object | MCP tool result · object | Container upload · object)[]
required

Content generated by the model.

This is an array of content blocks, each of which has a type that determines its shape.

model
enum<string>
required

The model that handled the request.

Available options:
claude-haiku-4-5-20251001,
claude-sonnet-4-5-20250929,
claude-opus-4-5-20251101,
claude-opus-4-6,
claude-fable-5,
claude-opus-5,
claude-opus-4-8,
claude-opus-4-7,
claude-sonnet-4-6,
claude-sonnet-5
Example:

"claude-opus-5"

stop_reason
enum<string> | null
required

The reason that generation stopped.

A model safety refusal may be returned as a successful Message response with stop_reason: "refusal". This is different from an HTTP 403 permission_error, which indicates an account or authorization problem.

Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use,
pause_turn,
refusal,
model_context_window_exceeded
stop_sequence
string | null
required

Which custom stop sequence was generated, if any.

usage
Usage · object
required

Billing and rate-limit usage.

context_management
ResponseContextManagement · object | null

Context management response.

container
Container · object | null

Information about the container used in this request.