Casama AI Usage API

The usage API from Casama AI, for usage.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 1

GET /v1/usage Get usage #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/casama-ai:casama-ai-usage-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

casama-ai-usage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Casama Usage API
  version: 0.1.0
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://api.casama.ai
tags:
- name: Usage
paths:
  /v1/usage:
    get:
      operationId: getUsage
      tags:
      - Usage
      security:
      - bearerAuth: []
      parameters:
      - schema:
          type: string
          format: uuid
        required: true
        name: org_id
        in: query
      - schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
        required: false
        name: period
        in: query
      - schema:
          type: string
          format: uuid
        required: false
        name: bot_id
        in: query
      - schema:
          type: string
          minLength: 1
          maxLength: 200
        required: false
        name: model
        in: query
      - schema:
          $ref: '#/components/schemas/UsageSource'
        required: false
        name: source
        in: query
      - schema:
          type: string
          format: uuid
        required: false
        name: user_id
        in: query
      responses:
        '200':
          description: Usage and cost by bot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReport'
        '401':
          description: Not authenticated
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        '404':
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      summary: Get usage
      x-summary-source: derived
components:
  schemas:
    UsageReport:
      type: object
      properties:
        period:
          type: string
          enum:
          - day
          - week
          - month
          - year
        since:
          type: string
          format: date-time
        total_cost_usd:
          type: number
        by_bot:
          type: array
          items:
            type: object
            properties:
              bot_id:
                type:
                - string
                - 'null'
                format: uuid
              name:
                type:
                - string
                - 'null'
              cost_usd:
                type: number
              tokens_in:
                type: integer
              tokens_out:
                type: integer
            required:
            - bot_id
            - name
            - cost_usd
            - tokens_in
            - tokens_out
        by_day:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
              cost_usd:
                type: number
              tokens_in:
                type: integer
              tokens_out:
                type: integer
            required:
            - day
            - cost_usd
            - tokens_in
            - tokens_out
        by_model:
          type: array
          items:
            type: object
            properties:
              model:
                type:
                - string
                - 'null'
              cost_usd:
                type: number
              tokens_in:
                type: integer
              tokens_out:
                type: integer
            required:
            - model
            - cost_usd
            - tokens_in
            - tokens_out
        by_kind:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
              quantity:
                type: number
              cost_usd:
                type: number
            required:
            - kind
            - quantity
            - cost_usd
        by_source:
          type: array
          items:
            type: object
            properties:
              source:
                $ref: '#/components/schemas/UsageSource'
              cost_usd:
                type: number
              runs:
                type: integer
            required:
            - source
            - cost_usd
            - runs
        runs:
          type: integer
        by_person:
          type: array
          items:
            type: object
            properties:
              user_id:
                type:
                - string
                - 'null'
                format: uuid
              name:
                type:
                - string
                - 'null'
              cost_usd:
                type: number
              runs:
                type: integer
            required:
            - user_id
            - name
            - cost_usd
            - runs
        waived_usd:
          type: number
      required:
      - period
      - since
      - total_cost_usd
      - by_bot
    UsageSource:
      type: string
      enum:
      - chat
      - chat_app
      - routine
      - api
      - other
    Problem:
      type: object
      properties:
        type:
          type: string
          example: https://casama.ai/problems/not_found
        title:
          type: string
        status:
          type: integer
        code:
          type: string
          description: Stable error code
          example: not_found
        detail:
          type: string
        instance:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
            - path
            - message
          description: Field errors for validation_failed
      required:
      - type
      - title
      - status
      - code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Supabase access token