{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatapi/json-schema/beatapi-usage-record-list-response-schema.json",
  "title": "UsageRecordListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatapi-usage-api-openapi.yml#/components/schemas/UsageRecordListResponse",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "object",
        "data",
        "has_more"
      ],
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "list"
          ]
        },
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UsageRecord"
          }
        },
        "has_more": {
          "type": "boolean"
        },
        "next_cursor": {
          "type": "string",
          "description": "Pass as `cursor` to read the next page; absent on the last page."
        }
      }
    }
  },
  "$defs": {
    "UsageRecord": {
      "type": "object",
      "required": [
        "object",
        "id",
        "type",
        "model",
        "api_key",
        "status",
        "created_at",
        "currency",
        "credits_charged",
        "credits_refunded",
        "usage"
      ],
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "usage_record"
          ]
        },
        "id": {
          "type": "string",
          "description": "The task ID for a task, otherwise the request ID."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "image",
            "video",
            "workflow",
            "data",
            "realtime",
            "other"
          ]
        },
        "model": {
          "type": "string",
          "description": "Public model ID."
        },
        "task_id": {
          "type": "string",
          "description": "Present for tasks."
        },
        "request_id": {
          "type": "string",
          "description": "Request ID of the call that created the record, when known."
        },
        "api_key": {
          "type": [
            "object",
            "null"
          ],
          "description": "The API key that paid; `null` for Dashboard playground use.",
          "required": [
            "id",
            "title"
          ],
          "properties": {
            "id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "key_prefix": {
              "type": "string",
              "description": "The first four characters of the key."
            }
          }
        },
        "status": {
          "type": "string",
          "enum": [
            "queued",
            "processing",
            "succeeded",
            "failed",
            "refunded"
          ],
          "description": "`refunded` means the whole charge came back."
        },
        "created_at": {
          "type": "integer",
          "description": "Unix seconds."
        },
        "currency": {
          "type": "string",
          "enum": [
            "USD"
          ]
        },
        "credits_charged": {
          "type": "number",
          "format": "double",
          "description": "What the account paid in USD, after discounts and any settlement; up to six decimal places."
        },
        "credits_refunded": {
          "type": "number",
          "format": "double",
          "description": "USD returned to the balance."
        },
        "usage": {
          "type": "object",
          "description": "Billable quantities; each member appears only for the record types it describes.",
          "properties": {
            "input_tokens": {
              "type": "integer"
            },
            "output_tokens": {
              "type": "integer"
            },
            "cached_tokens": {
              "type": "integer"
            },
            "cache_write_tokens": {
              "type": "integer"
            },
            "images": {
              "type": "integer"
            },
            "seconds": {
              "type": "integer"
            },
            "resolution": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}