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 have x-cost-paise.

Endpoints

EndpointAuthWhat it does
GET /modelsnoneEvery model with its params and rupee price. Filters: ?kind=&maker=&q=
GET /models/{id}noneOne model
POST /quotekey{ model, params, input? } → Quote, valid 15 minutes
POST /generationskey{ quote_id, input } or { model, params, input } → 202 Generation
GET /generationskeyYour generations, newest first, cursor-paged
GET /generations/{id}keyStatus, outputs and cost
POST /generations/{id}/cancelkeyCancel a queued render; 409 once running
POST /chat/completionskeyOpenAI-shaped; usage adds cost_paise
GET /walletkey{ balance_paise, held_paise, topup_url }
GET /wallet/ledgersessionTop-ups, holds, settles and releases
GET /keys · POST /keys · DELETE /keys/{id}sessionWorkspace API keys
GET /activitysessionDaily requests and spend by kind
GET /logssessionEvery call with status, latency and charge
GET /workspaces · POST /workspacessessionWorkspaces under your account
GET · PATCH /workspaces/{id}sessionName, spend limit, ZDR, guardrails
/workspaces/{id}/memberssessionList, add and remove members
/presets · /fileskeySaved settings (model@preset) and reference files
/management-keys · /account · /invoicessessionAccount 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.