Chat completions
POST /v1/chat/completions: OpenAI format for SDKs and most coding tools.
POST https://ai.sivcloud.com/v1/chat/completions uses the OpenAI Chat Completions format. OpenAI SDKs work unchanged apart from the base URL and the API key.
curl https://ai.sivcloud.com/v1/chat/completions \
-H "Authorization: Bearer $SIVCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4.1-flash",
"messages": [
{"role": "system", "content": "Answer briefly."},
{"role": "user", "content": "Hello"}
],
"max_tokens": 256
}'
Response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "deepseek-v4.1-flash",
"choices": [
{"index": 0, "message": {"role": "assistant", "content": "Hello!"}, "finish_reason": "stop"}
],
"usage": {
"prompt_tokens": 20,
"completion_tokens": 3,
"total_tokens": 23,
"prompt_tokens_details": {"cached_tokens": 0}
}
}
usage is the basis of the bill. prompt_tokens_details.cached_tokens holds the input tokens read from cache. See Cache.
Good to know
modelmust be a model id from the Models page orGET /v1/models.- Set
max_tokens. Before a request is forwarded, sivcloud reserves its estimated cost from the prompt andmax_tokens. A balance too small for that reserve is rejected withinsufficient_balance. The unused part of the reserve is returned when the request ends. - For a step-by-step answer, send
"stream": true. See Streaming. - Other parameters follow the model and its provider. A parameter the model does not support may be ignored or rejected by the provider.