Skip to content
Get API key
On this page

Look up a request

GET /v1/generation returns the metadata of one past request. It never returns prompts or responses.

GET /v1/generation?id=<request id> (API reference) returns the metadata of one request made with your workspace’s keys. Use it to check what a request cost or how long it took, or to give support the facts about one request.

The id is the value of the x-request-id header on the original response.

curl "https://api.router.africa/v1/generation?id=$REQUEST_ID" \
-H "Authorization: Bearer $ROUTER_AFRICA_API_KEY"

What you get

The response has one data object. This page lists every field; the reference page has the full schema.

Field Meaning
id The request id.
created_at When the request was made, as a date-time.
endpoint The path that was called, for example /v1/chat/completions.
model The model the request used.
status_code The HTTP status the request returned.
error_code The error reason, or null when the request succeeded.
latency_ms How long the request took, in milliseconds.
streamed Whether the request was streamed.
input_tokens Tokens in the prompt.
output_tokens Tokens in the response.
cost The charge, in credits, as a string with eight decimal places.
{
  "data": {
    "id": "0192f0e0-7a1c-7d3e-9f10-2b6c8a4d5e11",
    "created_at": "2026-11-07T09:30:00Z",
    "endpoint": "/v1/chat/completions",
    "model": "openai/gpt-4.1-mini",
    "status_code": 200,
    "error_code": null,
    "latency_ms": 840,
    "streamed": false,
    "input_tokens": 12,
    "output_tokens": 3,
    "cost": "0.00000240"
  }
}

What you don’t get

Rules