OpenAI Compatibility

Create Chat Completion

OpenAI-compatible chat completions endpoint backed by Eachlabs LLM Router. Use Authorization: Bearer <API_KEY> and point an OpenAI-compatible client at https://api.eachlabs.ai/v1.

This endpoint uses the OpenAI-compatible error envelope rather than the REST error body described in the global contract notes.

post/v1/chat/completions

Request

  • Base URL: https://api.eachlabs.ai
  • URL: https://api.eachlabs.ai/v1/chat/completions
  • Auth: HTTP bearer

Headers

X-Eachlabs-Webhook-Urlstring uri

Optional webhook URL for asynchronous result delivery.

Request body

modelstring required

Model ID. Any chat model ID from OpenRouter's model list works (for example openai/gpt-5.6-sol); see Available Models in the LLM Router docs.

messagesobject[] required

OpenAI-compatible chat messages

streamboolean

Set to true to receive OpenAI-compatible SSE chunks (text/event-stream) instead of a buffered JSON response.

Example request

{
  "model": "openai/gpt-5.6-sol",
  "messages": [
    {
      "role": "user",
      "content": "Write a one sentence caption."
    }
  ],
  "stream_options": {
    "include_usage": true
  }
}

Response

OpenAI-compatible chat completion. Requests with stream: true return Server-Sent Events.

idstring
objectstring
createdinteger
modelstring

Example response

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1773651600,
  "model": "eachlabs-llm-router",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "A cinematic sunset over the ocean."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.