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

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g. deepseek-chat, claude-3-opus)
messagesarrayYesArray of conversation messages
max_tokensintegerNoMaximum number of tokens to generate
temperaturenumberNoSampling temperature (0–2)
streambooleanNoEnable SSE streaming
top_pnumberNoNucleus 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.