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

ParameterDescription
modelModel ID. See Model list or the model documentation in the sidebar
messagesArray of conversation messages (system / user / assistant / tool
streamWhether to enable SSE streaming
temperatureSampling temperature
max_tokensMaximum 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.