OpenAI API
Fully compatible with the OpenAI /v1/chat/completions endpoint. Use any OpenAI SDK or plain HTTP client.
Endpoint
POST https://api.eclogue.ai/v1/chat/completions Example request
{
"model": "deepseek-chat",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"max_tokens": 100,
"temperature": 0.7,
"stream": false
} Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID (e.g. deepseek-chat, claude-3-opus) |
messages | array | Yes | Array of conversation messages |
max_tokens | integer | No | Maximum number of tokens to generate |
temperature | number | No | Sampling temperature (0–2) |
stream | boolean | No | Enable SSE streaming |
top_p | number | No | Nucleus sampling parameter |
Example response
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "deepseek-chat",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 8,
"total_tokens": 33
}
} Streaming
Set "stream": true to receive Server-Sent Events (SSE):
curl -X POST https://api.eclogue.ai/v1/chat/completions \
-H "Authorization: Bearer gw-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-chat","messages":[{"role":"user","content":"Hi"}],"stream":true}' Model routing
The gateway routes each request to the best available node based on the model parameter, with built-in load balancing and automatic failover.