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

# Get Usage Report

> GetUsageReport summarizes which users or API keys made API requests, by default in the last 60 minutes, or over a past range of up to 90 days when start_time is set. It returns at most `max_entries` entries, ranked over every matching consumer, together with totals over all of them. It is a bounded summary rather than a search, so it is not paginated: counts change between calls, and pages read at different moments would not join into a consistent list.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/rate_limits/usage_report
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/rate_limits/usage_report:
    post:
      tags:
        - Rate Limit
      summary: Get Usage Report
      description: >-
        GetUsageReport summarizes which users or API keys made API requests, by
        default in the last 60 minutes, or over a past range of up to 90 days
        when start_time is set. It returns at most `max_entries` entries, ranked
        over every matching consumer, together with totals over all of them. It
        is a bounded summary rather than a search, so it is not paginated:
        counts change between calls, and pages read at different moments would
        not join into a consistent list.
      operationId: c1.api.ratelimit.v1.RateLimitService.GetUsageReport
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.ratelimit.v1.RateLimitServiceGetUsageReportRequest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.ratelimit.v1.RateLimitServiceGetUsageReportResponse
          description: Successful response
      x-codeSamples:
        - lang: go
          label: GetUsageReport
          source: "package main\n\nimport(\n\t\"context\"\n\t\"github.com/conductorone/conductorone-sdk-go/pkg/models/shared\"\n\tconductoronesdkgo \"github.com/conductorone/conductorone-sdk-go\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := conductoronesdkgo.New(\n        conductoronesdkgo.WithSecurity(shared.Security{\n            BearerAuth: \"<YOUR_BEARER_TOKEN_HERE>\",\n            Oauth: \"<YOUR_OAUTH_HERE>\",\n        }),\n    )\n\n    res, err := s.RateLimit.GetUsageReport(ctx, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.RateLimitServiceGetUsageReportResponse != nil {\n        // handle response\n    }\n}"
components:
  schemas:
    c1.api.ratelimit.v1.RateLimitServiceGetUsageReportRequest:
      description: The RateLimitServiceGetUsageReportRequest message.
      properties:
        endTime:
          format: date-time
          type:
            - string
            - 'null'
        groupBy:
          description: >-
            How requests are combined into entries. Defaults to
            GROUP_BY_API_KEY.
          enum:
            - GROUP_BY_UNSPECIFIED
            - GROUP_BY_API_KEY
            - GROUP_BY_USER
          type: string
          x-speakeasy-unknown-values: allow
        kinds:
          description: >-
            Only count requests made with API keys of these kinds. Requests made
            from a browser session have no kind and are excluded when this is
            set. When empty, all requests are counted.
          items:
            enum:
              - API_KEY_KIND_UNSPECIFIED
              - API_KEY_KIND_PERSONAL
              - API_KEY_KIND_DEVICE
              - API_KEY_KIND_SERVICE_PRINCIPAL
              - API_KEY_KIND_WORKLOAD_FEDERATION
              - API_KEY_KIND_CONNECTED_APP
              - API_KEY_KIND_CONNECTOR
              - API_KEY_KIND_FUNCTION
              - API_KEY_KIND_OTHER_SYSTEM
            type: string
            x-speakeasy-unknown-values: allow
          type:
            - array
            - 'null'
        maxEntries:
          description: >-
            The maximum number of entries to return, from 1 to 100. Defaults to
            25 when 0.
          format: int32
          type: integer
        sortBy:
          description: The order of the entries. Defaults to SORT_BY_REQUESTS.
          enum:
            - SORT_BY_UNSPECIFIED
            - SORT_BY_REQUESTS
            - SORT_BY_THROTTLED
          type: string
          x-speakeasy-unknown-values: allow
        startTime:
          format: date-time
          type:
            - string
            - 'null'
        throttledOnly:
          description: Only include entries with at least one throttled request.
          type: boolean
      title: Rate Limit Service Get Usage Report Request
      type: object
      x-speakeasy-name-override: RateLimitServiceGetUsageReportRequest
    c1.api.ratelimit.v1.RateLimitServiceGetUsageReportResponse:
      description: The RateLimitServiceGetUsageReportResponse message.
      properties:
        entries:
          description: >-
            The top entries in sort_by order, at most max_entries of them.
            Ranking happens over every matching consumer before truncation.
          items:
            $ref: '#/components/schemas/c1.api.ratelimit.v1.RateLimitConsumer'
          type:
            - array
            - 'null'
        totalConsumers:
          description: >-
            The number of consumers that match the filters, including those
            beyond max_entries.
          format: int64
          type: string
        totalRequests:
          description: >-
            Served requests summed over every matching consumer, including those
            beyond max_entries.
          format: int64
          type: string
        totalThrottled:
          description: >-
            Throttled requests summed over every matching consumer, including
            those beyond max_entries.
          format: int64
          type: string
        windowEnd:
          format: date-time
          type:
            - string
            - 'null'
        windowStart:
          format: date-time
          type:
            - string
            - 'null'
      title: Rate Limit Service Get Usage Report Response
      type: object
      x-speakeasy-name-override: RateLimitServiceGetUsageReportResponse
    c1.api.ratelimit.v1.RateLimitConsumer:
      description: >-
        RateLimitConsumer is the API usage of one user or API key over the last
        60 minutes.
      properties:
        apiKey:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.APIKeyIdentity'
            - type: 'null'
        lastRequestAt:
          format: date-time
          type:
            - string
            - 'null'
        requests:
          description: The requests made in the report period that were served.
          format: int64
          type: string
        throttled:
          description: The requests made in the report period that were throttled.
          format: int64
          type: string
        userDisplayName:
          description: The user's display name.
          type: string
        userId:
          description: >-
            The user the requests were made as. Empty for connectors, functions
            and other system clients.
          type: string
        utilization:
          description: >-
            For the live 60-minute report only, the served requests as a
            fraction of the consumer's own hourly limit: the per-API-key limit,
            or the per-user limit when grouped by user. 1.0 means the limit was
            reached. 0 when the consumer has no hourly limit of its own, such as
            browser sessions. Unset for reports over a past range.
          type: number
      title: Rate Limit Consumer
      type: object
      x-speakeasy-name-override: RateLimitConsumer
    c1.api.ratelimit.v1.APIKeyIdentity:
      description: APIKeyIdentity describes the credential that made API requests.
      properties:
        deleted:
          description: Whether the credential has been deleted since it made requests.
          type: boolean
        displayName:
          description: >-
            The credential's display name. When the credential has been deleted,
            a placeholder that includes its ID.
          type: string
        kind:
          description: The type of credential.
          enum:
            - API_KEY_KIND_UNSPECIFIED
            - API_KEY_KIND_PERSONAL
            - API_KEY_KIND_DEVICE
            - API_KEY_KIND_SERVICE_PRINCIPAL
            - API_KEY_KIND_WORKLOAD_FEDERATION
            - API_KEY_KIND_CONNECTED_APP
            - API_KEY_KIND_CONNECTOR
            - API_KEY_KIND_FUNCTION
            - API_KEY_KIND_OTHER_SYSTEM
          type: string
          x-speakeasy-unknown-values: allow
        ownerDisplayName:
          description: The owner's display name.
          type: string
        ownerUserId:
          description: >-
            The user whose per-user limit the credential's requests count
            against: the key's owner, the user who connected the app, or the
            service principal's user. Empty for connectors, functions and other
            system clients.
          type: string
        ref:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.APIKeyRef'
            - type: 'null'
        servicePrincipalId:
          description: >-
            For service principal API keys and workload federation trusts, the
            service principal the credential belongs to.
          type: string
      title: Api Key Identity
      type: object
      x-speakeasy-name-override: APIKeyIdentity
    c1.api.ratelimit.v1.APIKeyRef:
      description: >
        APIKeyRef identifies an API key, or another credential that makes API
        requests.


        This message contains a oneof named credential. Only a single field of
        the following list may be set at a time:
          - personalClient
          - deviceClient
          - servicePrincipalCredential
          - connectedAppClientGrant
          - connectedAppOauthGrant
          - systemClient
      properties:
        connectedAppClientGrant:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.ratelimit.v1.ConnectedAppClientGrantRef
            - type: 'null'
        connectedAppOauthGrant:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.ratelimit.v1.ConnectedAppOAuthGrantRef
            - type: 'null'
        deviceClient:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.DeviceClientRef'
            - type: 'null'
        personalClient:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.PersonalClientRef'
            - type: 'null'
        servicePrincipalCredential:
          oneOf:
            - $ref: >-
                #/components/schemas/c1.api.ratelimit.v1.ServicePrincipalCredentialRef
            - type: 'null'
        systemClient:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.SystemClientRef'
            - type: 'null'
      title: Api Key Ref
      type: object
      x-speakeasy-name-override: APIKeyRef
    c1.api.ratelimit.v1.ConnectedAppClientGrantRef:
      description: >-
        ConnectedAppClientGrantRef identifies an app a user connected through
        dynamic client registration, such as an AI agent.
      properties:
        clientId:
          description: >-
            The app's full registered client ID, as ConductorOne issued it:
            "<name>@<organization domain>/<usage>", e.g.
            "blue-whale-12345@acme.conductor.one/dcc".
          type: string
        userId:
          description: The user who connected the app.
          type: string
      title: Connected App Client Grant Ref
      type: object
      x-speakeasy-name-override: ConnectedAppClientGrantRef
    c1.api.ratelimit.v1.ConnectedAppOAuthGrantRef:
      description: >-
        ConnectedAppOAuthGrantRef identifies an app a user connected through an
        OAuth client registered with the organization.
      properties:
        grantId:
          description: The grant's ID.
          type: string
      title: Connected App O Auth Grant Ref
      type: object
      x-speakeasy-name-override: ConnectedAppOAuthGrantRef
    c1.api.ratelimit.v1.DeviceClientRef:
      description: DeviceClientRef identifies a device or command-line client.
      properties:
        clientId:
          description: >-
            The client's ID, without the domain: the part before "@" of the full
            client ID, e.g. "blue-whale-12345".
          type: string
      title: Device Client Ref
      type: object
      x-speakeasy-name-override: DeviceClientRef
    c1.api.ratelimit.v1.PersonalClientRef:
      description: PersonalClientRef identifies a personal API key.
      properties:
        clientId:
          description: >-
            The key's client ID, without the domain: the part before "@" of the
            full client ID, e.g. "blue-whale-12345" for
            "blue-whale-12345@acme.conductor.one/pcc". Always an adjective, a
            creature and five digits, joined by hyphens.
          type: string
      title: Personal Client Ref
      type: object
      x-speakeasy-name-override: PersonalClientRef
    c1.api.ratelimit.v1.ServicePrincipalCredentialRef:
      description: ServicePrincipalCredentialRef identifies a service principal API key.
      properties:
        clientId:
          description: >-
            The key's client ID, without the domain: the part before "@" of the
            full client ID, e.g. "blue-whale-12345".
          type: string
      title: Service Principal Credential Ref
      type: object
      x-speakeasy-name-override: ServicePrincipalCredentialRef
    c1.api.ratelimit.v1.SystemClientRef:
      description: >-
        SystemClientRef identifies a client managed by ConductorOne: a
        connector, managed connector, function, connector builder, tunnel or
        workload federation trust. Connector builder and tunnel clients are only
        found when they made requests in the last 60 minutes.
      properties:
        clientId:
          description: >-
            The client's ID, without the domain: the part before "@" of the full
            client ID, e.g. "blue-whale-12345". For a workload federation trust,
            the trust's ID, which has the same form.
          type: string
      title: System Client Ref
      type: object
      x-speakeasy-name-override: SystemClientRef
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````