---
canonical_url: "https://docs.composio.dev/reference/api-reference/projects/postProjectUsageSummary"
markdown_url: "https://docs.composio.dev/reference/api-reference/projects/postProjectUsageSummary.md"
product: "platform"
version: "3.1"
last_updated: null
---

# Project usage summary

**Documentation:** /reference/api-reference/projects/postProjectUsageSummary

> **API version:** This page documents Composio REST API v3.1, the current version, at `https://backend.composio.dev/api/v3.1`. `https://backend.composio.dev/api/v3` is the previous version and remains supported.

Aggregated metering usage for the authenticated project only. Values are summed from raw metering events grouped by `entity_type`.

---

## POST `/api/v3.1/project/usage/summary`

**Endpoint:** `https://backend.composio.dev/api/v3.1/project/usage/summary`

**Summary:** Project usage summary

Aggregated metering usage for the authenticated project only. Values are summed from raw metering events grouped by `entity_type`.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key`

### Request Body

**Schema:**

- `from` (number): Inclusive range start (Unix epoch milliseconds). Defaults to 30 days before `to`.
- `to` (number): Exclusive range end (Unix epoch milliseconds). Defaults to now.
- `entity_types` (array<string>): Filter to these metering entity types. Omit for all types.
- `filters` (object)
  - `user_id` (array,null): Filter to events matching these external end-user IDs. OR logic within the array.
  - `session_id` (array,null): Filter to events matching these session IDs. OR logic within the array.

**Example:**

```json
{
  "from": 1,
  "to": 1,
  "entity_types": [
    "string"
  ],
  "filters": {
    "user_id": null,
    "session_id": null
  }
}
```

### Responses

#### 200 - Usage aggregates for the project.

**Response Schema:**

- `entities` (object) *(required)*
  - `[key: string]` (object)
    - `unit` (string) *(required)*
    - `total_quantity` (string) *(required)*
    - `event_count` (integer) *(required)*
- `instant_charge` (string) *(required)*: Total Instant charge over this window, as an exact USD amount. Zero when nothing in it was charged.

**Example Response:**

```json
{
  "entities": {
    "key": {
      "unit": "string",
      "total_quantity": "string",
      "event_count": 0
    }
  },
  "instant_charge": "string"
}
```

#### 400 - Invalid time range, entity_types, or query parameters.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Authentication required.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 403 - Forbidden.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - Project not found.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Failed to load usage from analytics store or feature configuration.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example requests

Python uses `requests`; TypeScript uses Node.js fetch. Replace sample IDs and values before sending these requests.

Set `COMPOSIO_API_KEY` before running these requests.

#### Python

```python
import os
import requests
import json

response = requests.request("POST", "https://backend.composio.dev/api/v3.1/project/usage/summary",
    headers={"Content-Type": "application/json", "x-api-key": os.environ["COMPOSIO_API_KEY"]},
    json=json.loads("{\"from\":1,\"to\":1,\"entity_types\":[\"string\"],\"filters\":{\"user_id\":null,\"session_id\":null}}"))
response.raise_for_status()
print(response.text)
```

#### TypeScript

```typescript
const response = await fetch("https://backend.composio.dev/api/v3.1/project/usage/summary", {
  method: "POST",
  headers: { "Content-Type": "application/json", "x-api-key": process.env["COMPOSIO_API_KEY"]! },
  body: JSON.stringify({
  "from": 1,
  "to": 1,
  "entity_types": [
    "string"
  ],
  "filters": {
    "user_id": null,
    "session_id": null
  }
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.text());
```

#### API

```bash
curl -X POST "https://backend.composio.dev/api/v3.1/project/usage/summary" \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": 1,
    "to": 1,
    "entity_types": [
      "string"
    ],
    "filters": {
      "user_id": null,
      "session_id": null
    }
  }'
```

---

## REST API version

The current REST API version is **v3.1**, served at `https://backend.composio.dev/api/v3.1`. Prefer it for new code and new examples.

`https://backend.composio.dev/api/v3` is the previous version. It is frozen with pinned tool-version defaults and remains supported — existing v3 integrations keep working and do not need to migrate.