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

# Get usage

> Review lifetime authenticated-request counts by API key.

This endpoint reports operational API-key request counts. It does not report Action spend, wallet activity, or invoices.

<Card title="Manage API keys in Darwin" icon="key" horizontal href="https://darwin.so/settings?tab=api-keys">
  Review your keys in Developer settings.
</Card>


## OpenAPI

````yaml openapi-v2.json GET /account/api-keys/usage
openapi: 3.1.0
info:
  title: Darwin API
  version: 2.0.0
  description: >-
    Search executable capabilities, manage durable work through explicit Action
    operations, and administer developer credentials for the signed-in account.
    Operations marked planned-preview are contract scaffolding and are not
    callable in production.
servers:
  - url: https://api.darwin.so/api/v2
security:
  - apiKey: []
  - bearer: []
paths:
  /account/api-keys/usage:
    get:
      summary: Get usage
      description: >-
        Get lifetime authenticated-request counts for the account and each API
        key. This is operational key usage, not billable Action spend. Requires
        an authenticated account session.
      operationId: get_api_usage
      responses:
        '200':
          description: Lifetime API-key request counts and key-status totals.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyUsageResponse'
        '401':
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - AccountSession: []
components:
  schemas:
    ApiKeyUsageResponse:
      type: object
      additionalProperties: false
      required:
        - usage
      properties:
        usage:
          type: object
          additionalProperties: false
          required:
            - period
            - requests
            - apiKeys
            - byKey
          properties:
            period:
              type: string
              const: lifetime
            requests:
              type: object
              additionalProperties: false
              required:
                - total
              properties:
                total:
                  type: integer
                  minimum: 0
            apiKeys:
              type: object
              additionalProperties: false
              required:
                - total
                - active
                - expired
                - revoked
              properties:
                total:
                  type: integer
                  minimum: 0
                active:
                  type: integer
                  minimum: 0
                expired:
                  type: integer
                  minimum: 0
                revoked:
                  type: integer
                  minimum: 0
            byKey:
              type: array
              items:
                type: object
                additionalProperties: false
                required:
                  - id
                  - name
                  - prefix
                  - status
                  - requestCount
                  - lastUsedAt
                  - createdAt
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  prefix:
                    type: string
                  status:
                    type: string
                    enum:
                      - active
                      - expired
                      - revoked
                  requestCount:
                    type: integer
                    minimum: 0
                  lastUsedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  createdAt:
                    type: string
                    format: date-time
    Error:
      type: object
      additionalProperties: true
      properties:
        error:
          type: string
        message:
          type: string
        fields:
          type: array
          items:
            type: object
            additionalProperties: true
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      x-fern-header:
        name: apiKey
        env: DARWIN_API_KEY
      description: >-
        Pass your Darwin API key in the x-api-key header. You can also
        authenticate with Authorization: Bearer <apiKey>.
    bearer:
      type: http
      scheme: bearer
      bearerFormat: Darwin API key or OAuth access token
      x-fern-bearer:
        name: token
        env: DARWIN_API_KEY
      description: >-
        Pass a Darwin API key or OAuth access token as Authorization: Bearer
        <token>. You can also pass a Darwin API key in x-api-key.
    AccountSession:
      type: apiKey
      in: cookie
      name: __Secure-better-auth.session_token
      description: >-
        The HTTP-only Darwin account session cookie set after sign-in. Local
        development uses better-auth.session_token without the __Secure- prefix.

````