Use the official OpenAI Python and Node SDKs with OpenDunes by pointing them at the OpenDunes base URL.
The OpenAI SDK is the canonical way to call OpenDunes from code. Because OpenDunes is OpenAI-compatible, you only need to change two things: the base URL and the API key. No other SDK configuration is needed.
Pass base_url (Python) or baseURL (Node/TypeScript) when constructing the client. Use your OPENDUNES_API_KEY environment variable — never a hardcoded key.
Set stream=True (Python) or stream: true (Node) to receive incremental delta chunks via server-sent events.
OpenDunes uses provider/model slugs — not the model IDs you pass to OpenAI. Browse the full catalog at /models or via the API at GET /api/models. Example slugs:
anthropic/claude-opus-4.8anthropic/claude-sonnet-5openai/gpt-5.4google/gemini-2.5-prometa-llama/llama-4-maverickThe SDK's request surface is honored today: model, messages, stream, max_tokens, max_completion_tokens, temperature (0–2), top_p (0–1), tools, tool_choice, parallel_tool_calls, response_format, stop, seed, frequency_penalty, presence_penalty, logprobs, top_logprobs, logit_bias, and more. OpenDunes extensions (models fallbacks, provider routing, the reasoning object) pass through extra_body. Check the API reference for the full list.
Create and manage keys from your dashboard. Keys look like sk- followed by a hex string and are shown once at creation. Store them as environment variables — never commit them to source control.