> ## 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/{id}/quota



## OpenAPI

````yaml /generated/openapi.json get /admin/api/credentials/{id}/quota
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.1
servers: []
security:
  - bearer: []
  - anthropicKey: []
  - googleKey: []
  - queryKey: []
paths:
  /admin/api/credentials/{id}/quota:
    get:
      tags:
        - Management
      summary: GET /admin/api/credentials/{id}/quota
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - 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:
                $ref: '#/components/schemas/Output_CredentialQuotaDto'
          description: Success
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Output_Envelope'
          description: Gateway error
      security:
        - consoleSession: []
        - bearer: []
        - anthropicKey: []
        - googleKey: []
components:
  schemas:
    Output_CredentialQuotaDto:
      description: |-
        What this instance knows about one credential's upstream quota: its
        cycles — every open one and each window's most recent closed ones — and
        the blocks currently keeping it out of selection.

        Windows overlap (a 5-hour and a weekly window both count the same
        request), so the cycles' costs are never meant to be summed across
        windows. The raw readings behind the cycles are a separate, paged read.
      properties:
        blocks:
          description: Only blocks that have not expired yet.
          items:
            $ref: '#/components/schemas/Output_CredentialBlockDto'
          type: array
        cycles:
          description: |-
            Open cycles first, by window; then closed ones by window, newest
            first.
          items:
            $ref: '#/components/schemas/Output_CredentialCycleDto'
          type: array
      required:
        - cycles
        - blocks
      type: object
    Output_Envelope:
      properties:
        error:
          $ref: '#/components/schemas/Output_EnvelopeBody'
      required:
        - error
      type: object
    Output_CredentialBlockDto:
      properties:
        credentialId:
          type: string
        id:
          type: string
        observedAtMs:
          format: int64
          type: integer
        operation:
          type:
            - string
            - 'null'
        scope: true
        source: true
        untilMs:
          format: int64
          type: integer
      required:
        - id
        - credentialId
        - scope
        - operation
        - untilMs
        - source
        - observedAtMs
      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/{id}/quota-observations](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentials-quota-observations.md)
- [GET /admin/api/credentials/{id}/quota-reset-credits](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentials-quota-reset-credits.md)
- [GET /admin/api/credentials/{id}/limits](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentials-limits.md)
- [GET /admin/api/credentials/{id}](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentials-1.md)
- [GET /admin/api/credentials/providers](https://gproxy.leenhawk.com/api-reference/management/get-adminapicredentialsproviders.md)


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