---
title: "Get AI Cost Summary"
method: GET
path: "/ai/costs"
tags: ["Costs"]
---

# Get AI Cost Summary

`GET /ai/costs`

## Request

- Base URL: `https://synchronex.ai/api/v1`
- URL: `https://synchronex.ai/api/v1/ai/costs`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://synchronex.ai/oauth/authorize`, token URL `https://synchronex.ai/api/oauth/token`, scopes: `read`)

Returns AI usage cost totals. Requires Pro or Managed tier.

## Query parameters

- `days` integer

## Response `200`

Cost summary.

- CostSummary
  - `total_cost_usd` number
  - `total_tokens` object
    - `input` integer
    - `output` integer
  - `by_model` object[]
  - `by_day` object[]
  - `period_days` integer
  - `event_count` integer

## Other responses

- `401`: Unauthorized. Missing, malformed, expired, or revoked bearer token.
- `403`: Forbidden. The token scope or account tier is insufficient.
- `429`: Rate limit exceeded. Retry after the indicated reset time.

---

[API](https://skmtc.dev/synchronex/apis/synchronex-api.md) · [All operations](https://skmtc.dev/synchronex/apis/synchronex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/synchronex/apis/synchronex-api/revisions/aa1e0df0a8d5?raw)
