Skip to content

Console API reference

The console API is what the web console calls. It uses a browser session (the gw_session cookie) and a CSRF header on writes, not an API key, and it lives on the console host, not on the relay host. Most integrations do not need it: use the relay API to make requests and /v1/generation to read what they cost.

The pages are generated from server/api/openapi.yaml, the contract the server and the console web app are both built from, so they match the running API. Operations marked admin-* are for platform operators and need an administrator session.

Pages by area are in the sidebar: auth, org, apikey, usage, billing, affiliate, catalog, webhook, and the admin groups.

Conventions that apply to every operation (money as decimal strings in nano-USD, session levels, CSRF, error envelope) are in the introduction of the specification:

  • Amounts are integers of nano-USD (1 USD = 1,000,000,000) written as decimal strings, in fields ending _nano. Token prices are nano-USD per million tokens (_per_million). Rates are parts per million (_ppm).
  • Authentication levels per operation: session, orgSession (acting on the session’s active organisation), adminSession.
  • Writes need the CSRF value the console sets, and Content-Type: application/json.