Switch an existing OpenAI integration to OpenDunes by changing two lines.
If your app already calls the OpenAI API, switching to OpenDunes is two changes: the base URL and the key. Every request shape, SDK method, and streaming behavior stays identical.
Wherever you construct your OpenAI client, update baseURL and apiKey:
That's it. All your existing chat.completions.create(...) calls work without further modification.
OpenDunes uses provider/model slugs instead of bare model names. Swap them out:
| Your current value | OpenDunes equivalent |
|---|---|
gpt-5.4 (or similar) | openai/gpt-5.4 |
claude-opus-4.8 | anthropic/claude-opus-4.8 |
gemini-2.5-pro | google/gemini-2.5-pro |
llama-4-70b | meta-llama/llama-4-maverick |
Browse the full catalog at /models — every listing shows the exact slug to use.
Add the new key and (optionally) keep the old one during a parallel-run period:
Get your OpenDunes key from Dashboard → Keys. If you haven't created a custom key yet, the default key is ready to use immediately after signup.
Everything in chat/completions that you use today transfers over directly:
messages array with system, user, assistant rolesstream: true with the same SSE delta formatmax_tokens, temperature, top_pOpenDunes bills in Algerian Dinars (DA). Before your first request, deposit DA via SATIM (CIB / Edahabia cards) from Dashboard → Billing. Pricing is shown per million tokens in DA on the models page.
The response header X-Balance-Available tells you your remaining balance after every call, so you can build low-balance warnings without polling.
Almost everything transfers. Tool/function calling, JSON mode, structured outputs (response_format), and embeddings (/v1/embeddings) are all supported today. The one gap is the Responses API — /v1/responses is not yet available, so keep those calls on chat/completions.
Validation is forgiving: unknown fields in the request body are simply ignored, and an invalid field value returns a 422 validation error naming the field to fix.
Everything else — chat completions, streaming, vision inputs, rate limiting, multi-turn history — works today.
A quick sanity check after you've updated the client:
A 200 with a valid choice means the migration is complete.