Request accounting
Look up a request before deciding whether to retry it.
GET /v1/requests/{id}
Use an inference key and a request UUID. Access is restricted to the same logical key that owns the request. A rotated secret can still read that history. A missing, malformed or inaccessible ID returns 404 request_not_found.
curl --fail-with-body "https://api.urouter.net/v1/requests/$REQUEST_ID" \
-H "Authorization: Bearer $UROUTER_API_KEY"Response fields
The endpoint returns one object, not a data wrapper. Accounting does not contain generated text or media artifacts.
| Field | Type | Meaning |
|---|---|---|
id | UUID | Persistent request identity. |
model, operation | string | Requested public model and operation. |
state | string | Accounting state below. |
maximum_usd | decimal string | Reserved ceiling, not necessarily the final charge. |
cost_usd | decimal string or null | Confirmed cost; null is unresolved, not free. |
input_tokens, output_tokens | integer string or null | Recorded usage; null means not reported. |
created_at, settled_at | ISO 8601; settled_at nullable | Creation and settlement timestamps. |
Accounting states
These states describe money handling, not whether the generated answer was useful or an external task completed.
| State | Meaning | Client action |
|---|---|---|
reserved | Funds held; dispatch not yet claimed. | Wait for a resolved state. |
dispatching | Execution attempt claimed. | Do not submit a duplicate. |
pending_cost | Outcome or final charge needs reconciliation. | Keep the request ID and check again. |
settled | Charge confirmed; unused hold released. | Read cost_usd. |
released | Reservation released without a charge. | Inspect the original error before retrying. |
Error references are different
error.request_id is an error reference and is not automatically an accounting request UUID. Do not assume every error reference will resolve here. Failed authentication or an account-access rejection does not create a paid request.