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

# API Usage

> Monitor API requests, tokens, and costs.

The **Usage** dashboard tracks your API consumption, helping you monitor requests, tokens, and costs.

## Accessing Usage

**1. Open Gloo AI Studio**

Log in to [Gloo AI Studio](https://studio.ai.gloo.com).

**2. Choose your organization**

Select your [organization](https://docs.gloo.com/getting-started/glossary.md#organization) from the organization switcher.

**3. Open Usage**

Click **Usage** in the Build section of the main navigation.

## Available Metrics

| Metric | What it shows |
| :- | :- |
| **API Requests** | Total number of API calls made to Gloo AI services |
| **Token Usage** | Prompt tokens (input sent to the API), completion tokens (output generated by the API), and total tokens (combined) |
| **Cost/Spend** | Actual costs incurred based on your API usage |
| **Date Ranges** | View usage over custom time periods (day, week, month, or custom range) |

> [!TIP]
>
> Shorter prompts and responses consume fewer tokens and cost less. Review usage regularly to spot optimization opportunities.

## Filtering Usage Data

| Filter | How to use it |
| :- | :- |
| **By Organization** | If you're an admin with access to multiple organizations, select one in the organization filter dropdown to see only that organization's usage and costs. |
| **By API Key** | Filter usage by a specific API key to see which applications or integrations are consuming resources. Click the **API Credentials** filter button, then select one or more keys by name in the **Select API Keys** dropdown. |
| **By Client ID** (legacy) | If your organization still uses OAuth2 [client credentials](https://docs.gloo.com/tutorials/authentication.md#legacy-client-credentials-and-oauth), you can also filter by Client ID. |
| **By View (Spend, Requests or Tokens)** | Use the **View by** selector to switch between **Spend**, **Requests** (the number of API calls over time) and **Tokens** (input, output and cache tokens). |
| **By Date Range** | Use the **Date Range** selector to choose a preset or custom range. |

**When this is useful:** Track usage per application, environment (development vs. production), or team to identify optimization opportunities.

## API Usage by Capability

The Usage dashboard also breaks usage down by capability (Models, Chat, etc.), showing which features drive your consumption.

## Understanding Your API Usage

### Request Counts

Each call to the Gloo AI API counts as one request, regardless of the size of the input or output. Requests are tracked by:

* Endpoint called (e.g., Chat, Recommendations)
* Timestamp
* API key used
* Response status (success or error)

Use request counts to understand your application's call patterns and identify peak usage times.

### Token Metrics

Tokens are the units of text AI models process:

* **Input Tokens:** The number of tokens in your input to the API (your request, context, and system messages)
* **Output Tokens:** The number of tokens in the API's response (the generated text)
* **Cache Tokens:** Input tokens read from or written to a [prompt cache](https://docs.gloo.com/api-guides/prompt-caching.md), billed at cache rates

Pricing is typically based on tokens, and output tokens often cost more than input tokens.

> [!NOTE]
>
> Different models have different token costs. See the [Models](https://docs.gloo.com/studio/models.md) page in Studio, or `GET /platform/v2/models`, for current rates.

### Cost Tracking

The Usage dashboard shows costs from actual API usage:

* **Daily costs:** Total spend per day
* **Weekly totals:** Spend over the past week
* **Monthly totals:** Cumulative spend for the billing period

How those costs are tracked depends on how your organization pays:

| Account type | How costs are tracked |
| :- | :- |
| **Organizations on prepaid credits** | Costs draw down your balance, and are tracked against your organization's monthly API spend limit (\$4,000 per month unless Gloo has set a different one). The Usage page shows a **Monthly API spend limit** card with your spend this month against the limit; it resets on the 1st (UTC). [Gloo Code](https://docs.gloo.com/gloocode/overview.md) usage does not count toward it. See [Prepaid Credits](https://docs.gloo.com/studio/prepaid-credits.md). |
| **Gloo Code subscriptions** | The Usage page shows how much of the current month's Gloo Code allowance has been used, as a percentage. Gloo Code usage is covered by the tier's allowance and top-ups, not by prepaid credits. |
| **Legacy Pay-as-you-go and Pro accounts** | Costs are tracked against your editable weekly or monthly spend limit. You'll see warnings as you approach your limit. |
| **Enterprise accounts** | Costs contribute to your monthly invoice total. |

## Rate Limits vs. Spend Limits

| Limit | What it controls |
| :- | :- |
| **Rate Limits** | How quickly you can make API requests (requests per minute/hour). See the [API Reference](https://docs.gloo.com/api-reference/general/limits.md) for current rate limits. |
| **Spend Limits** | How much you can spend in a period. Organizations on prepaid credits have a monthly API spend limit that Gloo sets (\$4,000 per month by default); legacy Pay-as-you-go and Pro accounts have an editable weekly or monthly limit. When you hit the limit, API access pauses until it resets. |

Rate limits control request speed. Spend limits control spending. See [Billing & Plans](https://docs.gloo.com/studio/billing.md#spend-limits) for details.

## Frequently Asked Questions

> [accordion] How often is usage data updated?
>
> Usage data updates in near real time, typically within a few minutes of each call. Some aggregated metrics (like daily totals) may take up to an hour to fully update.

> [accordion] Can I export usage data?
>
> Self-serve accounts can view usage in the dashboard. Enterprise accounts can export detailed reports; contact your account manager for options.

> [accordion] How far back can I view historical data?
>
> The dashboard keeps your historical API usage. Enterprise accounts can ask their account manager about extended history and exports.

## Next steps

To bring these numbers down and see which feature drives them, read [Controlling Cost](https://docs.gloo.com/best-practices/cost-control.md#track-spend-and-set-a-ceiling).

> [card] [Billing & Plans](https://docs.gloo.com/studio/billing.md)
>
> Products, tiers, and spend limits.

> [card] [Prepaid Credits](https://docs.gloo.com/studio/prepaid-credits.md)
>
> Add credits and set up auto-refill.

> [card] [Generate API Keys](https://docs.gloo.com/studio/manage-api-credentials.md)
>
> Create keys for your integrations.


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