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

# Get Project Usage

> Get token usage stats for a project, grouped by day and model.

Returns a list of {date, model, input_tokens, output_tokens,
cache_creation_input_tokens, cache_read_input_tokens, cost_usd, request_count}
for the last `days` days. Pass `days=0` for the full project history
(no time filter) — the all-time total reconciles with the user's remaining
balance, which is also computed against all usage.



## OpenAPI

````yaml /openapi.json get /api/projects/{project_id}/usage
openapi: 3.1.0
info:
  description: >-
    Public CodeCobra API. Authenticate by sending a personal API key in the
    `Authorization: Bearer <key>` header. Generate keys from Settings → API keys
    in the CodeCobra dashboard.
  title: CodeCobra Public API
  version: 1.0.0
servers: []
security: []
paths:
  /api/projects/{project_id}/usage:
    get:
      tags:
        - public
      summary: Get Project Usage
      description: >-
        Get token usage stats for a project, grouped by day and model.


        Returns a list of {date, model, input_tokens, output_tokens,

        cache_creation_input_tokens, cache_read_input_tokens, cost_usd,
        request_count}

        for the last `days` days. Pass `days=0` for the full project history

        (no time filter) — the all-time total reconciles with the user's
        remaining

        balance, which is also computed against all usage.
      operationId: get_project_usage_api_projects__project_id__usage_get
      parameters:
        - in: path
          name: project_id
          required: true
          schema:
            format: uuid
            title: Project Id
            type: string
        - in: query
          name: days
          required: false
          schema:
            default: 30
            title: Days
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````