# Query Usage

Source: https://agenta.ai/docs/reference/api/query-wallet-usage

`POST /wallets/usage/query`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Query Usage

## Request body schema

Content type: `application/json`

- `start` (string (date-time), nullable)
- `end` (string (date-time), nullable)

## Response schemas

### 200: Successful Response

- `usage` (object, required)
  - `start` (string (date-time), required)
  - `end` (string (date-time), required)
  - `truncated` (boolean) Default: `false`.
  - `days` (array of object)
    - `day` (string (date), required)
    - `category` (string, required)
    - `amount_musd` (integer, required)
    - `charge_count` (integer, required)
  - `sessions` (array of object)
    - `session_id` (string, nullable)
    - `agent_id` (string (uuid), nullable)
    - `agent_name` (string, nullable)
    - `user_id` (string (uuid), nullable)
    - `user_email` (string, nullable)
    - `started_at` (string (date-time), required)
    - `last_at` (string (date-time), required)
    - `amount_musd` (integer, required)
    - `charge_count` (integer, required)
    - `charges` (array of object)
- … more fields: see the OpenAPI specification.

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
