Skip to main content
The Impossibl AI API keeps one request log row for every gateway request, success or failure, unlike the usage ledger which only records billed successes. Rows are narrow and hot; the heavy request/response bodies live in a separate payload fetched only on the detail view. Three endpoints read this data:
  • GET /v1/requests — recent rows, newest first, with filters
  • GET /v1/requests/{id} — one row plus its captured, redacted payload
  • GET /v1/usage/stream — a live SSE feed of rows as they settle
Authenticate with your gateway API key (Authorization: Bearer imp-rt-..., or the x-api-key header). The dashboard calls the same endpoints with a WorkOS session token. See Authentication for how keys are minted.

List requests

Returns request log rows for your account, ts descending.
Response (row abbreviated)
A failed request logs the same row shape with the token and cost fields null, an errorMessage, and an attempts failover trail. Costs are in credits, where 1 credit = $0.000001.

Filters

Errors only, one model

Paging with before_id

Page backward with a keyset cursor: pass the id of the oldest row you already hold as before_id to get the rows strictly older than it. The cursor keys off the row’s id, not its timestamp, so rows that share a millisecond are never skipped and the boundary row does not come back:
since and before_id compose. Keep a since filter on every page to bound how far back paging runs: the window is at/after since and strictly older than the oldest row you hold.

One request with its payload

Fetch a single row plus the captured request and response bodies. An id that does not exist, or belongs to another account, returns 404 (never leaks across accounts).
Response
The payload is null if no bodies were captured for that request. What the gateway captures is scrubbed before it is stored:
  • Sensitive headers are redacted. authorization, x-api-key, x-goog-api-key, cookie, and set-cookie are stored as [redacted].
  • Inline media is stripped. data: URIs and large base64 blobs (images, files) are replaced with a [media omitted (N chars)] placeholder.
  • Oversized bodies are truncated. Bodies are capped near 256 KB; when a body is shrunk to fit, truncated is true. The stored JSON is always valid.

Live stream

GET /v1/usage/stream is a long-lived text/event-stream. On connect it sends one snapshot event, then one request event per settled or failed request. Pass -N to curl so it prints frames as they arrive.
Every frame is JSON with v: 1. Payloads are never streamed, only log rows.
Stream (abridged)
  • snapshot — the last 20 rows, the current balanceCredits, the server-authoritative month-to-date totals (tokens, spentCredits, requests, ok-only), and cutoff, the read time the totals were computed at. Gate any streamed rows against cutoff so live ticks never re-add rows the snapshot already counted.
  • request (live) — a newly settled or failed row plus balanceCredits, the account balance after that request.
  • request (buffered replay) — a request that settled between subscribe and the snapshot read is replayed once right after the snapshot without balanceCredits (its balance could be staler than the snapshot’s). The snapshot balance stands until the next live frame ticks it forward.
  • : hb — a comment heartbeat about every 25s that keeps the connection under the load balancer’s idle timeout. It carries no data.
All amounts (balanceCredits, spentCredits, a row’s costCredits) are in credits, where 1 credit = $0.000001.