Ask a text model
chat_completionOne chat completion on a text model: give the model (a text model id from list_models, modality text, or auto) and the messages; the answer is the model's message and the usage, with the credits charged. The most the request may cost is held first and the rest refunded. max_tokens bounds the answer and the hold: name it. Prices are per model in list_models. Text models are zero data retention except where marked: a model whose data_retention is not none keeps requests as that field says (for example 30 days by the model maker), and auto never picks one.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"messages": "<messages>"
},
"name": "chat_completion"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | A text model id from list_models (modality text), or auto. | |
| messages | Yes | The conversation, oldest first: objects with role (system, user, assistant) and content (text). | |
| max_tokens | No | The most tokens the model may write. Default: the model's max_output_tokens. | |
| temperature | No | ||
| reasoning_effort | No |