Use the OpenAI Node.js SDK to call the OpenDunes API from TypeScript or Node.
The OpenDunes API is OpenAI-compatible, so you can use the official openai npm package without any wrapper — just point it at the OpenDunes base URL and supply your key.
npm install openai
# or
pnpm add openaiimport OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://opendunes.com/v1",
apiKey: process.env.OPENDUNES_API_KEY,
});Store your key in an environment variable — never hard-code it. You can create and rotate keys from your dashboard.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://opendunes.com/v1",
apiKey: process.env.OPENDUNES_API_KEY,
});
const resp = await client.chat.completions.create({
model: "anthropic/claude-sonnet-5",
messages: [{ role: "user", content: "Marhba! Say hello in one line." }],
});
console.log(resp.choices[0].message.content);Models are referenced by provider/model slug. Browse the full catalog at /models or fetch it programmatically via Models.
| Resource | Status | Path |
|---|---|---|
| Chat | Live | client.chat.completions.create(...) |
| Models | Live | GET /api/models |
| Credits | Live | GET /v1/credits |
| API Keys | Live | /v1/keys |
| Analytics | Live | GET /v1/activity |
| Embeddings | Live | — |
| Generations | Live | GET /v1/generation |
| Endpoints | Live | GET /v1/models/{lab}/{model}/endpoints |
| Providers | Live | GET /v1/providers |
| Benchmarks | Live | GET /v1/benchmarks |
| Guardrails | Live | /v1/guardrails |
| Observability | Live | /v1/observability/destinations |
| Presets | Live | model: "@preset/<slug>" |
| OAuth | Live | POST /v1/auth/keys |
| Files | Live | client.files.create(...) |
| Images | Live | — |
| Responses | Live | client.responses.create(...) |
| Rerank | Live | — |
| Speech-to-Text | Live | — |
| Text-to-Speech | Live | — |
| Video Generation | Live | — |