Chat Completions API Quickstart
OpenAI-compatible chat completions for Claude Sonnet 4 and other LLMs on ModKie.
Chat Completions API Quickstart
Conversational AI models including Claude Sonnet 4. Chat models use the OpenAI-compatible gateway — not the async Jobs API.
Capabilities: chat completions
Playground: /playground/claude-chat
Estimated cost: from 5 credits per request (token metering may apply — see pricing)
Authentication
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonQuick Start
Kie market chat models (codex, gpt-5-*, gemini-*, catalog claude-*) should send "provider": "kie". If omitted, the gateway still routes known Kie catalog ids to Kie (not OpenRouter).
curl -X POST "https://modkie.com/api/gateway/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "kie",
"model": "codex",
"messages": [
{ "role": "user", "content": "Summarize the benefits of a unified AI API." }
]
}'OpenRouter-style org/model ids (e.g. anthropic/claude-sonnet-4) still default to OpenRouter when provider is omitted.
Response follows the OpenAI chat completions format with choices[].message.content.
Streaming
Add "stream": true to receive Server-Sent Events:
{
"model": "anthropic/claude-sonnet-4",
"stream": true,
"messages": [{ "role": "user", "content": "Hello" }]
}Key Parameters
| Parameter | Type | Description |
|---|---|---|
model | string | Catalog model id, e.g. anthropic/claude-sonnet-4 |
messages | array | Chat history with role and content |
stream | boolean | Enable streaming responses |
temperature | number | Optional sampling temperature |
Billing
Chat requests are billed synchronously based on model credit rates and token usage. Check balance with Get Remaining Credits.
Next Steps
- Market Models — all available LLMs
- Get Remaining Credits
- Getting Started — platform overview