services / chat
Chat Completions (Mistral Small 4, OpenAI format)
OpenAI-compatible chat completions from Mistral Small 4 (Mistral AI), paid per call: send messages, get choices with the assistant message, tool calls and token usage. Flat $0.003 per call for up to 11,000 characters of input (messages, tools and schema as JSON) and up to 800 output tokens. Supports system prompts, JSON mode, JSON schema output and function calling. Also at POST https://agentsvc.io/v1/chat/completions for the OpenAI SDK (model mistral-small-latest). Fast and cheap for agent steps, classification, rewriting, extraction and tool use. EU model: Mistral AI (France), GDPR processor agreement, API data is not used for training. Failed calls are not charged. Use is subject to the agentsvc.io terms and the Mistral AI Usage Policy.
Call it
Input
| Field | Type | Description |
|---|---|---|
| messages | array | Conversation in OpenAI format: [{"role": "system"|"user"|"assistant"|"tool", "content": "..."}]. Text only. Shortcut instead: prompt (+ system) |
| prompt | string | Shortcut for a single user message (use instead of messages) |
| system | string | System prompt, only together with prompt |
| max_tokens | integer | Max output tokens, capped at 800 (default 800) |
| temperature | number | 0 to 1.5 |
| top_p | number | |
| seed | integer | |
| stop | string,array | |
| response_format | object | {"type": "json_object"} or {"type": "json_schema", "json_schema": {...}} |
| tools | array | Function tools in OpenAI format, max 32 |
| tool_choice | string,object | auto, none, required or a named function |
Output
| Field | Type | Description |
|---|---|---|
| id | string | |
| object | string | |
| created | integer | |
| model | string | |
| choices | array | |
| usage | object | |
| provider | string | |
| limits | object | |
| notice | string |
Example response (data)
{
"id": "c4f6d32a98f54897bdd713c0f1a6cc09",
"object": "chat.completion",
"created": 1796396198,
"model": "mistral-small-2603",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"tool_calls": null,
"content": "The capital of France is Paris."
}
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 8,
"total_tokens": 33
},
"provider": "Mistral AI",
"limits": {
"max_input_chars": 11000,
"max_tokens": 800
},
"notice": "AI-generated by a Mistral AI model via agentsvc.io. Use is subject to https://agentsvc.io/terms#ai-chat and the Mistral AI Usage Policy (https://legal.mistral.ai/terms/usage-policy). Do not present it as written by a human."
}