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.
| Header | Value |
|---|
Authorization | Bearer eth-... (or x-api-key: eth-...) |
Content-Type | application/json |
Body parameters
Model ID: claude-opus-4-8, claude-sonnet-4-6, or claude-haiku-4-5.
A list of messages. Each is { "role": "system" | "user" | "assistant", "content": string }.
If true, the response arrives as a stream (SSE). See Streaming.
Maximum number of tokens in the response.
Creativity, 0–2. Lower is more deterministic.
Nucleus sampling, an alternative to temperature.
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).