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

# GET /admin/api/credentials/usage



## OpenAPI

````yaml /generated/openapi.json get /admin/api/credentials/usage
openapi: 3.1.0
info:
  description: >-
    Forwarding, management, portal and OAuth APIs generated from Rust types.
    Input and output schemas preserve their respective Serde contracts.
    Streaming events and WebSocket messages are documented alongside HTTP
    payloads.
  title: GPROXY HTTP API
  version: 4.2.3
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /admin/api/credentials/usage:
    get:
      tags:
        - Management
      summary: GET /admin/api/credentials/usage
      parameters:
        - description: ''
          in: query
          name: credentialId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: ''
          in: query
          name: enabled
          required: false
          schema:
            type:
              - boolean
              - 'null'
        - description: Restrict price rules to the global scope.
          in: query
          name: globalOnly
          required: false
          schema:
            description: Restrict price rules to the global scope.
            type:
              - boolean
              - 'null'
        - description: ''
          in: query
          name: modelId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: Exact pricing pattern (not a runtime wildcard match).
          in: query
          name: modelPattern
          required: false
          schema:
            description: Exact pricing pattern (not a runtime wildcard match).
            type:
              - string
              - 'null'
        - description: ''
          in: query
          name: ownerId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: ''
          in: query
          name: ownerKind
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: 1-based. Zero and absent both mean the first page.
          in: query
          name: page
          required: false
          schema:
            description: 1-based. Zero and absent both mean the first page.
            format: uint64
            minimum: 0
            type:
              - integer
              - 'null'
        - description: Clamped to 1..=500; absent means 50.
          in: query
          name: pageSize
          required: false
          schema:
            description: Clamped to 1..=500; absent means 50.
            format: uint64
            minimum: 0
            type:
              - integer
              - 'null'
        - description: ''
          in: query
          name: priceRuleId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: ''
          in: query
          name: providerId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: ''
          in: query
          name: routeId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: ''
          in: query
          name: ruleSetId
          required: false
          schema:
            type:
              - string
              - 'null'
        - description: Case-insensitive substring of the family's natural name column.
          in: query
          name: search
          required: false
          schema:
            description: Case-insensitive substring of the family's natural name column.
            type:
              - string
              - 'null'
        - description: Administrative scope selected by the caller.
          in: header
          name: x-gproxy-admin-scope
          required: false
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Output_CredentialUsageDto'
                type: array
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_Envelope'
          description: Gateway error
      security:
        - consoleSession: []
        - bearer: []
        - anthropicKey: []
        - googleKey: []
components:
  schemas:
    Output_CredentialUsageDto:
      description: |-
        One credential with its open upstream cycles, for an overview of many
        credentials at once. Closed cycles and blocks stay on the per-credential
        [`CredentialQuotaDto`] read.
      properties:
        credential:
          $ref: '#/components/schemas/Output_CredentialDto'
        cycles:
          description: Open cycles only, by window.
          items:
            $ref: '#/components/schemas/Output_CredentialCycleDto'
          type: array
      required:
        - credential
        - cycles
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_CredentialDto:
      description: >-
        A credential without its secret. Only presence and expiry timestamps are

        exposed; reading the material itself requires
        `Credentials::reveal_secret`.
      properties:
        authKind:
          type: string
        connectionProfileId:
          type:
            - string
            - 'null'
        enabled:
          type: boolean
        expiresAtMs:
          format: int64
          type:
            - integer
            - 'null'
        hasSecret:
          type: boolean
        id:
          type: string
        label:
          type:
            - string
            - 'null'
        metadata: true
        organizationId:
          description: 'Opaque to this crate: the application layer decides what owns what.'
          type:
            - string
            - 'null'
        providerId:
          type: string
        proxy:
          default: null
        refreshExpiresAtMs:
          description: >-
            Read-only refresh-token expiry, projected from the sealed secret on
            management reads.

            None means no expiry was reported or the secret could not be read.
          format: int64
          type:
            - integer
            - 'null'
        status:
          description: '`active` or `dead`.'
          type: string
        statusReason:
          type:
            - string
            - 'null'
        teamId:
          type:
            - string
            - 'null'
        userId:
          type:
            - string
            - 'null'
        version:
          description: Bumped by every secret or lifecycle write; peers reload on a change.
          format: int64
          type: integer
      required:
        - id
        - providerId
        - organizationId
        - teamId
        - userId
        - label
        - authKind
        - hasSecret
        - version
        - connectionProfileId
        - proxy
        - metadata
        - expiresAtMs
        - refreshExpiresAtMs
        - status
        - statusReason
        - enabled
      type: object
    Output_CredentialCycleDto:
      description: |-
        One period of one upstream window on a credential, with the USD this
        deployment settled against it.
      properties:
        boundary:
          description: '`local` (derived here, a guess) or `observed` (reported upstream).'
          type: string
        closedAtMs:
          description: None while the cycle is open.
          format: int64
          type:
            - integer
            - 'null'
        costUsd:
          description: |-
            USD settled against the cycle through this deployment. Final once
            closed.
          type: string
        credentialId:
          type: string
        dimensionId:
          type:
            - string
            - 'null'
        endsAtMs:
          description: None for a window that never ends.
          format: int64
          type:
            - integer
            - 'null'
        estimatedAllowanceUsd:
          description: >-
            `sample.costUsd / sample.usedPercent * 100`: the USD the whole
            window

            would hold at the rate this cycle has been spending, when the sample

            reports a positive percent. It only sees traffic through this

            deployment, so use elsewhere on the same account reads it low.
          type:
            - string
            - 'null'
        id:
          type: string
        openedBy:
          description: '`first_use`, `rollover`, `server_reset` or `manual_reset`.'
          type: string
        sample:
          anyOf:
            - $ref: '#/components/schemas/Output_CycleSampleDto'
            - type: 'null'
          description: |-
            The latest upstream reading on the cycle; for a closed cycle, the
            last one before it closed.
        scope: true
        startsAtMs:
          format: int64
          type: integer
        windowId:
          description: |-
            The observed `QuotaEntry.id`, the declared dimension id before any
            observation, or `month` for a credential that declares no window.
          type: string
      required:
        - id
        - credentialId
        - windowId
        - dimensionId
        - scope
        - startsAtMs
        - endsAtMs
        - boundary
        - openedBy
        - closedAtMs
        - costUsd
        - sample
        - estimatedAllowanceUsd
      type: object
    Output_EnvelopeBody:
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    Output_CycleSampleDto:
      description: One upstream reading, kept on a cycle as a set taken at `atMs`.
      properties:
        atMs:
          format: int64
          type: integer
        costUsd:
          description: The cycle's `costUsd` when the reading was taken.
          type:
            - string
            - 'null'
        limit:
          type:
            - string
            - 'null'
        used:
          type:
            - string
            - 'null'
        usedPercent:
          description: On the 0..100 scale.
          type:
            - string
            - 'null'
      required:
        - usedPercent
        - used
        - limit
        - costUsd
        - atMs
      type: object
  securitySchemes:
    bearer:
      scheme: bearer
      type: http
    anthropicKey:
      in: header
      name: x-api-key
      type: apiKey
    googleKey:
      in: header
      name: x-goog-api-key
      type: apiKey
    queryKey:
      in: query
      name: key
      type: apiKey
    consoleSession:
      in: cookie
      name: gproxy_session
      type: apiKey

````

## Related topics

- [GET /admin/api/credentials/providers](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentialsproviders.md)
- [GET /admin/api/usage](https://gproxy.leenhawk.com/api-reference/management/get-adminapiusage.md)
- [GET /admin/api/usage/records](https://gproxy.leenhawk.com/api-reference/management/get-adminapiusagerecords.md)
- [GET /admin/api/channels](https://gproxy.leenhawk.com/api-reference/management/get-adminapichannels.md)
- [GET /admin/api/credentials](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentials.md)


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