Getting started
Sign up, create an API key, and make your first request in under a minute.
1. Create an account and an API key
- Sign up at qubittron.ai and verify your phone number.
- Open the dashboard → API keys → Create key.
- Copy the key — it starts with
qbt_and is shown only once.
Treat the key like a password. Set it as QUBITTRON_API_KEY in your environment, never in client-side code:
export QUBITTRON_API_KEY=qbt_your_key_hereThe cURL examples in this doc reference $QUBITTRON_API_KEY — they assume this export is in scope.
2. Set the base URL
https://api.qubittron.ai/v1The TTS endpoint sits one level higher (/api/v1/tts/text_to_audio) — see the TTS page.
HTTPS only. Plain HTTP requests are redirected to HTTPS, and the redirect strips the
Authorizationheader for security. Always start withhttps://.
3. Authenticate
Every request needs a Bearer token:
Authorization: Bearer qbt_<your_key>A request with a missing or invalid key returns:
{
"error": {
"message": "Invalid API key",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}4. Make your first request
curl https://api.qubittron.ai/v1/models \
-H "Authorization: Bearer $QUBITTRON_API_KEY"import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.qubittron.ai/v1",
apiKey: process.env.QUBITTRON_API_KEY,
});
const models = await client.models.list();
console.log(models.data.map((m) => m.id));const res = await fetch("https://api.qubittron.ai/v1/models", {
headers: { Authorization: `Bearer ${process.env.QUBITTRON_API_KEY}` },
});
const json = await res.json();
console.log(json.data.map((m: { id: string }) => m.id));Error format
All errors share an OpenAI-compatible shape:
{
"error": {
"message": "Human-readable description",
"type": "invalid_request_error" | "api_error" | "insufficient_quota" | "rate_limit_error",
"code": "invalid_request" | "invalid_api_key" | "model_not_found" | "rate_limit_exceeded" | "upstream_error" | "insufficient_funds" | "service_unavailable" | "..."
}
}| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Body failed validation |
| 400 | model_not_found | Model unknown or doesn't support this endpoint |
| 401 | invalid_api_key | Missing/invalid Bearer token |
| 402 | insufficient_funds | Account credit exhausted |
| 413 | request_entity_too_large | Multipart upload exceeds 25 MB (transcriptions) |
| 429 | rate_limit_exceeded | Per-key or per-tier limit |
| 502 | upstream_error | Upstream model unreachable or returned 5xx |
| 503 | service_unavailable | Internal limiter or balance check unavailable — retry |
Rate limits
Limits are per API key, evaluated per minute. Defaults vary by tier — view your current limits in the dashboard. A 429 response includes a Retry-After header in seconds; back off and retry.
Idempotency and retries
The API does not require idempotency keys. Treat 5xx responses (especially 502) and network errors as transient and retry with exponential backoff (e.g. 1s, 2s, 4s, max 3 attempts). Do not auto-retry on 4xx — those indicate a client problem.
For long-running streams, retry the full request rather than resuming mid-stream.