Docs
Chat Completions
Updated 2026-07-21
Endpoint
POST https://api.rokoapi.com/v1/chat/completions
For an overview and model selection, see OpenAI-compatible API.
Request Example
curl https://api.rokoapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Introduce yourself in one sentence"}
]
}'
Key Parameters
| Parameter | Description |
|---|---|
model | Model ID. See Model list or the model documentation in the sidebar |
messages | Array of conversation messages (system / user / assistant / tool) |
stream | Whether to enable SSE streaming |
temperature | Sampling temperature |
max_tokens | Maximum tokens to generate (some models use max_completion_tokens) |
Response
On success, returns standard chat completion JSON. On error, returns a structure containing error.message . See Error codes.
Streaming
See Streaming requests.