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

# Daily usage

> One row per UTC day: runs created that day, their tokens and their spend. Requires `usage_read`.

Rows run from the start date through the day of the last instant before `end_at`, oldest first. Days without activity are present at zero. The window spans at most 92 days; omit both bounds for the current UTC calendar month.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/usage/daily
openapi: 3.1.0
info:
  title: OpenType API
  version: 0.1.0
  license:
    name: Apache-2.0
  description: >-
    The OpenType HTTP API: decision runs on Neon 1.1, API keys, usage, quota and
    billing. Every `/v1` route takes `Authorization: Bearer <credential>`, where
    the credential is an API key (`otsk_` followed by 64 hex characters) or a
    console session token. Amounts are integers in micro-USD (1,000,000 = 1 US
    dollar). Errors share one envelope, `{"error": {"code", "message",
    "request_id"}}`. Stripe is named only where it hosts checkout, the billing
    portal and receipts.
servers:
  - url: https://api.opentype.dev
    description: Production
  - url: https://api.opentype.dev
    description: Production
security:
  - bearer: []
  - bearer: []
tags:
  - name: runs
    description: Create, list, retrieve and stream runs.
  - name: keys
    description: Create, list, rotate and revoke API keys.
  - name: usage
    description: Usage rollups, the daily series, the ledger and quota.
  - name: billing
    description: Credit balance, checkout, the billing portal and auto-recharge.
  - name: health
    description: Public liveness and readiness checks.
  - name: router
    description: >-
      Model Router: classify a task with Neon 1.1 and pick a model from the
      benchmark catalog.
paths:
  /v1/usage/daily:
    get:
      tags:
        - usage
      summary: Daily usage
      description: >-
        One row per UTC day: runs created that day, their tokens and their
        spend. Requires `usage_read`.


        Rows run from the start date through the day of the last instant before
        `end_at`, oldest first. Days without activity are present at zero. The
        window spans at most 92 days; omit both bounds for the current UTC
        calendar month.
      operationId: daily_usage
      parameters:
        - name: start_at
          in: query
          description: >-
            Window start, exactly `YYYY-MM-DDTHH:MM:SSZ` (UTC), inclusive. Send
            it with `end_at`; omit both for the current UTC calendar month.
          required: false
          schema:
            type: string
        - name: end_at
          in: query
          description: >-
            Window end, exactly `YYYY-MM-DDTHH:MM:SSZ` (UTC), exclusive. Send it
            with `start_at`. At most 92 days after `start_at`.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: One row per UTC day.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DailyUsageResponse'
        '400':
          description: >-
            `invalid_parameter`: a malformed window, `start_at` not before
            `end_at`, one bound without the other, or a window over 92 days. An
            unknown query parameter gets a plain-text `400`.
        '401':
          description: >-
            `missing_credentials` (no bearer credential) or `invalid_credential`
            (malformed, unknown or revoked).
        '403':
          description: >-
            `scope_denied`: the credential lacks `usage_read`. A session without
            an organization gets `no_active_organization`.
        '500':
          description: '`internal_error`: an unexpected failure. Report the `request_id`.'
        '503':
          description: >-
            `database_not_configured` or `database_unavailable`: accounting
            storage is unavailable. Also `auth_not_configured` or
            `trust_keys_unavailable` when credentials cannot be verified.
      security:
        - bearer: []
        - bearer: []
components:
  schemas:
    DailyUsageResponse:
      type: object
      description: '`GET /v1/usage/daily`.'
      required:
        - organization_id
        - window
        - days
      properties:
        organization_id:
          type: string
        window:
          $ref: '#/components/schemas/UsageWindowBody'
        days:
          type: array
          items:
            $ref: '#/components/schemas/DailyUsageBody'
          description: >-
            One row per UTC day, oldest first. Days without activity are present
            at zero.
    UsageWindowBody:
      type: object
      required:
        - start_at
        - end_at
      properties:
        start_at:
          type: string
        end_at:
          type: string
    DailyUsageBody:
      type: object
      description: One day of `GET /v1/usage/daily`.
      required:
        - date
        - runs
        - input_tokens
        - output_tokens
        - spend_micros
      properties:
        date:
          type: string
          description: '`YYYY-MM-DD`, UTC.'
        runs:
          type: integer
          format: int64
          minimum: 0
        input_tokens:
          type: integer
          format: int64
          minimum: 0
        output_tokens:
          type: integer
          format: int64
          minimum: 0
        spend_micros:
          type: integer
          format: int64
          minimum: 0
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: An API key (otsk_ + 64 hex) or a console session token.

````