There is no dedicated endpoint that returns a historical, day-by-day breakdown of your spend. Instead, the Swarms API exposes three complementary pieces: the current pricing model (
/v1/usage/costs), your raw request logs (/v1/account/logs), and an at-a-glance metrics summary (/v1/account/metrics/summary). Combine these client-side for a custom usage report — see each section below.Endpoint Information
- URL:
/v1/usage/costs - Method:
GET - Authentication: Required (
x-api-keyheader) - Rate Limiting: Subject to tier-based rate limits
Query Parameters
None. This endpoint always returns the current pricing model in effect.Code Examples
- Python
- TypeScript
- cURL
Response Schema
PricingDetailsOutput Object
usage_pricing Object
Example Response
Error Responses
Request Logs
GET /v1/account/logs returns your account’s full API request history — every logged request across all of your API keys (including revoked ones), excluding client IP information.
GET /v1/swarm/logs is a deprecated alias for the same endpoint, kept only for backwards compatibility. Use /v1/account/logs in new integrations.SwarmLogsOutput Object
Metrics Summary
GET /v1/account/metrics/summary returns an at-a-glance overview of your core usage metrics across all of your API keys.
GET /v1/metrics/summary is a deprecated alias for the same endpoint, kept only for backwards compatibility. Use /v1/account/metrics/summary in new integrations.MetricsSummaryOutput Object
Related Endpoints
For other account-level usage and spend tracking, use:Billable completion endpoints require your
total_credits balance to be above $1.00. This is checked before the request runs — if the balance is at or below the minimum, the API returns a 402 Payment Required error without doing any work. Use GET /v1/account/credits to monitor your balance.Related
- Get Credit Balance — check your current credit balance
- Pricing Details — see per-operation costs
- Rate Limits — check rate limit status