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

> ## Agent Instructions
> ## Agent Instructions (AIsa)
>
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Paid calls need approval first. Docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP discovery are free to read. Before any paid, dynamically priced, or high-cost call, state the exact scope, rate, and maximum USD exposure, then wait for a separate user message approving that scope and cap. A request to collect data is not approval; do not send unapproved probes. Full rule: https://aisa.one/docs/llms.txt

# Account Usage

> Read aggregate usage through the existing account API contract.

Use the declared scope and time parameters below to request aggregate usage.
See [Usage and Logs](https://aisa.one/docs/guides/dashboard/overview#usage-and-logs)
for the Console workflow and per-request records.

## Request contract

* **Method and path:** GET /usage
* **Request URL template:** [https://api.aisa.one/v1/usage](https://api.aisa.one/v1/usage)
* **start\_time:** query; required
* **end\_time:** query; optional

[Complete OpenAPI definition](https://aisa.one/docs/openapi/account.json)

Effective request and pricing declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "accountUsage",
  "method": "GET",
  "path": "/usage",
  "servers": [
    {
      "url": "https://api.aisa.one/v1"
    }
  ],
  "parameters": [
    {
      "name": "start_time",
      "in": "query",
      "required": true,
      "description": "Window start as a Unix timestamp in seconds.",
      "schema": {
        "type": "integer",
        "format": "int64"
      }
    },
    {
      "name": "end_time",
      "in": "query",
      "required": false,
      "description": "Window end as a Unix timestamp in seconds. Defaults to the current time.",
      "schema": {
        "type": "integer",
        "format": "int64"
      }
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "AISA API Key or OAuth access token"
      }
    }
  }
}
```


## OpenAPI

````yaml openapi/account.json GET /usage
openapi: 3.0.3
info:
  title: AIsa Account & Usage API
  version: 1.0.0
  description: >-
    Programmatic account endpoints for balance and usage monitoring. Both accept
    an AIsa API key (Bearer) or an OAuth access token, so unattended production
    callers can read balance and usage for cost monitoring and alerting.


    All monetary values are integer micro-USD (1 USD = 1,000,000 micros).
servers:
  - url: https://api.aisa.one/v1
security:
  - BearerAuth: []
paths:
  /usage:
    get:
      summary: Account Usage
      description: >-
        Return request and spend usage over a time window, split into daily
        buckets. Accepts either an API key or an OAuth access token. The scope
        reflects the credential used (e.g. a single key vs the whole account).
      operationId: accountUsage
      parameters:
        - name: start_time
          in: query
          required: true
          description: Window start as a Unix timestamp in seconds.
          schema:
            type: integer
            format: int64
        - name: end_time
          in: query
          required: false
          description: >-
            Window end as a Unix timestamp in seconds. Defaults to the current
            time.
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Usage totals and per-day buckets over the window.
          content:
            application/json:
              example:
                scope: key
                currency: USD
                start_time: 1785513600
                end_time: 1787760000
                bucket_width: 1d
                totals:
                  requests: 1162
                  failed_requests: 401
                  input_tokens: 206393
                  output_tokens: 5031
                  cache_read_tokens: 0
                  cache_write_tokens: 0
                  usage_value_micros_usd: 128398109
                  charged_micros_usd: 128398109
                buckets:
                  - start_time: 1785513600
                    end_time: 1785600000
                    requests: 42
                    failed_requests: 3
                    input_tokens: 8123
                    output_tokens: 210
                    cache_read_tokens: 0
                    cache_write_tokens: 0
                    usage_value_micros_usd: 5123400
                    charged_micros_usd: 5123400
              schema:
                type: object
                properties:
                  scope:
                    type: string
                    description: >-
                      Aggregation scope implied by the credential (e.g. key or
                      account).
                  currency:
                    type: string
                    description: ISO currency code (always USD).
                  start_time:
                    type: integer
                    format: int64
                    description: Echoed window start (Unix seconds).
                  end_time:
                    type: integer
                    format: int64
                    description: Echoed window end (Unix seconds).
                  bucket_width:
                    type: string
                    description: Bucket granularity (e.g. 1d).
                  totals:
                    type: object
                    description: Aggregate totals across the whole window.
                    properties:
                      requests:
                        type: integer
                        format: int64
                      failed_requests:
                        type: integer
                        format: int64
                      input_tokens:
                        type: integer
                        format: int64
                      output_tokens:
                        type: integer
                        format: int64
                      cache_read_tokens:
                        type: integer
                        format: int64
                      cache_write_tokens:
                        type: integer
                        format: int64
                      usage_value_micros_usd:
                        type: integer
                        format: int64
                        description: Metered value of usage in micro-USD.
                      charged_micros_usd:
                        type: integer
                        format: int64
                        description: Amount actually charged in micro-USD.
                  buckets:
                    type: array
                    description: Per-bucket usage, ordered by time.
                    items:
                      type: object
                      properties:
                        start_time:
                          type: integer
                          format: int64
                        end_time:
                          type: integer
                          format: int64
                        requests:
                          type: integer
                          format: int64
                        failed_requests:
                          type: integer
                          format: int64
                        input_tokens:
                          type: integer
                          format: int64
                        output_tokens:
                          type: integer
                          format: int64
                        cache_read_tokens:
                          type: integer
                          format: int64
                        cache_write_tokens:
                          type: integer
                          format: int64
                        usage_value_micros_usd:
                          type: integer
                          format: int64
                        charged_micros_usd:
                          type: integer
                          format: int64
        '400':
          description: >-
            Invalid or missing time window (e.g. start_time not a positive Unix
            timestamp).
          content:
            application/json:
              example:
                error: start_time must be a positive Unix timestamp
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: AISA API Key or OAuth access token

````

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