TheDocumentation Index
Fetch the complete documentation index at: https://docs.tokmodel.com/llms.txt
Use this file to discover all available pages before exploring further.
/v1/messages endpoint is compatible with the Anthropic Messages API format, making it easy to migrate workloads from Anthropic’s SDK or to use libraries that target Anthropic directly. You authenticate using your TokModel API key — you do not need an Anthropic API key. Route your Anthropic SDK to https://tokmodel.com and use your TokModel key to start using any model available on TokModel through the familiar Anthropic message format.
Request parameters
The ID of the model to use. You can use Anthropic model IDs (for example,
anthropic/claude-opus-4-5) as well as any other model available on TokModel.An array of message objects representing the conversation. Each object requires a
role ("user" or "assistant") and a content field (a string or array of content blocks).The maximum number of tokens to generate. This parameter is required by the Anthropic format.
A system prompt that sets the context and instructions for the model. Equivalent to a
system role message in other formats.Sampling temperature between
0 and 1. Lower values produce more consistent output.When
true, streams the response as server-sent events in Anthropic’s streaming format.Nucleus sampling threshold. Limits token selection to the smallest set whose cumulative probability exceeds
top_p.An array of strings that cause the model to stop generating when encountered.
Response fields
A unique identifier for the message, prefixed with
msg_.Always
"message".Always
"assistant" for generated responses.An array of content blocks in the response. Each block has a
type field (typically "text") and a text field with the generated content.The reason generation stopped. One of
"end_turn" (natural end), "max_tokens" (token limit reached), or "stop_sequence" (a stop sequence was matched).The model that generated the response.
Token counts for the request.
Example
Authenticate with your TokModel API key. You do not need an Anthropic API key to use this endpoint.