> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tinfoil.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# List requests

> Lists individual inference requests, newest first, 100 per page.



## OpenAPI

````yaml https://api.tinfoil.sh/openapi.yaml get /api/billing/requests
openapi: 3.2.0
info:
  title: Tinfoil Controlplane API
  version: 0.1.0
  description: >-
    Manage inference API keys, read usage and invoices, and manage Tinfoil
    confidential containers, their configuration, and the organization resources
    they use. Authenticate with an admin API key sent as a bearer token.
servers:
  - url: https://api.tinfoil.sh
security:
  - apiKey: []
tags:
  - name: Account
    description: >-
      The identity and organization behind the API key, and the token usage and
      invoices of the personal account or organization.
  - name: API keys
    parent: Account
    description: Inference API keys of the personal account or organization.
  - name: Containers
    description: Create, deploy, and stop confidential containers.
  - name: Container updates
    description: >-
      Move a container to a new release, and promote or cancel an update that is
      held for review.
  - name: Projects
    description: Groups of containers deployed from the same config source.
  - name: Volumes
    description: Encrypted persistent volumes that attach to containers.
  - name: Secrets
    description: >-
      Organization secrets available to containers, and secrets scoped to a
      single GitHub repository.
  - name: Access
    description: >-
      SSH public keys for attested SSH access to containers, custom domains that
      route to containers, and credentials for pulling images from private
      registries. An organization can store one ecr and one custom registry
      connection, each identified by its hostname.
  - name: GitHub & models
    description: >-
      Repository config and image builds through the Tinfoil GitHub app, and
      packaging Hugging Face models for use in containers. Packaging models
      requires a GPU entitlement or model access for the organization.
  - name: Config registry
    description: >-
      Publish tinfoil-config.yml revisions, read published configs, and resolve
      the endorsements that let clients verify them.
  - name: Bunkers
    description: Bunker owner keys and owner attestation.
paths:
  /api/billing/requests:
    get:
      tags:
        - Account
      summary: List requests
      description: Lists individual inference requests, newest first, 100 per page.
      operationId: listUsageRequests
      parameters:
        - name: start
          in: query
          required: true
          description: Start of the range.
          schema:
            type: string
            format: date-time
        - name: end
          in: query
          required: true
          description: >-
            End of the range. A future value is clamped to now, and the range
            cannot exceed two years.
          schema:
            type: string
            format: date-time
        - name: model
          in: query
          required: false
          description: Only list requests to this model ID.
          schema:
            type: string
        - $ref: '#/components/parameters/UsageKeyID'
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
      responses:
        '200':
          description: A page of requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRequestPage'
        '400':
          $ref: '#/components/responses/Error'
          description: Invalid request
        '401':
          $ref: '#/components/responses/Error'
          description: Missing or invalid credentials
        '403':
          $ref: '#/components/responses/Error'
          description: Not permitted
        '500':
          $ref: '#/components/responses/Error'
          description: Server error
      security:
        - apiKey:
            - billing.requests
components:
  parameters:
    UsageKeyID:
      name: key_id
      in: query
      required: false
      description: Only count usage of the inference key with this public_id.
      schema:
        type: string
        pattern: ^[0-9a-f]{64}$
  schemas:
    UsageRequestPage:
      type: object
      required:
        - requests
      properties:
        requests:
          type: array
          items:
            type: object
            required:
              - id
              - time
              - api_key
              - api_key_name
              - model
              - input_tokens
              - cached_input_tokens
              - output_tokens
            properties:
              id:
                type: string
                format: uuid
                description: >-
                  Identifier of the usage record. Inference responses do not
                  return it.
              time:
                type: string
                format: date-time
              api_key:
                type: string
                description: The key that made the request, masked.
              api_key_name:
                type: string
              model:
                type: string
              input_tokens:
                type: integer
                description: Prompt tokens, including those served from the prompt cache.
              cached_input_tokens:
                type: integer
                description: The part of input_tokens served from the prompt cache.
              output_tokens:
                type: integer
                description: Generated tokens, including reasoning tokens.
        next_cursor:
          type: string
          description: Cursor for the next page. Omitted on the last page.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Stable machine-readable error code.
      additionalProperties: true
  responses:
    Error:
      description: The request failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An admin API key. Personal admin keys reach the API key, billing and
        Account endpoints for the creator's personal account; the other
        endpoints need an organization admin key. Security requirement entries
        list the permission a scoped key needs for the operation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.