Go from zero to your first AI-generated response in under five minutes.
Sign up at app.dos.ai. Every new account receives $5 in free credits -- no credit card required.
- Log in to the DOS AI dashboard.
- Navigate to API Keys in the sidebar.
- Click Create new key.
- Copy the key (it starts with
dos_sk_). Store it somewhere safe -- you won't be able to see it again.
DOS AI is fully compatible with the OpenAI SDK. Install it and point it at our API.
pip install openaifrom openai import OpenAI
client = OpenAI(
base_url="https://api.dos.ai/v1",
api_key="dos_sk_...", # Replace with your key
)
response = client.chat.completions.create(
model="dos-ai",
messages=[
{"role": "user", "content": "What is the capital of France?"}
],
)
print(response.choices[0].message.content)npm install openaiimport OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.dos.ai/v1",
apiKey: "dos_sk_...", // Replace with your key
});
const response = await client.chat.completions.create({
model: "dos-ai",
messages: [
{ role: "user", content: "What is the capital of France?" }
],
});
console.log(response.choices[0].message.content);curl https://api.dos.ai/v1/chat/completions \
-H "Authorization: Bearer dos_sk_..." \
-H "Content-Type: application/json" \
-d '{
"model": "dos-ai",
"messages": [
{"role": "user", "content": "What is the capital of France?"}
]
}'Streaming lets you receive tokens as they are generated, giving your users a real-time typing experience.
from openai import OpenAI
client = OpenAI(
base_url="https://api.dos.ai/v1",
api_key="dos_sk_...",
)
stream = client.chat.completions.create(
model="dos-ai",
messages=[
{"role": "user", "content": "Write a short poem about open-source AI."}
],
stream=True,
)
for chunk in stream:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)
print()import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.dos.ai/v1",
apiKey: "dos_sk_...",
});
const stream = await client.chat.completions.create({
model: "dos-ai",
messages: [
{ role: "user", content: "Write a short poem about open-source AI." }
],
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) process.stdout.write(content);
}
console.log();curl https://api.dos.ai/v1/chat/completions \
-H "Authorization: Bearer dos_sk_..." \
-H "Content-Type: application/json" \
-d '{
"model": "dos-ai",
"messages": [
{"role": "user", "content": "Write a short poem about open-source AI."}
],
"stream": true
}'- Manage your keys: Authentication
- Migrate from OpenAI: OpenAI Compatibility
- Check available models:
GET https://api.dos.ai/v1/models
Tip: Since DOS AI is OpenAI-compatible, any tutorial, library, or framework that works with the OpenAI API also works with DOS AI. Just change the base URL and API key.