---
title: "Get AI usage metrics"
method: GET
path: "/ai/usage/{appId}"
tags: ["AI Services"]
---

# Get AI usage metrics

`GET /ai/usage/{appId}`

## Request

- Base URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api`
- URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api/ai/usage/{appId}`
- Auth: HTTP bearer

Retrieve the last 30 days of AI usage for the specified application, including token, cost, and request counts.

Admin access required.

## Path parameters

- `appId` string, required

## Response `200`

Usage metrics retrieved

- object
  - `appId` string
  - `totals` object
    - `textRequests` integer
    - `imageRequests` integer
    - `avgDurationMs` number
    - `estimatedSpendUsd` number
  - `daily` object[]
    - `date` string
    - `textRequests` integer
    - `imageRequests` integer
    - `spendUsd` number

## Other responses

- `401`: Missing or invalid authentication token
- `403`: Insufficient permissions or tier
- `500`: Failed to aggregate usage data

---

[API](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api.md) · [All operations](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/revisions/53e075911af9?raw)
