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

# AI usage: tokens, estimated cost and calls by model and day



## OpenAPI

````yaml /openapi/v3.yaml get /api/v2/ai-usage
openapi: 3.1.0
info:
  title: Semicola Exchange platform API
  version: 3.0.0-preview
  description: >-
    Platform endpoints of Semicola: sign-in, signup and OAuth for MCP clients,
    accounts, members and keys, billing, notifications, the Semi assistant (chat
    stream, confirmations, conversations), the MCP App widget host and realtime
    feeds. Typed agent tools live on the MCP server at /mcp/v3.
servers:
  - url: https://api.semicola.com
security:
  - bearerAuth: []
  - sessionCookie: []
tags:
  - name: Auth
  - name: Signup
  - name: OAuth
  - name: Accounts
  - name: Members
  - name: API Keys
  - name: Connected Apps
  - name: Onboarding
  - name: Billing
  - name: AI Usage
  - name: Notifications
  - name: Assistant
  - name: MCP Apps
  - name: Realtime
  - name: Demo
paths:
  /api/v2/ai-usage:
    get:
      tags:
        - AI Usage
      summary: 'AI usage: tokens, estimated cost and calls by model and day'
      operationId: getAiUsage
      parameters:
        - name: days
          in: query
          required: false
          schema:
            type: string
            enum:
              - '7'
              - '30'
              - '90'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    anyOf:
                      - type: object
                        properties:
                          days:
                            anyOf:
                              - type: number
                                const: 7
                              - type: number
                                const: 30
                              - type: number
                                const: 90
                          totals:
                            type: object
                            properties:
                              tokens:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              estimatedCostUsd:
                                type: number
                              calls:
                                type: integer
                                minimum: 0
                                maximum: 9007199254740991
                              topModel:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - tokens
                              - estimatedCostUsd
                              - calls
                              - topModel
                            additionalProperties: false
                          byModel:
                            type: array
                            items:
                              type: object
                              properties:
                                model:
                                  type: string
                                calls:
                                  type: integer
                                  minimum: 0
                                  maximum: 9007199254740991
                                tokens:
                                  type: integer
                                  minimum: 0
                                  maximum: 9007199254740991
                                costUsd:
                                  type: number
                              required:
                                - model
                                - calls
                                - tokens
                                - costUsd
                              additionalProperties: false
                          byDay:
                            type: array
                            items:
                              type: object
                              properties:
                                date:
                                  type: string
                                  pattern: ^\d{4}-\d{2}-\d{2}$
                                tokens:
                                  type: integer
                                  minimum: 0
                                  maximum: 9007199254740991
                                costUsd:
                                  type: number
                              required:
                                - date
                                - tokens
                                - costUsd
                              additionalProperties: false
                        required:
                          - days
                          - totals
                          - byModel
                          - byDay
                        additionalProperties: false
                      - type: 'null'
                  error:
                    anyOf:
                      - type: object
                        properties:
                          code:
                            type: string
                          message:
                            type: string
                          field:
                            type: string
                          details: {}
                        required:
                          - code
                          - message
                        additionalProperties: false
                      - type: 'null'
                required:
                  - data
                  - error
                additionalProperties: false
        default:
          description: >-
            Error envelope `{data: null, error: {code, message, field?,
            details?}}`.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or OAuth access token.
    sessionCookie:
      type: apiKey
      in: cookie
      name: sc_session

````