Skip to content

Dynamic models

Model identifiers, vendor pricing, and availability change frequently. Do not hardcode static price tables in your application for Rikaii metered planning.

Instead, call the public catalog endpoint and cache the result with a short TTL.

Endpoint

http
GET /v1/models

Full URL: https://api.rikaii.com/v1/models

Authentication: Not required (GET /v1/models is public).

Response shape

The response body is a JSON array (root-level [ … ]). Each element describes one active catalog row:

JSON keyTypeDescription
modelSlugstringRikaii routing slug — use this in model, Dashboard rules, and logs.
providerstringUpstream vendor name (for example OPENAI, ANTHROPIC).
upstreamModelIdstringVendor’s native model identifier for that SKU.
inputPricePerMRetailnumberRetail USD per million input tokens, after the 4% platform markup applied to wholesale.
outputPricePerMRetailnumberRetail USD per million output tokens, after the same markup.
isByokOnlybooleanWhen true, the model cannot be served with Rikaii-managed platform keys. The client must configure BYOK with routing enabled for that provider; otherwise POST /v1/chat/completions returns 403 with error.code byok_required. When false, PAYG traffic may use platform keys subject to routing rules.

Numeric fields are decimal values (scaled to six fractional digits in responses).

Example response (truncated)

json
[
  {
    "modelSlug": "gpt-4o-mini",
    "provider": "OPENAI",
    "upstreamModelId": "gpt-4o-mini",
    "inputPricePerMRetail": 0.165000,
    "outputPricePerMRetail": 0.686400,
    "isByokOnly": false
  },
  {
    "modelSlug": "claude-opus-4",
    "provider": "ANTHROPIC",
    "upstreamModelId": "claude-opus-4-20250514",
    "inputPricePerMRetail": 18.000000,
    "outputPricePerMRetail": 90.000000,
    "isByokOnly": true
  }
]

How to use this in production

  1. Fetch GET https://api.rikaii.com/v1/models at startup and on a schedule (for example every 15–60 minutes).
  2. Index rows by modelSlug for validation and UX (dropdowns, internal tooling).
  3. Budget using inputPricePerMRetail and outputPricePerMRetail — these already include the 4% platform layer on wholesale.
  4. Context windows and tool support are defined by each vendor for upstreamModelId. The catalog endpoint intentionally focuses on identity and economics; consult provider documentation for context length, vision, and tool limits.

Rikaii API documentation