Skip to main content
POST
/
v1
/
chat
/
completions
Create Chat Completion
curl --request POST \
  --url https://api.eachlabs.ai/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "Write a one sentence caption."
    }
  ]
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1773651600,
  "model": "eachlabs-llm-router",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "A cinematic sunset over the ocean."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.eachlabs.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key passed as an Authorization Bearer token for OpenAI-compatible endpoints

Headers

X-Eachlabs-Webhook-Url
string<uri>

Optional webhook URL for asynchronous result delivery.

Body

application/json

OpenAI-compatible chat completions request body

model
string
required

LLM model identifier

Example:

"openai/gpt-4o-mini"

messages
object[]
required

OpenAI-compatible chat messages

Example:
[
{
"role": "user",
"content": "Write a one sentence caption."
}
]
stream
boolean

OpenAI-compatible request flag. This endpoint returns a JSON response.

Example:

false

Response

OpenAI-compatible chat completion

OpenAI-compatible chat completions response

id
string
Example:

"chatcmpl-abc123"

object
string
Example:

"chat.completion"

created
integer<int64>
Example:

1773651600

model
string
Example:

"eachlabs-llm-router"

choices
object[]
usage
object
Last modified on May 28, 2026