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/responses endpoint implements OpenAI’s Responses API — a newer request format that replaces the messages array with an input field accepting either a plain string or a structured content array. It returns a richer response object that includes the model’s output items directly. A companion endpoint, /v1/responses/compact, returns only the output text, which is useful when you need a lightweight response without the full response envelope.
POST /v1/responses
Request parameters
The ID of the model to use. Use the list models endpoint to retrieve available model IDs.
The input prompt. Pass a plain string for simple text prompts, or an array of content objects for multi-modal or structured inputs.
When
true, the response streams as server-sent events. The stream ends with a response.completed event.System-level instructions for the model, equivalent to a
system message in the Chat Completions API.Sampling temperature between
0 and 2.Maximum number of tokens to generate in the response.
Example
Response
POST /v1/responses/compact
The compact variant accepts the same request body as/v1/responses but returns only the generated output text as a plain string, without the full response envelope. Use this endpoint when you only need the model’s reply and want to avoid parsing nested response objects.