Skip to main content
POST
Create Anthropic-compatible message

Authorizations

Authorization
string
header
required

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

Headers

x-request-id
string

Optional caller request id.

anthropic-version
string
required

Anthropic API version.

x-api-key
string

Anthropic SDK-compatible API key header. Prefer Authorization: Bearer for MyRouter.

Body

application/json
model
string
required

Public MyRouter model id exposed through Anthropic-compatible API.

messages
object[]
required

Anthropic-style input messages.

Minimum array length: 1
max_tokens
integer
required

Maximum output tokens.

Required range: x >= 1
stream
boolean

Whether to stream SSE events.

system

System prompt content.

stop_sequences
string[]

Stop sequences.

temperature
number

Sampling temperature.

top_p
number

Nucleus sampling value.

top_k
integer

Top-k sampling value.

tools
object[]

Anthropic tool definitions.

tool_choice

Tool choice.

metadata
object

Customer metadata.

Response

Create Anthropic-compatible message response.

id
string
required

Message id.

type
string
required

Anthropic response type.

role
string
required

Assistant role.

content
object[]
required

Output content blocks.

model
string
required

Public MyRouter model id.

stop_reason
string

Why generation stopped.

usage
object

Runtime usage facts, not invoice-grade charge evidence.