API reference
Chat Completions
Models on this endpoint (5)
/v1/chat/completionsThe workhorse endpoint: multi-turn chat, streaming, tool calling, vision and JSON mode for every chat-capable model in the catalogue.
#Request parameters
modelstringrequiredModel ID from /v1/models. The gateway resolves the upstream vendor from this value.
messagesarrayrequiredConversation turns: {role: system|user|assistant|tool, content}. Content may be a string or a multimodal part array.
streambooleanoptionaltrue streams SSE deltas, closed by data: [DONE].
temperaturenumberoptional0 to 2. Leave empty for the model default.
max_tokensintegeroptionalUpper bound on generated tokens; also caps the pre-reserved quota estimate.
toolsarrayoptionalFunction declarations the model may call — see the tool-calling guide.
tool_choicestring | objectoptional"auto", "none", or pin a specific function.
response_formatobjectoptional{"type":"json_object"} or a json_schema wrapper for structured output on supporting models.
top_pnumberoptionalNucleus sampling; use temperature or top_p, not both.
stopstring | arrayoptionalUp to 4 stop sequences that cut generation.
#Related errors
- 400 invalid_request_errorMalformed body or unsupported parameter for this model.
- 401Invalid or missing bearer token. No error.code on this path — match the status.
- 402 insufficient_user_quotaWallet balance cannot cover the pre-reserved estimate.
- 429Per-key throttle. Empty body; wait for Retry-After. A 429 that does carry insufficient_user_quota is a daily spend cap instead.
- 503 model_not_foundUnknown model, or no healthy channel serves it right now.
#Request example
curl https://www.aisplice.store/v1/chat/completions \
-H "Authorization: Bearer sk-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.6-luna",
"messages": [{"role": "user", "content": "Say hello."}]
}'#Response
{
"id": "chatcmpl-…",
"object": "chat.completion",
"model": "gpt-5.6-luna",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "Hello!"},
"finish_reason": "stop"
}],
"usage": {"prompt_tokens": 9, "completion_tokens": 3, "total_tokens": 12}
}Still stuck?
Send us the request ID or the error message and we will look into it.