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.
API REFERENCE
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.
Drop in where you already call OpenAI, then reach for native endpoints when you need the evidence behind a request.
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.
Purpose-built endpoints for the control layer: request status, rate-card-versioned receipts, metered usage, and routing evaluation without execution.
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
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.
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"
}
}'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.
| Method | Path | Summary |
|---|---|---|
| POST | /v1/chat/completions | Create a chat completion through the governed routing layer. |
| POST | /v1/responses | Create a response for supported text workflows, with Ruzzler metadata. |
| GET | /v1/models | List the model routes currently available to your project. |
Native endpoints expose the control layer directly: verification status, usage, receipts, and routing evidence for every governed request.
| Method | Path | Summary |
|---|---|---|
| GET | /v1/requests/{request_id} | Fetch completion and reported verification status for a request. |
| GET | /v1/requests/{request_id}/receipt | Retrieve the rate-card-versioned receipt for a settled request. |
| GET | /v1/usage | Read metered usage and Credit charges for the current period. |
| POST | /v1/routing/evaluate | Preview the route and estimated cost a request would take, without executing it. |
Receipts & evidence
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 are stable, typed, and scoped to the connected beta. Handle these explicitly — especially 402, 409, 429, and transient 5xx.
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 401 | invalid_api_key | The key is missing, revoked, or scoped to another project. | Re-issue a project-scoped key and send it as a Bearer token. |
| 402 | budget_exceeded | The request would exceed the cumulative budget check for the project. | Raise the project budget cap or wait for the next settlement window. |
| 404 | request_not_found | No governed request exists with that ID in your tenant scope. | Confirm the request ID and the environment it was created in. |
| 409 | idempotency_conflict | The idempotency key was replayed with a different payload. | Reuse the original payload or generate a new idempotency key. |
| 422 | unsupported_workflow | The workflow is outside the supported scope of the connected beta. | Check the supported text-workflow list before sending. |
| 429 | rate_limited | The project rate check rejected the burst. | Back off with jitter and retry; the rate limit is per project. |
| 503 | route_unavailable | No verified route is currently available for the requested model. | Retry with model "auto" so the router can select an available route. |
The quickstart takes you from a scoped key to a stored receipt in five steps.