Skip to main content

Chat Completions

POST /v1/chat/completions

Create a model response for the given conversation. Supports multi-turn conversations, streaming, function calling, and both mainstream vendor models and DeepAILab smart-route products.

Endpoint

POST https://deepailab.ai/v1/chat/completions

Request Example

curl https://deepailab.ai/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "model": "claude-sonnet-4-6",
 "messages": [
 {"role": "system", "content": "You are a helpful assistant."},
 {"role": "user", "content": "Summarize the three key factors to consider when choosing a production model."}
 ],
 "temperature": 0.7,
 "max_tokens": 1000
 }'

Request Parameters

ParameterTypeRequiredComplete reference for all DeepAILab API endpoints. Each endpoint includes parameters, code examples, and response formats.
modelstring
Required
Model ID to use, e.g. claude-sonnet-4-5, gpt-5.3-codex, gemini-3-flash, deepai-chat, or deepailab-sup
messagesarray
Required
List of messages with role and content
temperaturenumber
Optional
Sampling temperature 0-2, default 1. Lower is more deterministic
max_tokensinteger
Optional
Maximum tokens to generate
streamboolean
Optional
Enable streaming output, default false

Response Example

{
 "id": "chatcmpl-abc123",
 "object": "chat.completion",
 "created": 1704067200,
"model": "claude-sonnet-4-6",
 "choices": [
 {
 "index": 0,
 "message": {
 "role": "assistant",
 "content": "When selecting a model, compare quality, latency, and cost. Favor higher-quality models for coding and complex reasoning, optimize for latency in high-throughput scenarios, and then balance price with context window size for production."
 },
 "finish_reason": "stop"
 }
 ],
 "usage": {
 "prompt_tokens": 25,
 "completion_tokens": 150,
 "total_tokens": 175
 }
}

Supported Models

claude-sonnet-4-6
Anthropic
Vendor flagship
gpt-5.3-codex
OpenAI
Vendor flagship
gemini-3-flash
Google
Vendor multimodal flagship
deepailab-dal
DeepAILab
Smart route product
deepseek-chat
DeepSeek
Vendor reasoning
deepai-chat
DeepAILab
Smart route product
deepai-coder
DeepAILab
Smart route product
deepailab-sup
DeepAILab
System product route
gemini-3-flash
Google
Vendor fast path

These are representative examples only. Query /v1/models/catalog for the live catalog with vendor and brand metadata.