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

# Get subscription usage

> Reads live from Anthropic and OpenAI how much of each connected Claude and ChatGPT subscription's 5-hour and weekly limits is used. Muse Code and OpenCode Go do not report usage. Without `scope`, returns your personal subscriptions followed by the organization's, each in the order workspaces use them.



## OpenAPI

````yaml /openapi.json get /v1/agents/subscription-usage
openapi: 3.1.0
info:
  title: Replicas API
  version: 2.0.0
  description: >-
    Create and control workspaces, and manage the environments, automations, and
    learnings they run with.
servers:
  - url: https://api.replicas.dev
    description: Production API
security:
  - apiKey: []
tags:
  - name: Replica
    description: >-
      A replica is a Replicas workspace: a cloud sandbox where a coding agent
      works on your repositories.
  - name: Chats
    description: Manage the agent chats inside a replica.
  - name: Message queue
    description: Messages waiting for the agent to finish its turn.
  - name: Commands and terminals
    description: Run commands and open shells in a replica.
  - name: Pull requests
    description: Inspect and act on pull requests a replica opened.
  - name: Previews
    description: Public URLs for ports in a replica.
  - name: Canvas
    description: Plans, reports, and other files agents produce.
  - name: Sharing
    description: Add replicas to members' Shared view.
  - name: Environments
    description: >-
      Environments define what a workspace starts with. The `global` environment
      applies to every workspace.
  - name: Environment variables
    description: Variables injected into workspaces.
  - name: Environment files
    description: Files written into workspaces.
  - name: Environment skills
    description: Agent skills installed into workspaces.
  - name: Environment MCPs
    description: MCP servers available to workspace agents.
  - name: Hooks
    description: Scripts that run when warm pool snapshots build and when workspaces start.
  - name: Warm pools
    description: Pre-built workspaces that start faster.
  - name: Automations
    description: Run agents on schedules and events.
  - name: Repositories
    description: Repositories and repository sets connected to the organization.
  - name: Learnings
    description: Organization skills every workspace agent loads.
  - name: Agent credentials
    description: >-
      API keys and endpoints that coding agents use. Connect Claude, Codex, and
      Muse subscriptions with the CLI.
  - name: Plugins
    description: Connect integrations that workspace agents can use.
  - name: Organization
    description: Who you are and who is in your organization.
  - name: Media
    description: Screenshots, recordings, and other files workspaces produce.
  - name: Slack
    description: Route Slack threads to workspaces.
  - name: Workspace identity
    description: OIDC keys for verifying workspace identity tokens.
paths:
  /v1/agents/subscription-usage:
    get:
      tags:
        - Agent credentials
      summary: Get subscription usage
      description: >-
        Reads live from Anthropic and OpenAI how much of each connected Claude
        and ChatGPT subscription's 5-hour and weekly limits is used. Muse Code
        and OpenCode Go do not report usage. Without `scope`, returns your
        personal subscriptions followed by the organization's, each in the order
        workspaces use them.
      operationId: getSubscriptionUsage
      parameters:
        - name: scope
          in: query
          description: Only `user` (needs a personal API key) or only `org` subscriptions.
          schema:
            type: string
            enum:
              - user
              - org
        - $ref: '#/components/parameters/ApiVersion'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  accounts:
                    type: array
                    items:
                      $ref: '#/components/schemas/SubscriptionUsageAccount'
                required:
                  - accounts
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    ApiVersion:
      name: X-Replicas-Api-Version
      in: header
      description: >-
        API version. `2026-10-07` returns `snake_case` responses. See
        [versioning](/features/api#versioning).
      required: false
      schema:
        type: string
        enum:
          - '2026-10-07'
  schemas:
    SubscriptionUsageAccount:
      type: object
      properties:
        provider:
          type: string
          enum:
            - claude
            - codex
        scope:
          type: string
          enum:
            - user
            - org
        credential_id:
          type: string
          format: uuid
        email:
          type: string
        plan_type:
          type: string
          description: Plan name as the provider reports it, e.g. `max` or `pro`
        exhausted_until:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Workspaces skip the account until then because it last hit a usage
            limit.
        windows:
          type:
            - array
            - 'null'
          description: >-
            Null when the provider did not report usage. Empty when the plan has
            no limits.
          items:
            type: object
            properties:
              kind:
                type: string
                enum:
                  - session
                  - weekly
                description: '`session` is the 5-hour limit.'
              model:
                type:
                  - string
                  - 'null'
                description: Set when the limit covers one model family, e.g. `Opus`.
              used_percent:
                type: number
              resets_at:
                type:
                  - string
                  - 'null'
                format: date-time
                description: Null until usage starts the window.
            required:
              - kind
              - model
              - used_percent
              - resets_at
        reconnect_required:
          type: boolean
          description: >-
            The provider rejected the saved login, so workspaces cannot use the
            account until it is reconnected.
      required:
        - provider
        - scope
        - credential_id
        - exhausted_until
        - windows
        - reconnect_required
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type:
            - string
            - 'null'
          description: Additional error details
        code:
          type: string
          description: Machine-readable error code when available
      required:
        - error
  responses:
    BadRequest:
      description: Bad request - Missing or invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Forbidden - The authenticated account cannot access this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Organization or personal API key from **Settings → API Keys**.

````

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