v1

latestOpenAPI 3.0.32026-07-2652923.8 KB
Anthropic Messages

Create a message

Creates a message using the Anthropic Messages API format. Set stream: true for server-sent events.

post/v1/messages

Headers

X-Free-Tier'true'

Set to true to use the single anonymous free request.

Request body

modelstring required

Model id (e.g. abliterated-model).

max_tokensinteger

Maximum number of tokens to generate.

temperaturenumber

Sampling temperature.

streamboolean

Enable Server-Sent Events streaming.

flagged_categoriesstring[]

Optional moderation categories to block. Supported: harassment, hate, illicit, sexual. Self-harm and sexual/minors are always blocked.

Response

Message response

idstring required

Unique message id (e.g. msg_01XFDUDYJgAACzvnptvVoYEL).

type'message' required
role'assistant' required
modelstring required
stop_reasonstring nullable

Reason the model stopped generating (e.g. end_turn, max_tokens).

stop_sequencestring nullable
remaining_creditsinteger nullable

User's remaining credit balance after this call.

estimated_credits_usedinteger

Credits consumed by this call.

estimated_cost_usdnumber

Estimated cost in USD.