Pricing, specs, and capabilities for AI models across all major providers. No authentication required.
No authentication is required. All endpoints are open and free to use without an API key.
Optionally authenticate to track usage:
Authorization: Bearer sk_live_your_api_key
| Feature | Access |
|---|---|
| Requests | Unlimited |
| Pricing data | Yes |
| Model specs (context, capabilities, modalities) | Yes |
| API IDs (native, bedrock, vertex) | Yes |
| Max page size | 100 |
| Data freshness | Real-time |
Standard HTTP status codes. Errors return JSON:
{
"error": {
"code": "model_not_found",
"message": "Model 'gpt-5' not found in provider 'openai'",
"details": {
"available_models": ["gpt-4o", "gpt-4-turbo", "..."]
}
}
}
| Code | Description |
|---|---|
400 |
Bad request — invalid parameters |
401 |
Unauthorized — missing or invalid API key |
404 |
Not found — resource doesn't exist |
429 |
Rate limited — too many requests |
500 |
Server error |
Returns all models with pricing and capabilities. Supports filtering by provider.
openai, anthropic)curl https://api.subquery.ai/v1/models?provider=openai
const response = await fetch(
'https://api.subquery.ai/v1/models?provider=openai'
);
const data = await response.json();
import requests
response = requests.get(
'https://api.subquery.ai/v1/models',
params={'provider': 'openai'}
)
data = response.json()
{
"data": [
{
"id": "gpt-4o",
"provider": "openai",
"name": "GPT-4o",
"context_window": 128000,
"max_output_tokens": 16384,
"capabilities": ["vision", "function_calling", "json_mode"],
"pricing": {
"standard": {
"input": 2.50,
"output": 10.00,
"unit": "1M tokens"
}
}
}
],
"meta": {
"total": 200,
"limit": 20,
"offset": 0
}
}
Returns detailed information for a specific model including full pricing tiers, capabilities, and specs.
openai, anthropic, google,
mistral, xai, groq, fireworks,
deepseek, together, cohere, perplexity,
bedrock
gpt-4o, claude-3-opus-20240229)
curl https://api.subquery.ai/v1/models/anthropic/claude-3-opus-20240229
{
"data": {
"id": "claude-3-opus-20240229",
"provider": "anthropic",
"name": "Claude 3 Opus",
"description": "Most powerful model for complex tasks",
"context_window": 200000,
"max_output_tokens": 4096,
"knowledge_cutoff": "2023-08",
"capabilities": ["vision", "function_calling", "json_mode"],
"modalities": {
"input": ["text", "image"],
"output": ["text"]
},
"api_ids": {
"native": "claude-3-opus-20240229",
"bedrock": "anthropic.claude-3-opus-20240229-v1:0",
"vertex": "claude-3-opus@20240229"
},
"aliases": ["claude-3-opus"],
"deprecated": false,
"pricing": {
"standard": {
"input": 15.00,
"output": 75.00,
"unit": "1M tokens"
},
"batch": {
"input": 7.50,
"output": 37.50
}
}
}
}
Returns all available providers with model counts.
{
"data": [
{ "id": "openai", "name": "OpenAI", "model_count": 45 },
{ "id": "anthropic", "name": "Anthropic", "model_count": 12 },
{ "id": "google", "name": "Google", "model_count": 18 },
{ "id": "mistral", "name": "Mistral", "model_count": 15 },
{ "id": "xai", "name": "xAI", "model_count": 8 },
{ "id": "groq", "name": "Groq", "model_count": 8 },
{ "id": "fireworks", "name": "Fireworks", "model_count": 24 },
{ "id": "deepseek", "name": "DeepSeek", "model_count": 4 },
{ "id": "together", "name": "Together AI", "model_count": 30 },
{ "id": "cohere", "name": "Cohere", "model_count": 6 },
{ "id": "perplexity", "name": "Perplexity", "model_count": 5 },
{ "id": "bedrock", "name": "AWS Bedrock", "model_count": 20 }
]
}
Calculate the cost of an API call. Accepts raw API responses or usage objects — provider is auto-detected from the usage format.
standard, batch)curl -X POST https://api.subquery.ai/v1/calculate \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"usage": { "input_tokens": 1000, "output_tokens": 500 }
}'
Pass an entire API response — we extract model and usage:
curl -X POST https://api.subquery.ai/v1/calculate \
-H "Content-Type: application/json" \
-d '{
"id": "resp_123",
"model": "gpt-4o-2024-08-06",
"usage": {
"input_tokens": 500,
"input_tokens_details": { "cached_tokens": 100 },
"output_tokens": 1000,
"output_tokens_details": { "reasoning_tokens": 200 }
}
}'
{
"data": {
"provider": "openai",
"model": "gpt-4o",
"total_cost": 0.0075,
"currency": "usd",
"breakdown": { "input": 0.0025, "output": 0.005 },
"detected": {
"provider": "openai",
"model": "gpt-4o",
"usage_type": "tokens"
}
}
}
Provider is auto-detected from the usage structure. All official SDK formats are supported:
| Provider | Usage Fields |
|---|---|
| OpenAI | prompt_tokens, completion_tokens + cached_tokens,
reasoning_tokens
|
| Anthropic | input_tokens, output_tokens + cache_creation_input_tokens,
cache_read_input_tokens
|
prompt_token_count, candidates_token_count +
cached_content_token_count
|
|
| Mistral | prompt_tokens, completion_tokens + prompt_audio_seconds
|
| xAI | prompt_tokens, completion_tokens + cached_tokens,
reasoning_tokens
|
| Groq | prompt_tokens, completion_tokens + prompt_time,
completion_time
|
| Fireworks | prompt_tokens, completion_tokens + cached_tokens |
| DeepSeek | prompt_tokens, completion_tokens + prompt_cache_hit_tokens
|
| Together | prompt_tokens, completion_tokens |
| Cohere | input_tokens, output_tokens + search_units |
| Perplexity | prompt_tokens, completion_tokens + citation_tokens |
| Bedrock | inputTokens, outputTokens (or snake_case) |
Returns recent changes to models, pricing, and providers.
{
"data": [
{
"version": "2024.01.15.001",
"change_type": "model_added",
"provider": "openai",
"entity_id": "gpt-4.5-preview",
"summary": "New model added",
"created_at": "2024-01-15T12:00:00Z"
}
]
}
List historical catalog versions. Each sync creates a new version.
{
"data": [
{
"version": "2024.01.15.001",
"created_at": "2024-01-15T12:00:00Z",
"model_count": 127,
"provider_count": 5
}
]
}
Get full catalog snapshot at a specific version. Use latest for
current data.
Check API health and get current pricebook/catalog info.
{
"data": {
"status": "ok",
"uptime_seconds": 86400,
"pricebook": {
"version": "2024.01.15.003"
},
"catalog": {
"version": "2024.01.15.001",
"model_count": 127
}
}
}
The API is rate limited to 60 requests per minute per IP address. Rate limit headers are included in all responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705363260
If you exceed the limit, you'll receive a 429 response. Wait until the reset time before
retrying.
The API is versioned via the URL path (/v1/). Backwards compatibility is maintained within major
versions.
Data versions (pricebook and catalog) are separate from API versions. Each sync creates a new data version, allowing you to query historical snapshots.