Docs
API Reference

Generations

Inspect metadata about inference requests made with the current API key.

Metadata for one inference request

Generations provide metadata about inference requests made with the current API key. One inbound inference request is one Generation. A fallback can create multiple Provider Attempts beneath that same Generation; it does not create multiple Generations.

This is an observability API for metadata, not a model-content history API.

Exact API-key ownership

A Qufas API key can only access Generations created by that same API key. A different key on the same account cannot access them. Unknown Generations and Generations owned by another API key both return 404 generation_not_found.

GET /v1/generations

Returns newest-first Generation summaries. Only the four parameters below are supported.

ParameterTypeDefaultMeaning
limitInteger20Rows to return. Minimum 1, maximum 100.
cursorStringOpaque next_cursor from the preceding page.
statusStringin_progress, completed, failed, or cancelled.
modelStringExact public model ID.
1curl 'https://qufas-ai.vercel.app/v1/generations?limit=20&status=completed&model=kimi-k2.7-code' \2  -H "Authorization: Bearer $QUFAS_API_KEY"

Explicit cursor pagination

The default limit is 20 and the maximum is 100. When has_more is true, pass the opaque next_cursor unchanged with the same filters. SDKs do not automatically fetch every page.

Next page
1curl 'https://qufas-ai.vercel.app/v1/generations?limit=20&cursor=opaque-next-cursor' \2  -H "Authorization: Bearer $QUFAS_API_KEY"

GET /v1/generations/{request_id}

The Generation ID is the canonical req_* ID of the original inference request. Capture it from an inference response and retrieve its Generation.

1curl 'https://qufas-ai.vercel.app/v1/generations/req_original' -i \2  -H "Authorization: Bearer $QUFAS_API_KEY"

For GET /v1/generations/req_original, body id remains req_original, while the response header x-qufas-request-id is a new req_lookupidentifying this lookup. Read that header directly from the HTTP response when you need to correlate the lookup itself.

200 JSON
1{2  "id": "req_original",3  "object": "generation",4  "created_at": "2026-08-10T00:00:00.000Z",5  "status": "completed",6  "workload": "chat",7  "model": "kimi-k2.7-code",8  "provider": "aliyun",9  "latency_ms": 420,10  "usage": {11    "input_tokens": 10,12    "output_tokens": 5,13    "total_tokens": 15,14    "units": "15",15    "unit": "tokens"16  },17  "cost": {18    "input": "0.000000010000",19    "output": "0.000000020000",20    "total": "0.000000030000",21    "currency": "USD"22  },23  "fallback": false,24  "completed_at": "2026-08-10T00:00:00.420Z",25  "streaming": false,26  "time_to_first_token_ms": null,27  "tokens_per_second": null,28  "routing": {29    "selected_provider": "aliyun",30    "fallback": false,31    "attempt_count": 132  },33  "attempts": [34    {35      "index": 1,36      "provider": "aliyun",37      "status": "succeeded",38      "started_at": "2026-08-10T00:00:00.010Z",39      "completed_at": "2026-08-10T00:00:00.400Z",40      "latency_ms": 390,41      "upstream_status": 200,42      "error": null43    }44  ],45  "error": null46}

Overall status and Provider Attempts

Status is in_progress, completed, failed, or cancelled and reflects the overall Qufas request outcome. A Provider Attempt can succeed while finalization leaves the Generation failed. That failed Generation is still a successful HTTP 200 lookup whose error is outcome metadata, not an SDK exception.

Attempts show public provider, status, timing, upstream HTTP status, and a normalized provider error code. Raw provider requests, endpoints, and upstream request IDs are not returned.

Usage and stored historical cost

Generation cost is the stored historical amount billed for that request. Monetary fields are decimal strings such as "0.000500000000", not JSON numbers. Qufas does not recalculate them from current prices.

Image usage can have zero token fields with unit = images. Missing historical or failed-request usage is null, which does not mean zero.

Generations are per-request observability, not an account ledger. Do not sum Generations for accounting; use the Usage API and billing records for account-level totals.

Privacy, historical nulls, and retention

The Generation API does not return prompts, messages, generated response content, tool inputs or outputs, or raw provider requests and responses. Availability of Generation metadata does not mean Qufas stores or exposes model content through this API.

Older records may have null cost, TTFT, throughput, or routing metadata and an empty attempts array. Generation records are available while retained by Qufas; a fixed public retention period is not currently guaranteed.

Was this page helpful?