Use the OpenAI Python SDK to call OpenDunes — install once, configure the base URL, and access every model.
OpenDunes is OpenAI-compatible. Point the official openai Python package at https://opendunes.com/v1 and you have full access to 200+ models, billed in Algerian Dinars.
pip install openaiimport os
from openai import OpenAI
client = OpenAI(
base_url="https://opendunes.com/v1",
api_key=os.environ["OPENDUNES_API_KEY"],
)Store your key in the environment — never hard-code it. Generate and manage keys from your dashboard.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://opendunes.com/v1",
api_key=os.environ["OPENDUNES_API_KEY"],
)
resp = client.chat.completions.create(
model="anthropic/claude-sonnet-5",
messages=[{"role": "user", "content": "Marhba! Say hello in one line."}],
)
print(resp.choices[0].message.content)| Resource | Status | Description |
|---|---|---|
| Chat | Live | Text and vision completions, streaming |
| Models | Live | Browse the model catalog |
| Credits | Live | Check your DA balance and usage |
| API Keys | Live | List, create, and revoke keys (management key) |
| Analytics | Live | Daily usage and spend rollups |
| Embeddings | Live | Vector embeddings |
| Generations | Live | One request's receipt, in DA, and feedback |
| Endpoints | Live | The providers serving one model, each with its price |
| Providers | Live | Every provider, with its policies |
| Benchmarks | Live | Benchmark and arena scores per model |
| Guardrails | Live | Budgets, model and provider lists, content filters on your keys (management key) |
| Observability | Live | Traces to your own monitoring tool (management key) |
| Presets | Live | Saved request settings, used as @preset/<slug> |
| OAuth | Live | Sign in with OpenDunes — PKCE |
| Files | Live | File uploads |
| Images | Live | Image generation |
| Responses | Live | Responses API — client.responses.create(...) |
| Rerank | Live | Document reranking |
| Speech-to-Text | Live | Audio transcription |
| Text-to-Speech | Live | Speech synthesis |
| Video Generation | Live | Video generation |