Documentation

Text Generation (Claude)

Generate text with the Anthropic-compatible Messages format

POSThttps://api.tokenbyte.ai/v1/messages

Send Authorization: Bearer <TOKENBYTE_API_KEY>, anthropic-version: 2023-06-01, and Content-Type: application/json.

Request body

FieldTypeRequiredDescription
modelstringYesFull model ID supporting Messages
messagesarrayYesAlternating user and assistant messages
max_tokensintegerYesMaximum output tokens
systemstring/arrayNoSystem instruction
streambooleanNoReturn SSE events
temperature, top_p, top_knumberNoSampling controls
stop_sequencesarrayNoCustom stop sequences
tools, tool_choicearray/objectNoTools and selection policy
thinkingobjectNoExtended thinking when supported

Message content may be a string or blocks such as text, image, tool_use, and tool_result. Non-streaming text is returned in content[].text; streaming uses Anthropic message and content-block events.