Skip to content
HomeModels
DocsText & chat

Claude messages

Call Claude with the native Anthropic Messages format, compatible with message structures used by the Claude SDK.

Anthropic compatibleStreaming supported
POST/v1/messages
Base URLhttps://api.linkinfra.ai

Authorization

Bearer Token
AuthorizationBearer <token>

Authenticate requests with your API key in the request header:

Authorization: Bearer sk-your-api-key

Need a key? Create one in the console

anthropic-version2023-06-01

This endpoint accepts Authorization: Bearer and x-api-key. When using the Anthropic SDK, set base_url to the API root without /v1.

Request body

application/json
modelstringrequired

Model ID from the model catalog. Availability depends on your account group and configured channels.

messagesarray<object>required

A list of user and assistant messages. Put the system prompt in system.

max_tokensintegerrequired

Maximum number of generated tokens.

systemstring | array

System prompt text or content blocks.

streamboolean

Set to true to receive incremental Server-Sent Events. Defaults to false.

Streaming follows Anthropic SSE events, including message_start, content_block_delta, and message_stop.

Response

application/json
200Successful response
contentarray<object>

Generated content blocks. Text blocks have type text.

stop_reasonstring

Stop reason, such as end_turn, max_tokens, or tool_use.

usageobject

Token usage for this request. Check usage logs in the console for actual charges.

Request failed? Read the error handling guide