Eterial Docs
Migrating

From OpenAI

Swap the base URL and the key, and keep the rest of your OpenAI integration as it is.

Two lines change. Everything else in your code stays where it is.

client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"],   
    api_key=os.environ["ETERIAL_API_KEY"],  
    base_url="https://chat.eterial.ai/v1",  
)

The official openai SDKs work unmodified, as does anything built on them — LangChain, LlamaIndex, the Vercel AI SDK, Cline, OpenWebUI.

The parameters we do not document

Your request reaches the model with the fields you sent it. Whether a given one does anything is the model's decision rather than ours — seed, logprobs, logit_bias and friends are neither rejected nor guaranteed. If your code depends on one of them, test it against the model you intend to use.

Choosing a model

There is no automatic mapping from an OpenAI model name; pick one from the catalogue and put its id in model.

ModelGood for
minimax-m2.7General chat and everyday work
kimi-k2.6Simple coding tasks, and the only one that takes images and PDFs
deepseek-v4-flashHigh-volume, simple work — the cheapest of the three
glm-5.2 Coming soonFrontier-class coding — the heavyweight of the catalogue

GET /v1/models returns the live list with the capabilities each model advertises.

What is not here

Eterial serves two endpoints: POST /v1/chat/completions and GET /v1/models. Nothing else in the OpenAI surface exists — there is no embeddings endpoint, no images, no audio, no files, no assistants, no batch, no moderations, and no legacy /v1/completions. A call to any of them is a 404, not a fallback.

If part of your system needs embeddings, that part keeps talking to whoever serves it today.

Differences worth knowing before you switch

  • Capabilities narrow the routing. Asking for tools, reasoning, image or file input restricts the request to backends that advertise the capability. Combining two capabilities that no single backend offers together is rejected with a 400, even when /v1/models lists both for that model.
  • Web search is served here, not by the model. OpenAI's web_search_options is honoured — see Web search.
  • Request bodies are capped at 8 MiB. Over that you get a 413.
  • A non-streamed request has five minutes to produce an answer; past that it is a 504. Streamed requests may run considerably longer.
  • Errors use the OpenAI envelope, plus a stable error.code OpenAI does not send. Branch on that rather than on the message — see Errors.
  • Idempotency-Key is supported, which OpenAI's chat endpoint does not offer. Send the same key twice and the second call is a 409 while the first is still in flight.

On this page