Skip to main content
POST
Create Anthropic message
If you already use the official Anthropic SDK, or want native Claude capabilities such as system prompts, Tool Use, and Prompt Caching, call /v1/messages directly. It follows the official Anthropic protocol.
Anthropic Messages and all other public APIs use api-direct.dimilinks.com. The complete request URL is https://api-direct.dimilinks.com/v1/messages, and all protocols share the same Bearer key.

Request URL

We recommend including the anthropic-version header explicitly to match Anthropic’s official documentation. Requests without it are also supported and use the server’s default version.

Basic example

Response (abridged):

Streaming

Add "stream": true. The server then returns native Anthropic events in this order: message_start / content_block_start / content_block_delta / content_block_stop / message_delta / message_stop.

Parameters

Call with the Anthropic SDK

Python:
Node.js:
Set the Anthropic SDK base_url to https://api-direct.dimilinks.com/. The SDK appends /v1/messages automatically.

Tool Use

If the model response contains content[].type === "tool_use", execute the tool, then continue the conversation with a tool_result content block in a role=user message.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

anthropic-version
string

Anthropic API version, e.g. 2023-06-01.

Example:

"2023-06-01"

Body

application/json
model
string
required
Example:

"claude-sonnet-5"

max_tokens
integer
required
Example:

1024

messages
object[]
required
system
temperature
number
top_p
number
top_k
integer
stop_sequences
string[]
stream
boolean
default:false
tools
object[]
tool_choice
object
metadata
object
thinking
object

Response

Anthropic message response. When stream is true the response is text/event-stream with Anthropic native events.

id
string
Example:

"msg_xxx"

type
string
Example:

"message"

role
string
Example:

"assistant"

model
string
Example:

"claude-sonnet-5"

content
object[]
stop_reason
string
stop_sequence
string
usage
object