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

# List usage

> List accepted predictions and their charges, newest first.

Usage contains metadata, never input context or answers. Pass next_cursor
unchanged with the same filters to continue; null ends pagination. Start is
inclusive and end is exclusive. Supply timezone-aware ISO 8601 timestamps.



## OpenAPI

````yaml /openapi.json get /v1/usage
openapi: 3.1.0
info:
  description: >-
    Synchronous structured predictions. Reuse Idempotency-Key for retries.
    Prices are USD decimal strings.
  title: D1 Prediction API
  version: 1.0.0
servers:
  - url: https://d1-staging-5gh8d.ondigitalocean.app
    description: Invited staging — simulated predictions and test credit
security:
  - APIKey: []
paths:
  /v1/usage:
    get:
      tags:
        - Account
      summary: List usage
      description: >-
        List accepted predictions and their charges, newest first.


        Usage contains metadata, never input context or answers. Pass
        next_cursor

        unchanged with the same filters to continue; null ends pagination. Start
        is

        inclusive and end is exclusive. Supply timezone-aware ISO 8601
        timestamps.
      operationId: get_usage_v1_usage_get
      parameters:
        - in: query
          name: cursor
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - in: query
          name: limit
          required: false
          schema:
            default: 50
            maximum: 100
            minimum: 1
            title: Limit
            type: integer
        - in: query
          name: start
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: Start
        - in: query
          name: end
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: End
        - in: query
          name: model
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Model
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page_UsageRecord_'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Malformed or ambiguous JSON.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Missing, invalid, or revoked API key.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Insufficient available credit.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Account is waitlisted or suspended.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Resource not found.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: >-
            Operation conflict, in-progress request, expired replay, or
            cancellation.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '413':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Request exceeds a body, input, or model limit.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unsupported media type or content encoding.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Request validation failed or model is unavailable.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Account request, token, concurrency, or read limit exceeded.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: >-
            Unexpected service error; replay a prediction to resolve
            uncertainty.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Invalid model output; no charge is settled.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Service paused, capacity exhausted, or dependency unavailable.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Prediction deadline exceeded; replay using the same operation key.
          headers:
            Retry-After:
              description: When present, wait this many seconds before retrying.
              schema:
                minimum: 1
                type: integer
            X-Request-ID:
              description: Server request identifier for support and correlation.
              schema:
                type: string
components:
  schemas:
    Page_UsageRecord_:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: '#/components/schemas/UsageRecord'
          title: Items
          type: array
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      required:
        - items
        - next_cursor
      title: Page[UsageRecord]
      type: object
    ErrorEnvelope:
      additionalProperties: false
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      required:
        - error
      title: ErrorEnvelope
      type: object
    UsageRecord:
      additionalProperties: false
      properties:
        charge_usd:
          pattern: ^\d+\.\d{9}$
          title: Charge Usd
          type: string
        completed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Completed At
        created_at:
          format: date-time
          title: Created At
          type: string
        id:
          format: uuid
          title: Id
          type: string
        input_tokens:
          minimum: 0
          title: Input Tokens
          type: integer
        model:
          title: Model
          type: string
        pricing_version:
          title: Pricing Version
          type: string
        question_count:
          minimum: 0
          title: Question Count
          type: integer
        request_id:
          title: Request Id
          type: string
        status:
          title: Status
          type: string
      required:
        - id
        - request_id
        - model
        - question_count
        - input_tokens
        - status
        - charge_usd
        - pricing_version
        - created_at
        - completed_at
      title: UsageRecord
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
        request_id:
          title: Request Id
          type: string
      required:
        - code
        - message
        - request_id
      title: ErrorDetail
      type: object
  securitySchemes:
    APIKey:
      scheme: bearer
      type: http

````