API reference
Chat completions
The primary endpoint for chat and agentic workloads.
POST
/v1/chat/completionsCreate a chat completion. OpenAI-compatible.
Request body
| Field | Type | Description |
|---|---|---|
| model | string | Model id from the catalog (required) |
| messages | array | List of { role, content } messages (required) |
| stream | boolean | Enable SSE streaming |
| temperature | number | Output creativity |
| max_tokens | number | Maximum output tokens |
| tools | array | Function calling (OpenAI format) |
Example
terminal.sh
curl https://api.sobatnetwork.com/v1/chat/completions \-H "Content-Type: application/json" \-H "Authorization: Bearer $SOBAT_API_KEY" \-d '{"model": "sobat/gpt-6-sol","messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Explain caching in one sentence."}],"max_tokens": 200}'
Response
response.json
{"id": "chatcmpl-...","object": "chat.completion","model": "sobat/gpt-6-sol","choices": [{"index": 0,"message": { "role": "assistant", "content": "..." },"finish_reason": "stop"}],"usage": {"prompt_tokens": 120,"completion_tokens": 48,"total_tokens": 168}}