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.

Response fields
FieldTypeMeaning
idUUIDPersistent request identity.
model, operationstringRequested public model and operation.
statestringAccounting state below.
maximum_usddecimal stringReserved ceiling, not necessarily the final charge.
cost_usddecimal string or nullConfirmed cost; null is unresolved, not free.
input_tokens, output_tokensinteger string or nullRecorded usage; null means not reported.
created_at, settled_atISO 8601; settled_at nullableCreation and settlement timestamps.

Accounting states

These states describe money handling, not whether the generated answer was useful or an external task completed.

Accounting states
StateMeaningClient action
reservedFunds held; dispatch not yet claimed.Wait for a resolved state.
dispatchingExecution attempt claimed.Do not submit a duplicate.
pending_costOutcome or final charge needs reconciliation.Keep the request ID and check again.
settledCharge confirmed; unused hold released.Read cost_usd.
releasedReservation 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. A failed authentication or disabled chat request does not create a paid request.