GRGlobalRouter Docs
Console

Credits and usage / GET

Get generation metadata

query generation metadata。

endpoint list

Mobile view shows the endpoint list. Use desktop view for parameters and examples.

MethodEndpointDescription
GET/api/v1/creditsQuery credits and usage for the current tenant.
GET/api/v1/generationquery generation metadata。
GET/api/v1/generation/contentRead content associated with a generation.
GET/api/v1/generation

Inspect the upstream provider, usage.cost, cost_details, and generation content. A null cost can be used for later reconciliation.

Back to Credits and usage endpoint list

Request parameters

FieldTypeRequiredDescription
query.idstringYesquery parameters。

Response fields

FieldTypeRequiredDescription
dataobjectNoSee the OpenAPI schema for field details.
data.idstringNoSee the OpenAPI schema for field details.
data.modelstringNoSee the OpenAPI schema for field details.
data.provider_namestringNoSee the OpenAPI schema for field details.
data.usageUsageNousage.cost is the upstream cost fact when present, including 0. GR billing may apply local discounts when writing final cost.

Errors

401UNAUTHORIZED

Missing or invalid Authorization Bearer token.

403FORBIDDEN

The current API key is not authorized for this scope, model, or management capability.

422VALIDATION_ERROR

The request body, path parameters, or query parameters do not match the endpoint schema.

Notes

  • Use a GlobalRouter API key; upstream OpenRouter API keys are never exposed to tenants.
  • If OpenRouter explicitly returns usage.cost as 0, treat it as 0; do not fall back to a local price estimate.
  • upstream_inference_prompt_cost and upstream_inference_completions_cost in cost_details usually provide a breakdown; usage.cost is the authoritative total.