Skip to main content
POST
Anthropic Chat

Authorizations

X-Api-Key
string
header
required

Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".

Body

application/json
messages
object[]
required

Message list

Minimum array length: 1
Example:
model
string
required

Anthropic channel model ID. First call the Chat Model List endpoint (GET /api/ai/models/chat), then select data[n].name where channel is anthropic.

Example:

"claude-sonnet-5"

max_tokens
integer
default:32000

Maximum output tokens. The allowed range is 1 to 9007199254740991 and the default is 32000; the example uses 64 to limit test usage.

Required range: 1 <= x <= 9007199254740991
Example:

64

Response

200 - text/event-stream

Native third-party protocol response or SSE data, not wrapped in the AiToEarn common response envelope.

SSE event stream using the Anthropic Messages protocol.

Last modified on September 29, 2026