Official SDK examples
SDK code only; curl samples live on the verify page, response JSON on the API pages.
Model ID
Use IDs visible to your account: the recommended models table (pricing API) or
GET /v1/models. Don't copy sample names from docs/blogs.python
from openai import OpenAI
client = OpenAI(api_key="sk-xxxx", base_url="https://api.daoxe.com/v1")
print(client.chat.completions.create(
model="your-model-id",
messages=[{"role":"user","content":"ping"}],
max_tokens=64,
).choices[0].message.content)js
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-xxxx", baseURL: "https://api.daoxe.com/v1" });
const r = await client.chat.completions.create({
model: "your-model-id",
messages: [{ role: "user", content: "ping" }],
max_tokens: 64,
});
console.log(r.choices[0].message.content);python
import anthropic
client = anthropic.Anthropic(api_key="sk-xxxx", base_url="https://api.daoxe.com")
msg = client.messages.create(
model="your-claude-model-id",
max_tokens=64,
messages=[{"role":"user","content":"ping"}],
)
print(msg.content[0].text)Runnable repo: DaoXE-AI. Response / error samples: Chat · Messages.