API documentation
DEVSAIO is one HTTPS API for the AI models listed on the model directory. It speaks the OpenAI format (chat completions, Responses, images) and the Anthropic Messages format, so existing SDKs and tools work by changing the base URL and key.
Quickstart
- Create an account and an API key. Keys are created on API Keys and start with
dsk_. The full key is shown once. - Add balance. Usage is prepaid. Top up on Billing.
- Send a request to
https://devsaio.lol/v1with your key:
curl https://devsaio.lol/v1/chat/completions \
-H "Authorization: Bearer $DEVSAIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-4.6",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'# pip install openai
from openai import OpenAI
client = OpenAI(base_url="https://devsaio.lol/v1", api_key="dsk_...")
r = client.chat.completions.create(
model="grok-4.6",
messages=[{"role": "user", "content": "Say hello in one sentence."}],
)
print(r.choices[0].message.content)// npm install openai
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://devsaio.lol/v1", apiKey: process.env.DEVSAIO_API_KEY });
const r = await client.chat.completions.create({
model: "grok-4.6",
messages: [{ role: "user", content: "Say hello in one sentence." }],
});
console.log(r.choices[0].message.content);Authentication
Every request needs an API key. Send it in either header:
| Header | Format | Used by |
|---|---|---|
Authorization | Bearer dsk_… | OpenAI SDKs, cURL, most tools |
x-api-key | dsk_… | Anthropic SDKs and Claude Code |
Model identifiers
Use the exact id from GET /v1/models or the model directory in the model field. Ids are lowercase, for example grok-4.6. Only models an administrator has published and priced are callable; anything else returns 404 model_not_found.
GET List models
Returns every model you can call right now, in the OpenAI list format.
curl https://devsaio.lol/v1/models \
-H "Authorization: Bearer $DEVSAIO_API_KEY"{
"object": "list",
"data": [
{ "id": "grok-4.6", "object": "model", "created": 0, "owned_by": "…" }
]
}POST Chat completions
OpenAI-compatible. The request body is forwarded to the model unchanged apart from the model id, so the parameters a model supports upstream (such as tools, response_format or temperature) work as documented by its provider.
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | Yes | A model id from /v1/models. |
messages | array | Yes | Objects with role and content. |
stream | boolean | No | Server-sent events. See Streaming. |
max_tokens | integer | No | Caps the output. Also used to size the balance hold. |
POST Anthropic Messages
The native Anthropic format, used by Claude Code and the Anthropic SDKs. The anthropic-version and anthropic-beta headers are passed through, errors come back in Anthropic's format, and POST /v1/messages/count_tokens is available free of charge.
# pip install anthropic
import anthropic
client = anthropic.Anthropic(base_url="https://devsaio.lol", api_key="dsk_...")
msg = client.messages.create(
model="grok-4.6",
max_tokens=512,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)export ANTHROPIC_BASE_URL="https://devsaio.lol"
export ANTHROPIC_AUTH_TOKEN="dsk_..."
claudePOST Responses (Codex)
The OpenAI Responses API, which Codex CLI uses. Configure Codex with wire_api = "responses"; the Codex guide generates the full config.toml.
POST Image generation
OpenAI images format. Image models are billed per image, at the price shown on the pricing page.
curl https://devsaio.lol/v1/images/generations \
-H "Authorization: Bearer $DEVSAIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "IMAGE_MODEL_ID", "prompt": "A lighthouse at dusk", "n": 1}'POST Video generation
Videos are generated in the background. Create a job, poll it until status is completed, then download the MP4. Video models are billed per second of video (the seconds you request, default 5) when the job is created. If a job fails, the charge is refunded automatically the first time you poll it.
curl https://devsaio.lol/v1/videos \
-H "Authorization: Bearer $DEVSAIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "VIDEO_MODEL_ID", "prompt": "A paper boat sailing down a rainy street", "seconds": "5", "size": "1280x720"}'curl https://devsaio.lol/v1/videos/VIDEO_ID \
-H "Authorization: Bearer $DEVSAIO_API_KEY"
# → {"id": "...", "status": "in_progress", "progress": 40}curl -L https://devsaio.lol/v1/videos/VIDEO_ID/content \
-H "Authorization: Bearer $DEVSAIO_API_KEY" -o video.mp4Prefer a UI? Use Video Studio in your dashboard.
Streaming
Set "stream": true to receive server-sent events as the model writes. Chunks are passed through as the upstream sends them, in OpenAI or Anthropic format depending on the endpoint. Usage is read from the final event, and you are charged once when the stream ends. If the stream fails before any usage is reported, you are not charged.
stream = client.chat.completions.create(
model="grok-4.6",
messages=[{"role": "user", "content": "Count to five"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")Errors
Errors use the OpenAI shape {"error": {"message", "type", "code"}}, or Anthropic's shape on /v1/messages. Requests that fail are not charged.
| Status | Code | Meaning and fix |
|---|---|---|
| 400 | invalid_json, missing_model | The body is not JSON or has no model. |
| 401 | invalid_api_key | Missing, wrong or revoked key, or the account is suspended. |
| 402 | insufficient_funds | Balance too low for the request. Top up. |
| 404 | model_not_found, endpoint_not_available | Unknown model id, or an endpoint not enabled on this server. |
| 409 | idempotency_conflict | An Idempotency-Key was reused. The first request stands; you were not charged twice. |
| 429 | rate_limit_exceeded, key_limit_exceeded | Too many requests per minute (see Retry-After), or the key's monthly spending limit was reached. |
| 502 | upstream error | The model provider failed. Retry later; nothing was charged. |
| 503 | model_unpriced | The model is listed but has no price yet. |
Idempotency and retries
Send a unique Idempotency-Key header (for example a UUID per logical request). If a network error makes you retry with the same key, DEVSAIO refuses the duplicate with 409 instead of running and billing it twice.
curl https://devsaio.lol/v1/chat/completions \
-H "Authorization: Bearer $DEVSAIO_API_KEY" \
-H "Idempotency-Key: order-1042" \
-H "Content-Type: application/json" \
-d '{"model": "grok-4.6", "messages": [{"role": "user", "content": "Hi"}]}'Usage and billing
- Prepaid. Calls are paid from your balance. There is no subscription.
- Per-token or per-image prices are shown on the pricing page and in your dashboard, in USD per million tokens or per image.
- Hold, then exact charge. Before a call, an estimated amount is held from your balance. When the call finishes, you are charged the exact cost from the reported token usage and the rest of the hold is released.
- Prompt caching. When a provider reports cached input, cache reads are billed at 10% of the input price and cache writes at 125%, matching how the providers price them.
- Failed requests are free. Errors and upstream failures release the hold without a charge.
- Every call, with tokens, latency and cost, is in Usage Logs and can be exported to CSV.
API key management
On API Keys you can create keys per project, set an optional monthly spending limit on each, see each key's spend this month and when it was last used, and revoke a key immediately. A revoked key stops working on the next request.
Integration guides
Ready-made settings, with your key filled in when you are signed in:
What we store
- API requests: billing metadata only (model, token counts, cost, status, latency, request id, IP address and the error message if one occurred). Prompts and responses are not stored.
- AI Chat: conversations and files you upload are saved to your account so you can come back to them. You can delete them at any time.
- Requests are processed by the upstream model provider under its own terms. See the Privacy Policy.