API REFERENCE

One API for verified AI routing.

The Ruzzler API is OpenAI-compatible at the surface and native where the control layer shows through: routing evidence, reported verification status, usage, and receipts on every governed request.

Two surfaces, one control layer.

Drop in where you already call OpenAI, then reach for native endpoints when you need the evidence behind a request.

OpenAI-compatible

Keep your existing client and request shapes. Change the base URL to https://api.ruzzler.com/v1 and every call gains tenant scope, rate and cumulative-budget checks, and reported verification status.

Native Ruzzler extensions

Purpose-built endpoints for the control layer: request status, rate-card-versioned receipts, metered usage, and routing evaluation without execution.

Evidence on every request

Each governed request returns completion status, reported verification checks, Credit charge, and a receipt ID. Verification is reported pipeline status, not a universal correctness guarantee.

Authentication

Scoped keys, server-managed credentials.

Every call carries a project-scoped Ruzzler API key as a Bearer token. Keys are bound to an organization, project, and environment; the secret is shown once at creation. Upstream provider credentials stay server-managed — your key never talks to a provider directly.

  • Scope keys to one project and environment
  • Send a stable idempotency key per business action
  • Set maximum Credit cost before execution
  • Rotate keys from the dashboard without downtime
curl https://api.ruzzler.com/v1/chat/completions \
  -H "Authorization: Bearer $RUZZLER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Summarize this contract clause."}],
    "metadata": {
      "project_id": "prj_123",
      "environment": "development",
      "idempotency_key": "8f3a2c1e-4b7d-4e9a-9c2f-1a5b6d7e8f90"
    }
  }'

OpenAI-compatible surface

Point an existing OpenAI client at the Ruzzler base URL and keep your request shapes. Ruzzler adds tenant scope, budget checks, and reported verification to the same call.

MethodPathSummary
POST/v1/chat/completionsCreate a chat completion through the governed routing layer.
POST/v1/responsesCreate a response for supported text workflows, with Ruzzler metadata.
GET/v1/modelsList the model routes currently available to your project.

Native Ruzzler extensions

Native endpoints expose the control layer directly: verification status, usage, receipts, and routing evidence for every governed request.

MethodPathSummary
GET/v1/requests/{request_id}Fetch completion and reported verification status for a request.
GET/v1/requests/{request_id}/receiptRetrieve the rate-card-versioned receipt for a settled request.
GET/v1/usageRead metered usage and Credit charges for the current period.
POST/v1/routing/evaluatePreview the route and estimated cost a request would take, without executing it.

Receipts & evidence

Read the evidence behind any request.

Native endpoints return what the routing layer actually did: completion status, reported verification checks, the Credits charged, the rate-card version applied, and a receipt you can store in your own billing records.

// Read the evidence behind any governed request.
const request = await fetch(
  "https://api.ruzzler.com/v1/requests/req_8f3a2c1e/receipt",
  { headers: { Authorization: `Bearer ${process.env.RUZZLER_API_KEY}` } }
).then((res) => res.json());

// {
//   "request_id": "req_8f3a2c1e",
//   "status": "completed",
//   "verification": { "state": "verified", "checks": ["route", "schema", "budget"] },
//   "credits_charged": 214,
//   "rate_card_version": "rc_2025-11",
//   "receipt_id": "rcpt_4d7e9a2b"
// }

Errors you can act on.

Errors are stable, typed, and scoped to the connected beta. Handle these explicitly — especially 402, 409, 429, and transient 5xx.

StatusCodeMeaningWhat to do
401invalid_api_keyThe key is missing, revoked, or scoped to another project.Re-issue a project-scoped key and send it as a Bearer token.
402budget_exceededThe request would exceed the cumulative budget check for the project.Raise the project budget cap or wait for the next settlement window.
404request_not_foundNo governed request exists with that ID in your tenant scope.Confirm the request ID and the environment it was created in.
409idempotency_conflictThe idempotency key was replayed with a different payload.Reuse the original payload or generate a new idempotency key.
422unsupported_workflowThe workflow is outside the supported scope of the connected beta.Check the supported text-workflow list before sending.
429rate_limitedThe project rate check rejected the burst.Back off with jitter and retry; the rate limit is per project.
503route_unavailableNo verified route is currently available for the requested model.Retry with model "auto" so the router can select an available route.

Send your first governed request.

The quickstart takes you from a scoped key to a stored receipt in five steps.