Skip to main content
POST https://api.ethereal.llc/v1/chat/completions
The main endpoint. The request and response format matches OpenAI Chat Completions, so the official OpenAI SDKs work.

Headers

HeaderValue
AuthorizationBearer eth-... (or x-api-key: eth-...)
Content-Typeapplication/json

Body parameters

model
string
required
Model ID: claude-opus-4-8, claude-sonnet-4-6, or claude-haiku-4-5.
messages
array
required
A list of messages. Each is { "role": "system" | "user" | "assistant", "content": string }.
stream
boolean
default:"false"
If true, the response arrives as a stream (SSE). See Streaming.
max_tokens
integer
Maximum number of tokens in the response.
temperature
number
default:"1"
Creativity, 0–2. Lower is more deterministic.
top_p
number
Nucleus sampling, an alternative to temperature.
stop
string | string[]
Stop sequences.

Example request

curl https://api.ethereal.llc/v1/chat/completions \
  -H "Authorization: Bearer eth-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "messages": [
      { "role": "system", "content": "You are a concise assistant." },
      { "role": "user", "content": "Explain recursion in one sentence." }
    ],
    "max_tokens": 200
  }'

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1780000000,
  "model": "claude-sonnet-4-6",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Recursion is when a function calls itself until it reaches a base case." },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 28, "completion_tokens": 17, "total_tokens": 45 }
}
The usage field shows the tokens spent — the charge is calculated from them (Pricing).