Text Generation (Claude)
Generate text with the Anthropic-compatible Messages format
POST
https://api.tokenbyte.ai/v1/messagesSend Authorization: Bearer <TOKENBYTE_API_KEY>, anthropic-version: 2023-06-01, and Content-Type: application/json.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Full model ID supporting Messages |
messages | array | Yes | Alternating user and assistant messages |
max_tokens | integer | Yes | Maximum output tokens |
system | string/array | No | System instruction |
stream | boolean | No | Return SSE events |
temperature, top_p, top_k | number | No | Sampling controls |
stop_sequences | array | No | Custom stop sequences |
tools, tool_choice | array/object | No | Tools and selection policy |
thinking | object | No | Extended 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.