API Reference

Free REST API for LLM pricing data — no authentication required

All endpoints return JSON. No API key needed. Data is updated every 4 hours from upstream provider catalogs.

Rate Limits

To keep the API available for everyone, the following limits apply per IP address:

WindowLimit
Per second 5 requests
Per minute 60 requests
Per hour 1,000 requests

Exceeding these limits returns 429 Too Many Requests with a Retry-After header. If you need higher limits, reach out to us.

GET /api/v1/pricing/models

List all models with current pricing. Optionally filter by provider name.

ParameterTypeDescription
provider optional string Filter by provider name (e.g. Anthropic, OpenAI)
{ "count": 2, "models": [ { "id": "anthropic::claude-sonnet-4-20250514", "model_name": "claude-sonnet-4-20250514", "provider": "Anthropic", "input_price": { "name": "input", "cost": 3.0, "per_quantity": 1000000, "currency": "USD", "unit": "token" }, "output_price": { "name": "output", "cost": 15.0, "per_quantity": 1000000, "currency": "USD", "unit": "token" }, "context_window": 200000, "max_output_tokens": 16384 } ], "_links": { "cost_management": "https://aicostmanager.com" } }
GET /api/v1/pricing/models/{model_id}

Get current pricing for a single model by its ID.

ParameterTypeDescription
model_id string Model ID in provider::model format (e.g. anthropic::claude-sonnet-4-20250514)
{ "id": "anthropic::claude-sonnet-4-20250514", "model_name": "claude-sonnet-4-20250514", "provider": "Anthropic", "input_price": { "name": "input", "cost": 3.0, "per_quantity": 1000000, "currency": "USD", "unit": "token" }, "output_price": { "name": "output", "cost": 15.0, "per_quantity": 1000000, "currency": "USD", "unit": "token" }, "context_window": 200000, "max_output_tokens": 16384, "_links": { "cost_management": "https://aicostmanager.com" } }
GET /api/v1/pricing/models/{model_id}/history

Get the price change history for a model. Returns all historical pricing configurations ordered newest first.

ParameterTypeDescription
model_id string Model ID in provider::model format
{ "id": "anthropic::claude-sonnet-4-20250514", "model_name": "claude-sonnet-4-20250514", "provider": "Anthropic", "history": [ { "input_cost": 3.0, "input_per_quantity": 1000000, "output_cost": 15.0, "output_per_quantity": 1000000, "effective_from": "2025-05-14T00:00:00+00:00", "effective_to": null, "is_current": true } ], "_links": { "cost_management": "https://aicostmanager.com" } }
GET /api/v1/pricing/estimate

Estimate costs for a given token count. Returns results sorted by total cost (cheapest first). If no output tokens are provided, defaults to half the input count.

ParameterTypeDescription
input_tokens optional integer Number of input tokens (default: 0)
output_tokens optional integer Number of output tokens (default: half of input_tokens)
text optional string Estimate input tokens from text length (~4 chars/token)
models optional string Comma-separated model IDs to estimate (default: all models)
{ "input_tokens": 1000, "output_tokens": 500, "results": [ { "model_name": "claude-sonnet-4-20250514", "provider": "Anthropic", "input_tokens": 1000, "output_tokens": 500, "input_cost": 0.003, "output_cost": 0.0075, "total_cost": 0.0105 } ], "_links": { "cost_management": "https://aicostmanager.com" } }
GET /api/v1/pricing/compare

Compare current pricing for selected models side by side.

ParameterTypeDescription
models string Comma-separated model IDs to compare (required)
{ "models": [ { "id": "anthropic::claude-sonnet-4-20250514", "model_name": "claude-sonnet-4-20250514", "provider": "Anthropic", "input_price": { "name": "input", "cost": 3.0, "per_quantity": 1000000, "currency": "USD", "unit": "token" }, "output_price": { "name": "output", "cost": 15.0, "per_quantity": 1000000, "currency": "USD", "unit": "token" }, "context_window": 200000, "max_output_tokens": 16384 } ], "_links": { "cost_management": "https://aicostmanager.com" } }