Eterial Docs

Quickstart

Create a key, point your SDK at Eterial, and send your first request.

Create an API key

Open the dashboard, create a key, and copy it — it is shown once and stored hashed afterwards.

export ETERIAL_API_KEY="zl_live_..."

Top up your balance

Requests are paid for from your account balance. Add funds under Billing in the dashboard.

Send a request

The only change to an existing integration is the base URL.

curl https://chat.eterial.ai/v1/chat/completions \
  -H "Authorization: Bearer $ETERIAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m2.7",
    "messages": [
      { "role": "user", "content": "Hi! How are you doing today?" }
    ]
  }'

Check what it cost

Every response carries the usual usage block.

{
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 214,
    "total_tokens": 232
  }
}

What those tokens cost depends on which backend served the request — see Pricing. The Usage page in the dashboard breaks the same numbers down by key and by model.

Streaming

Set stream: true and read server-sent events, exactly as you would against OpenAI.

curl https://chat.eterial.ai/v1/chat/completions \
  -H "Authorization: Bearer $ETERIAL_API_KEY" \
  -H "Content-Type: application/json" \
  -N \
  -d '{
    "model": "minimax-m2.7",
    "messages": [{ "role": "user", "content": "Count to five." }],
    "stream": true
  }'

When something fails

Errors come back in the OpenAI envelope — error.message and error.type. The three that catch people on the first day:

StatustypeWhen you see it
401invalid_request_errorKey missing or invalid. Carries code: missing_api_key / invalid_api_key.
402insufficient_funds_errorYour balance cannot cover the request.
404invalid_request_errorUnknown model.

Errors lists every status the API returns.

Failover is automatic

A node dropping out is not one of these. The request is retried against the equivalent model on OpenRouter before any error reaches you — see Failover & retries.

On this page