Page platform Provider accrued and paid obligations
Generated from the checked-in source. Do not edit this reference by hand.
GET /api/v1/providers/{provider}/earnings
Platform administration required; Provider membership and company ownership do not grant access. Full retained earning history, creation time descending then attempt ID ascending, using the existing ledger index. Exact amount strings; no customer identity, workspace, credential or customer selling price. The id is an internal selection value for the existing settlement POST, never a display label. A page is one database snapshot; settlement status may change between requests and settlement writes revalidate unpaid selections. Reads do not create earnings or payments. Missing or out-of-filter cursors return 409. Cache-Control no-store.
Operation: listProviderEarnings.
Authentication
Section titled “Authentication”Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.
[ { "bearerAuth": [] }]HTTP request
Section titled “HTTP request”Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.
curl --fail-with-body -X GET "$NIU_ORIGIN/api/v1/providers/{provider}/earnings" \ -H "Authorization: Bearer $NIU_BEARER_TOKEN"Parameters
Section titled “Parameters”provider
Section titled “provider”Location: path. Required.
{ "type": "string", "format": "uuid"}before
Section titled “before”Location: query. Optional. Prior next_cursor; omit for the first page.
{ "type": "string", "format": "uuid"}currency
Section titled “currency”Location: query. Optional. Filter one currency without conversion.
{ "type": "string", "pattern": "^[A-Z]{3}$"}from_ms
Section titled “from_ms”Location: query. Optional. Inclusive payment-record creation time. Unix milliseconds.
{ "type": "integer", "format": "int64", "minimum": 0, "maximum": 253402300799999}Location: query. Optional. Exclusive payment-record creation time; must follow from. Unix milliseconds.
{ "type": "integer", "format": "int64", "minimum": 0, "maximum": 253402300799999}Location: query. Optional. Maximum page size.
{ "type": "integer", "minimum": 1, "maximum": 100, "default": 50}Request body
Section titled “Request body”No request body is declared.
Responses
Section titled “Responses”HTTP 200
Section titled “HTTP 200”Provider earning page; next_cursor null ends traversal.
Content type: application/json.
{ "type": "object", "required": [ "data", "next_cursor" ], "additionalProperties": false, "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "id", "model_alias", "currency", "amount_nanos", "billing_meter", "created_at", "status", "revision", "offer_id", "context_minimum_input_tokens", "prompt_tokens", "completion_tokens", "cached_prompt_tokens", "cache_write_prompt_tokens", "reasoning_completion_tokens" ], "additionalProperties": false, "properties": { "id": { "type": "string", "format": "uuid" }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }, "amount_nanos": { "type": "string", "pattern": "^[0-9]+$" }, "created_at": { "type": "string", "format": "date-time" }, "model_alias": { "type": "string" }, "billing_meter": { "type": "string" }, "status": { "type": "string", "enum": [ "accrued", "paid" ] }, "revision": { "type": "string", "format": "uuid" }, "offer_id": { "type": "string", "format": "uuid" }, "context_minimum_input_tokens": { "type": [ "string", "null" ], "pattern": "^[0-9]+$" }, "prompt_tokens": { "type": [ "string", "null" ], "pattern": "^[0-9]+$" }, "completion_tokens": { "type": [ "string", "null" ], "pattern": "^[0-9]+$" }, "cached_prompt_tokens": { "type": [ "string", "null" ], "pattern": "^[0-9]+$" }, "cache_write_prompt_tokens": { "type": [ "string", "null" ], "pattern": "^[0-9]+$" }, "reasoning_completion_tokens": { "type": [ "string", "null" ], "pattern": "^[0-9]+$" } } } }, "next_cursor": { "type": [ "string", "null" ], "format": "uuid" } }}HTTP 400
Section titled “HTTP 400”Invalid filters, range or page size.
HTTP 401
Section titled “HTTP 401”Invalid credential.
HTTP 403
Section titled “HTTP 403”Platform administration required, including for Provider members.
HTTP 404
Section titled “HTTP 404”Provider does not exist or is deleted.
HTTP 409
Section titled “HTTP 409”Cursor not in this Provider and filter scope.
HTTP 503
Section titled “HTTP 503”Storage unavailable.
Behavior and supported scope
Section titled “Behavior and supported scope”Platform administration required; Provider membership and company ownership do not grant access. Full retained earning history, creation time descending then attempt ID ascending, using the existing ledger index. Exact amount strings; no customer identity, workspace, credential or customer selling price. The id is an internal selection value for the existing settlement POST, never a display label. A page is one database snapshot; settlement status may change between requests and settlement writes revalidate unpaid selections. Reads do not create earnings or payments. Missing or out-of-filter cursors return 409. Cache-Control no-store.
Supported scope: implemented