Get your Exa API key
Overview
The Get API Key Usage endpoint allows you to retrieve detailed billing and usage analytics for a specific API key over a given time period. This endpoint returns cost data from Exa’s billing system, providing an authoritative view of what you’re being billed for that API key.Path Parameters
- id: The unique identifier of the API key to retrieve usage for
Query Parameters
- start_date (optional): Start date for the usage period in ISO 8601 format (e.g.,
2025-01-01T00:00:00Zor2025-01-01). Defaults to 30 days ago. Must be within the last 100 days. - end_date (optional): End date for the usage period in ISO 8601 format. Defaults to the current time.
- group_by (optional): Time granularity for grouping results (
hour,day, ormonth). Currently reserved for future enhancements and does not change the response shape. Defaults today.
Response
Returns detailed usage and billing information including:- api_key_id: Unique identifier of the API key
- api_key_name: Descriptive name of the API key (if set)
- team_id: Team ID this key belongs to
- period: Object containing the start and end dates of the usage period
- total_cost_usd: Total cost in USD for the specified period
- cost_breakdown: Array of cost breakdowns by price type, each containing:
- price_id: Unique identifier for the price
- price_name: Name of the price (e.g., “Neural Search”, “Content Retrieval”)
- quantity: Total quantity consumed
- amount_usd: Cost in USD for this price type
- metadata: Object containing report generation timestamp
Important Notes
- 100-Day Lookback Limit: The billing system has a 100-day lookback limit. Requests with
start_dateolder than 100 days will return a 400 error. - Zero Usage: If the API key has no usage in the requested period,
total_cost_usdwill be 0 andcost_breakdownmay be empty. - Team Ownership: The service API key used for authentication must belong to the same team as the requested API key. Cross-team access is not permitted.
- Date Formats: Dates can be provided in ISO 8601 format with or without time components (e.g.,
2025-01-01or2025-01-01T00:00:00Z).
Use Cases
This endpoint is useful for:- Building API-key-level billing dashboards
- Monitoring usage and costs for specific API keys
- Creating automated alerts based on usage thresholds
- Generating usage reports for internal cost allocation
- Debugging billing questions for specific API keys
Authorizations
Service API key for team authentication
Path Parameters
The unique identifier of the API key
Query Parameters
Start date for the usage period (ISO 8601 format). Defaults to 30 days ago. Must be within the last 100 days.
End date for the usage period (ISO 8601 format). Defaults to current time.
Time granularity for grouping results. Currently reserved for future enhancements and does not change the response shape. Defaults to 'day'.
Available options:
hour, day, month Response
Usage data retrieved successfully

