Qubittron Bastion

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

  1. Sign up at qubittron.ai and verify your phone number.
  2. Open the dashboard → API keysCreate key.
  3. 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_here

The 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/v1

The 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 Authorization header for security. Always start with https://.

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" | "..."
  }
}
StatusCodeWhen
400invalid_requestBody failed validation
400model_not_foundModel unknown or doesn't support this endpoint
401invalid_api_keyMissing/invalid Bearer token
402insufficient_fundsAccount credit exhausted
413request_entity_too_largeMultipart upload exceeds 25 MB (transcriptions)
429rate_limit_exceededPer-key or per-tier limit
502upstream_errorUpstream model unreachable or returned 5xx
503service_unavailableInternal 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.

Next

On this page