GitHub Usage API

The Usage API from GitHub — 4 operation(s) for usage.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Usage API
  version: 1.1.4
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  description: 'Operations tagged Usage across 2 of this provider''s published API definitions: github-organizations-openapi.yml, github-repo-actions-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
- url: '{protocol}://{hostname}'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
tags:
- name: Usage
paths:
  /orgs/{org}/actions/cache/usage:
    get:
      summary: GitHub Get Github Actions Cache Usage for an Organization
      description: 'Gets the total GitHub Actions cache usage for an organization.

        The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.


        OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.'
      tags:
      - Usage
      operationId: getGithubActionsCacheUsageForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/cache#get-github-actions-cache-usage-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/actions-cache-usage-org-enterprise'
              examples:
                default:
                  $ref: '#/components/examples/actions-cache-usage-org-enterprise'
          headers:
            Link:
              $ref: '#/components/headers/link'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: cache
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /orgs/{org}/actions/cache/usage-by-repository:
    get:
      summary: GitHub List Repositories with Github Actions Cache Usage for an Organization
      description: 'Lists repositories and their GitHub Actions cache usage for an organization.

        The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.


        OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.'
      tags:
      - Usage
      operationId: listRepositoriesWithGithubActionsCacheUsageForAnOrganization
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                required:
                - total_count
                - repository_cache_usages
                properties:
                  total_count:
                    type: integer
                  repository_cache_usages:
                    type: array
                    items:
                      $ref: '#/components/schemas/actions-cache-usage-by-repository'
              examples:
                default:
                  $ref: '#/components/examples/org-actions-cache-usage-by-repo'
          headers:
            Link:
              $ref: '#/components/headers/link'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: cache
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}/api/v3'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: HOSTNAME
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: http
  /repos/{owner}/{repo}/actions/cache/usage:
    get:
      summary: GitHub Get Github Actions Cache Usage for Repository
      description: 'Gets GitHub Actions cache usage for a repository.

        The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.


        Anyone with read access to the repository can use this endpoint.


        If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Usage
      operationId: getGithubActionsCacheUsageForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/cache#get-github-actions-cache-usage-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/actions-cache-usage-by-repository'
              examples:
                default:
                  $ref: '#/components/examples/actions-cache-usage'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: cache
      x-api-evangelist-certified: '2025-07-16'
      x-api-naftiko-published: '2025-07-25'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: api.github.com
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: https
  /repos/{owner}/{repo}/actions/cache/usage-policy:
    get:
      summary: GitHub Get Github Actions Cache Usage Policy for Repository
      description: 'Gets GitHub Actions cache usage policy for a repository.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Usage
      operationId: getGithubActionsCacheUsagePolicyForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/actions-cache-usage-policy-for-repository'
              examples:
                default:
                  $ref: '#/components/examples/actions-cache-usage-policy'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: cache
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      summary: GitHub Set Github Actions Cache Usage Policy for Repository
      description: 'Sets GitHub Actions cache usage policy for a repository.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Usage
      operationId: setGithubActionsCacheUsagePolicyForRepository
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '204':
          description: Response
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/actions-cache-usage-policy-for-repository'
            examples:
              selected_actions:
                $ref: '#/components/examples/actions-cache-usage-policy'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: cache
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    servers:
    - url: '{protocol}://{hostname}'
      variables:
        hostname:
          description: Self-hosted Enterprise Server hostname
          default: api.github.com
        protocol:
          description: Self-hosted Enterprise Server protocol
          default: https
components:
  schemas:
    actions-cache-usage-org-enterprise:
      type: object
      properties:
        total_active_caches_count:
          type: integer
          description: The count of active caches across all repositories of an enterprise or an organization.
          example: 42
        total_active_caches_size_in_bytes:
          type: integer
          description: The total size in bytes of all active cache items across all repositories of an enterprise or an organization.
          example: 42
      required:
      - total_active_caches_count
      - total_active_caches_size_in_bytes
    actions-cache-usage-by-repository:
      title: Actions Cache Usage by repository
      description: GitHub Actions Cache Usage by repository.
      type: object
      properties:
        full_name:
          description: The repository owner and name for the cache usage being shown.
          type: string
          example: octo-org/Hello-World
        active_caches_size_in_bytes:
          description: The sum of the size in bytes of all the active cache items in the repository.
          type: integer
          example: 2322142
        active_caches_count:
          description: The number of active caches in the repository.
          type: integer
          example: 3
      required:
      - full_name
      - active_caches_size_in_bytes
      - active_caches_count
    actions-cache-usage-policy-for-repository:
      title: Actions cache usage policy for repository
      description: GitHub Actions cache usage policy for repository.
      type: object
      properties:
        repo_cache_size_limit_in_gb:
          description: The size limit for the sum of all caches, in gigabytes.
          type: integer
          example: 14
      required:
      - repo_cache_size_limit_in_gb
  examples:
    actions-cache-usage-org-enterprise:
      value:
        total_active_caches_size_in_bytes: 3344284
        total_active_caches_count: 5
    org-actions-cache-usage-by-repo:
      value:
        total_count: 2
        repository_cache_usages:
        - full_name: octo-org/Hello-World
          active_caches_size_in_bytes: 2322142
          active_caches_count: 3
        - full_name: octo-org/server
          active_caches_size_in_bytes: 1022142
          active_caches_count: 2
    actions-cache-usage-policy:
      value:
        repo_cache_size_limit_in_gb: 14
    actions-cache-usage:
      value:
        full_name: octo-org/Hello-World
        active_caches_size_in_bytes: 2322142
        active_caches_count: 3
  parameters:
    per-page:
      name: per_page
      description: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 30
    org:
      name: org
      description: The organization name. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    page:
      name: page
      description: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 1
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    repo:
      name: repo
      description: The name of the repository without the `.git` extension. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
  headers:
    link:
      example: <https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"
      schema:
        type: string
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer Token
      type: http
      scheme: Bearer
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/
x-refined-from:
- github-organizations-openapi.yml
- github-repo-actions-api-openapi.yml