Messages
https://api.tokenbay.com/v1/messagesAnthropic-compatible Messages entry
Messages Endpoint
TokenBay currently registers an Anthropic-compatible Messages creation path.
/v1/messagesRequest
schemamodelstringRequiredAn available Claude/Anthropic-compatible model ID shown on the live Models page or in the console.
max_tokensintegerRequiredMaximum output tokens.
messagesarray<object>Required
Anthropic Messages array. content may include text, image, tool_result, and other blocks.
messages[].rolestringRequireduser or assistant.
messages[].contentstring | array<object>Required
Text or content block array.
content[].typestringOptionalContent block type: text, image, tool_use, tool_result, thinking, and similar blocks.
content[].textstringOptionalText content.
content[].sourceobjectOptionalImage source, usually containing type, media_type, data, or url.
content[].idstringOptionaltool_use or tool_result ID.
content[].namestringOptionalTool name.
content[].inputobjectOptionaltool_use input.
content[].contentstring | array<object>Optionaltool_result content.
content[].cache_controlobjectOptionalPrompt caching control. Support depends on the model and upstream.
systemstring | array<object>Optional
System prompt.
system[].typestringOptionalSystem content block type, usually text.
system[].textstringOptionalSystem prompt text.
system[].cache_controlobjectOptionalSystem prompt cache control.
streambooleanOptionalSet true to receive Anthropic SSE events.
temperature / top_p / top_knumberOptionalSampling controls.
stop_sequencesstring[]OptionalSequences where generation should stop.
tools / tool_choicearray<object> | objectOptional
Anthropic tool calling configuration.
tools[].namestringOptionalTool name.
tools[].descriptionstringOptionalTool description.
tools[].input_schemaobjectOptionalTool input JSON Schema.
tool_choice.typestringOptionalauto, any, tool, none, and similar modes.
tool_choice.namestringOptionalSpecific tool name.
thinkingobjectOptional
Extended thinking configuration for models that support it.
thinking.typestringOptionalenabled or disabled.
thinking.budget_tokensintegerOptionalThinking token budget.
metadataobjectOptionalClient-side tracing fields. Do not include sensitive data.
Response
schemaNon-streaming responses keep the Anthropic Messages shape. Streaming calls return Anthropic SSE events.
idstringOptionalMessage ID.
typestringOptionalUsually message.
rolestringOptionalUsually assistant.
content[]array<object>Optional
Output content blocks, such as text, tool_use, or thinking.
content[].typestringOptionalOutput block type, such as text, tool_use, or thinking.
content[].textstringOptionalText output.
content[].idstringOptionalTool call ID.
content[].namestringOptionalTool name.
content[].inputobjectOptionalTool input arguments.
modelstringOptionalActual response model.
stop_reasonstringOptionalWhy generation stopped.
usageobjectOptional
Input and output token usage.
usage.input_tokensintegerOptionalInput token count.
usage.output_tokensintegerOptionalOutput token count.
usage.cache_creation_input_tokensintegerOptionalCache creation token count when supported.
usage.cache_read_input_tokensintegerOptionalCache read token count when supported.
Clients authenticate to TokenBay with Authorization: Bearer. Real upstream Anthropic credentials and related headers are handled by the gateway credential resolver and adapter layer.
