> ## 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.

# Batch Get

> BatchGet returns the live usage of each requested API key the caller may view. Users may view their own personal API keys, device clients and connected apps, and the API keys of service principals they may view. Rate limit administrators may view every key. Keys the caller may not view, and keys that do not exist, are omitted from the response.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/rate_limits/api_keys/usage
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/api_keys/usage:
    post:
      tags:
        - Rate Limit
      summary: Batch Get
      description: >-
        BatchGet returns the live usage of each requested API key the caller may
        view. Users may view their own personal API keys, device clients and
        connected apps, and the API keys of service principals they may view.
        Rate limit administrators may view every key. Keys the caller may not
        view, and keys that do not exist, are omitted from the response.
      operationId: c1.api.ratelimit.v1.APIKeyUsageService.BatchGet
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.ratelimit.v1.APIKeyUsageServiceBatchGetRequest
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.ratelimit.v1.APIKeyUsageServiceBatchGetResponse
          description: Successful response
      x-codeSamples:
        - lang: go
          label: BatchGet
          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.APIKeyUsage.BatchGet(ctx, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.APIKeyUsageServiceBatchGetResponse != nil {\n        // handle response\n    }\n}"
components:
  schemas:
    c1.api.ratelimit.v1.APIKeyUsageServiceBatchGetRequest:
      description: The APIKeyUsageServiceBatchGetRequest message.
      properties:
        apiKeys:
          description: >-
            The API keys to report on. Keys the caller may not view, including
            any system_client reference from a caller who is not a rate limit
            administrator, are omitted from the response.
          items:
            $ref: '#/components/schemas/c1.api.ratelimit.v1.APIKeyRef'
          type:
            - array
            - 'null'
      title: Api Key Usage Service Batch Get Request
      type: object
      x-speakeasy-name-override: APIKeyUsageServiceBatchGetRequest
    c1.api.ratelimit.v1.APIKeyUsageServiceBatchGetResponse:
      description: The APIKeyUsageServiceBatchGetResponse message.
      properties:
        list:
          description: >-
            Usage for each requested key the caller may view, in request order,
            without duplicates.
          items:
            $ref: '#/components/schemas/c1.api.ratelimit.v1.APIKeyUsageSummary'
          type:
            - array
            - 'null'
      title: Api Key Usage Service Batch Get Response
      type: object
      x-speakeasy-name-override: APIKeyUsageServiceBatchGetResponse
    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.APIKeyUsageSummary:
      description: APIKeyUsageSummary is the live usage of one API key.
      properties:
        apiKey:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.APIKeyIdentity'
            - type: 'null'
        usage:
          description: Live usage of the key's own limits.
          items:
            $ref: '#/components/schemas/c1.api.ratelimit.v1.RateLimitUsage'
          type:
            - array
            - 'null'
      title: Api Key Usage Summary
      type: object
      x-speakeasy-name-override: APIKeyUsageSummary
    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
    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.RateLimitUsage:
      description: >-
        RateLimitUsage is the live usage of one rate limit bucket. The
        X-RateLimit-* response headers report the limiter's view of the bucket
        that applied to a request.
      properties:
        rateLimit:
          oneOf:
            - $ref: '#/components/schemas/c1.api.ratelimit.v1.RateLimit'
            - type: 'null'
        used:
          description: >-
            For WINDOW_PER_HOUR, the requests made in the last 60 minutes that
            counted against the limit; throttled requests do not count. For
            WINDOW_CONCURRENT, the requests in progress now.
          format: int64
          type: string
      title: Rate Limit Usage
      type: object
      x-speakeasy-name-override: RateLimitUsage
    c1.api.ratelimit.v1.RateLimit:
      description: RateLimit is one limit applied to API requests.
      properties:
        limit:
          description: >-
            The number of requests allowed: per hour for WINDOW_PER_HOUR, or at
            the same time for WINDOW_CONCURRENT.
          format: int64
          type: string
        scope:
          description: Whose requests the limit counts.
          enum:
            - SCOPE_UNSPECIFIED
            - SCOPE_ORGANIZATION
            - SCOPE_USER
            - SCOPE_API_KEY
            - SCOPE_UNAUTHENTICATED
            - SCOPE_UNAUTHENTICATED_PER_IP
          type: string
          x-speakeasy-unknown-values: allow
        window:
          description: How the limit counts requests.
          enum:
            - WINDOW_UNSPECIFIED
            - WINDOW_PER_HOUR
            - WINDOW_CONCURRENT
          type: string
          x-speakeasy-unknown-values: allow
      title: Rate Limit
      type: object
      x-speakeasy-name-override: RateLimit
  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

````