Skip to main content
Docsapi

API Endpoints

Complete reference for all DeepAILab API endpoints. Each endpoint includes parameters, code examples, and response formats.

POSThttps://api.deepailab.ai/v1/chat/completions

Create Chat Completion#

Create a model response through the DeepAILab OpenAI-compatible gateway.

Request body

modelRequired
string

Model identifier from /v1/models/catalog.

messagesRequired
array

Conversation messages in OpenAI-compatible format.

streamOptional
boolean

Set true to stream response chunks.

Example request

bash
curl https://api.deepailab.ai/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "model": "deepseek-chat",
 "messages": [
 {"role": "user", "content": "Explain my current API usage."}
 ]
 }'

Response

json
{
 "id": "chatcmpl_123",
 "object": "chat.completion",
 "model": "deepseek-chat",
 "choices": [
 {
 "index": 0,
 "message": {"role": "assistant", "content": "Your current usage..."},
 "finish_reason": "stop"
 }
 ],
 "usage": {
 "prompt_tokens": 18,
 "completion_tokens": 42,
 "total_tokens": 60
 }
}
POSThttps://api.deepailab.ai/v1/responses

Create Response#

Create a response with DeepAILab's OpenAI-compatible Responses surface.

Request body

modelRequired
string

Model identifier from the current catalog.

inputRequired
string | array

User input or structured response input.

streamOptional
boolean

Set true to stream events.

Example request

bash
curl https://api.deepailab.ai/v1/responses \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "model": "deepseek-chat",
 "input": "Summarize the latest API error for this account."
 }'

Response

json
{
 "id": "resp_123",
 "object": "response",
 "model": "deepseek-chat",
 "output_text": "The latest API error was caused by...",
 "usage": {
 "input_tokens": 16,
 "output_tokens": 38,
 "total_tokens": 54
 }
}
GEThttps://api.deepailab.ai/v1/models/catalog

List Model Catalog#

Return the current DeepAILab model catalog with provider, routing, and pricing metadata.

Request body

providerOptional
string

Filter by provider name.

searchOptional
string

Search model ids, names, or provider labels.

Example request

bash
curl https://api.deepailab.ai/v1/models/catalog \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY"

Response

json
{
 "object": "list",
 "data": [
 {
 "id": "deepseek-chat",
 "provider": "DeepSeek",
 "context_window": 64000,
 "pricing": {"input_per_1m": 0.27, "output_per_1m": 1.1}
 }
 ]
}
GEThttps://api.deepailab.ai/v1/usage

List Usage Records#

Returns token usage records for API keys, product calls, and Dev Tools access under the current account.

Request body

modelOptional
string

Filter records by model identifier.

limitOptional
integer

Number of records to return (default: 20, max: 100).

afterOptional
string

Cursor for pagination. Use the id of the last usage record from the previous request.

Example request

bash
curl "https://api.deepailab.ai/v1/usage?limit=10" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY"

Response

json
{
 "object": "list",
 "data": [
 {
 "id": "usage_123",
 "object": "usage_record",
 "model": "claude-sonnet-4-6",
 "source": "api_key",
 "input_tokens": 1200,
 "output_tokens": 480,
 "total_tokens": 1680,
 "created_at": 1698765432,
 "cost_usd": 0.0124
 }
 ],
 "has_more": true
}