Reference
API reference
Base URL https://userouter.in/api/v1. JSON in, JSON out.
Auth
Send Authorization: Bearer rtr_live_.... A key belongs to one workspace. Endpoints marked session are for the console and need a signed-in session; management keys can call them from scripts.
Conventions
- Amounts are integer paise, ex-GST, in fields ending
_paise. GST is shown separately. - Rates are decimal INR strings such as
"4.53". - Lists are cursor-paged:
?cursor=&limit=returns{ data, next_cursor }. - Every response has
x-request-id; billed ones havex-cost-paise.
Endpoints
| Endpoint | Auth | What it does |
|---|---|---|
GET /models | none | Every model with its params and rupee price. Filters: ?kind=&maker=&q= |
GET /models/{id} | none | One model |
POST /quote | key | { model, params, input? } → Quote, valid 15 minutes |
POST /generations | key | { quote_id, input } or { model, params, input } → 202 Generation |
GET /generations | key | Your generations, newest first, cursor-paged |
GET /generations/{id} | key | Status, outputs and cost |
POST /generations/{id}/cancel | key | Cancel a queued render; 409 once running |
POST /chat/completions | key | OpenAI-shaped; usage adds cost_paise |
GET /wallet | key | { balance_paise, held_paise, topup_url } |
GET /wallet/ledger | session | Top-ups, holds, settles and releases |
GET /keys · POST /keys · DELETE /keys/{id} | session | Workspace API keys |
GET /activity | session | Daily requests and spend by kind |
GET /logs | session | Every call with status, latency and charge |
GET /workspaces · POST /workspaces | session | Workspaces under your account |
GET · PATCH /workspaces/{id} | session | Name, spend limit, ZDR, guardrails |
/workspaces/{id}/members | session | List, add and remove members |
/presets · /files | key | Saved settings (model@preset) and reference files |
/management-keys · /account · /invoices | session | Account settings, management keys and GST invoices |
Model
{
"id": "kling/kling-v2.1",
"name": "Kling 2.1",
"maker": "Kuaishou",
"kind": "video", // text | image | video | voice | music
"unit": "clip", // second, image, clip, 1k_chars, minute, song, 1m_tokens
"zdr_eligible": false,
"price": { "unit_inr": "38.40" }, // text: { input_per_1m_inr, output_per_1m_inr, cached_per_1m_inr? }
"params": { "duration_s": { "type": "integer", "enum": [5, 10] } }
}Generation
{
"id": "gen_...",
"kind": "video",
"model": { "id": "kling/kling-v2.1", "name": "Kling 2.1" },
"spec": ["5 s", "1080p"],
"status": "succeeded", // queued | running | succeeded | failed | cancelled
"amount_paise": 3840,
"charged": true, // only once settled; failed and cancelled are never charged
"outputs": [{ "url": "https://...", "mime": "video/mp4", "duration_s": 5 }],
"created_at": "...", "started_at": "...", "completed_at": "..."
}See Errors for every error code.