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

# Decision usage for the authenticated key

> Counter totals, a per-day series and a per-model split for /decide. Counters only; no text, question or option is recorded.



## OpenAPI

````yaml /openapi.json get /decide/usage
openapi: 3.1.0
info:
  title: tokz API
  version: 1.0.0
  description: >-
    Typed decisions about text from the open OpenDecision models. Text sent to
    /decide is read by the model and never stored or logged; only counters are
    kept. Fine tunes are built in the dashboard, which is not part of this API.
  contact:
    name: tokz
    url: https://tokz.dev
servers:
  - url: https://api.tokz.dev
    description: Production
  - url: http://127.0.0.1:3999
    description: Local dev (dev:pglite)
security:
  - bearerAuth: []
tags:
  - name: Decisions
    description: Typed decisions about text, answered by the OpenDecision models.
  - name: Fine tunes
    description: >-
      The files of a model you trained. Starting, canceling and deleting one
      happen in the dashboard.
  - name: Operations
    description: Health and diagnostics.
paths:
  /decide/usage:
    get:
      tags:
        - Decisions
      summary: Decision usage for the authenticated key
      description: >-
        Counter totals, a per-day series and a per-model split for /decide.
        Counters only; no text, question or option is recorded.
      operationId: getDecideUsage
      parameters:
        - name: days
          in: query
          description: >-
            How many days of history to return. Digits only, up to three; values
            above 365 are clamped.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 999
            default: 30
      responses:
        '200':
          description: Decision usage summary.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecideUsage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    DecideUsage:
      type: object
      properties:
        key:
          type: object
        totals:
          type: object
          properties:
            requests:
              type: integer
            texts:
              type: integer
            decisions:
              type: integer
            billedTokens:
              type: integer
            costUsd:
              type: number
        daily:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                format: date
              requests:
                type: integer
              billedTokens:
                type: integer
              costUsd:
                type: number
        byModel:
          type: object
          additionalProperties:
            type: object
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A code or a short message. Never contains payload content.
        message:
          type: string
          description: >-
            What went wrong and what to do next, when the API has a sentence for
            it.
        requestId:
          type: string
  responses:
    Unauthorized:
      description: Missing, malformed, revoked, or incorrect API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Too many requests. The limit is per API key; retry after the window
        resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key: `Authorization: Bearer tokz_live_<id>_<secret>`. Only a
        SHA-256 hash of the secret is stored.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.