๐ Portkey raises Series A - $15M to build AI that never breaks ย Read announcement โ
curl --request GET \
--url https://api.portkey.ai/model-configs/pricing/{provider}/{model}{
"pay_as_you_go": {
"request_token": {
"price": 123
},
"response_token": {
"price": 123
},
"cache_read_input_token": {
"price": 123
},
"cache_write_input_token": {
"price": 123
},
"request_audio_token": {
"price": 123
},
"response_audio_token": {
"price": 123
},
"additional_units": {},
"image": {}
},
"calculate": {
"request": {},
"response": {}
},
"currency": "<string>",
"finetune_config": {
"pay_per_token": {},
"pay_per_hour": {}
},
"params": [
{
"key": "<string>",
"defaultValue": "<any>",
"minValue": 123,
"maxValue": 123,
"type": "<string>",
"options": [
{}
]
}
],
"type": {
"primary": "<string>",
"supported": [
{}
]
},
"messages": {
"options": [
{}
]
},
"disablePlayground": true,
"isDefault": true,
"{model-id}": {
"pricing_config": {}
}
}Open-source pricing and configuration database for 2,300+ LLMs across 35+ providers
curl --request GET \
--url https://api.portkey.ai/model-configs/pricing/{provider}/{model}{
"pay_as_you_go": {
"request_token": {
"price": 123
},
"response_token": {
"price": 123
},
"cache_read_input_token": {
"price": 123
},
"cache_write_input_token": {
"price": 123
},
"request_audio_token": {
"price": 123
},
"response_audio_token": {
"price": 123
},
"additional_units": {},
"image": {}
},
"calculate": {
"request": {},
"response": {}
},
"currency": "<string>",
"finetune_config": {
"pay_per_token": {},
"pay_per_hour": {}
},
"params": [
{
"key": "<string>",
"defaultValue": "<any>",
"minValue": 123,
"maxValue": 123,
"type": "<string>",
"options": [
{}
]
}
],
"type": {
"primary": "<string>",
"supported": [
{}
]
},
"messages": {
"options": [
{}
]
},
"disablePlayground": true,
"isDefault": true,
"{model-id}": {
"pricing_config": {}
}
}Documentation Index
Fetch the complete documentation index at: https://portkey-docs-log-export-guide-1773064217.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
curl https://api.portkey.ai/model-configs/pricing/openai/gpt-4o
curl https://configs.portkey.ai/pricing/{provider}.json
| API Response | Per 1K Tokens | Per 1M Tokens |
|---|---|---|
0.003 | $0.03 | $30 |
0.00025 | $0.0025 | $2.50 |
0.0001 | $0.001 | $1.00 |
const costInDollars = (tokens * priceFromAPI) / 100;
GET https://api.portkey.ai/model-configs/pricing/{provider}/{model}
openai, anthropic, google, azure-openai, bedrock, together-ai, groq, deepseek, x-ai, mistral-ai, cohere, fireworks-ai, perplexity-ai, anyscale, deepinfra, cerebrasgpt-4o, gpt-4-turbo, claude-3-5-sonnet-20241022, claude-3-opus-20240229, gemini-2.0-flash-001, gemini-1.5-proShow properties
Show properties
0.00025 = $0.0025 per 1K tokensShow properties
Show properties
Show properties
Show properties
Show properties
web_search โ Web search tool usagefile_search โ File search tool usagethinking_token โ Chain-of-thought reasoning tokensimage_token โ Image generation/processingvideo_duration_seconds_* โ Video generation (by resolution){ "quality": { "resolution": { "price": number } } }USD.{
"pay_as_you_go": {
"request_token": { "price": 0.00025 },
"response_token": { "price": 0.001 },
"cache_write_input_token": { "price": 0 },
"cache_read_input_token": { "price": 0.000125 },
"additional_units": {
"web_search": { "price": 1 },
"file_search": { "price": 0.25 }
}
},
"calculate": {
"request": {
"operation": "sum",
"operands": [
{ "operation": "multiply", "operands": [{ "value": "input_tokens" }, { "value": "rates.request_token" }] },
{ "operation": "multiply", "operands": [{ "value": "cache_write_tokens" }, { "value": "rates.cache_write_input_token" }] },
{ "operation": "multiply", "operands": [{ "value": "cache_read_tokens" }, { "value": "rates.cache_read_input_token" }] }
]
},
"response": {
"operation": "multiply",
"operands": [{ "value": "output_tokens" }, { "value": "rates.response_token" }]
}
},
"currency": "USD"
}
GET https://api.portkey.ai/model-configs/general/{provider}/{model}
openai, anthropic, google)gpt-4o, claude-3-opus)Show item properties
max_tokens, temperature, top_p)boolean, string, array-of-strings)Show properties
system, user, assistant, developertrue, model is not available in Portkey playground.true, this is the default model for the provider.{
"params": [
{
"key": "max_tokens",
"maxValue": 16384
},
{
"key": "response_format",
"defaultValue": null,
"options": [
{ "value": null, "name": "Text" },
{ "value": "json_object", "name": "JSON Object" },
{ "value": "json_schema", "name": "JSON Schema" }
],
"type": "string"
},
{
"key": "temperature",
"minValue": 0,
"maxValue": 2,
"defaultValue": 1
}
],
"type": {
"primary": "chat",
"supported": ["tools", "image"]
}
}
GET https://configs.portkey.ai/pricing/{provider}.json
openai, anthropic, google, bedrock, azure-openai, together-ai, groq, deepseek, x-ai, mistral-aipricing_config objects with the same structure as the individual model pricing endpointdefault key provides the base pricing templateShow properties
pay_as_you_go, calculate, currency, etc.curl --request GET \
--url https://configs.portkey.ai/pricing/bedrock.json
Sample Response (Bedrock)
{
"default": {
"pricing_config": {
"pay_as_you_go": {
"request_token": { "price": 0 },
"response_token": { "price": 0 }
},
"calculate": {
"request": {
"operation": "multiply",
"operands": [
{ "value": "input_tokens" },
{ "value": "rates.request_token" }
]
},
"response": {
"operation": "multiply",
"operands": [
{ "value": "output_tokens" },
{ "value": "rates.response_token" }
]
}
},
"currency": "USD"
}
},
"anthropic.claude-3-5-sonnet-20241022-v2:0": {
"pricing_config": {
"pay_as_you_go": {
"request_token": { "price": 0.0003 },
"response_token": { "price": 0.0015 },
"cache_write_input_token": { "price": 0.000375 },
"cache_read_input_token": { "price": 0.00003 }
}
}
},
"anthropic.claude-3-haiku-20240307-v1:0": {
"pricing_config": {
"pay_as_you_go": {
"request_token": { "price": 0.000025 },
"response_token": { "price": 0.000125 }
}
}
},
"meta.llama3-1-405b-instruct-v1:0": {
"pricing_config": {
"pay_as_you_go": {
"request_token": { "price": 0.000532 },
"response_token": { "price": 0.0016 }
}
}
},
"amazon.nova-pro-v1:0": {
"pricing_config": {
"pay_as_you_go": {
"request_token": { "price": 0.00008 },
"response_token": { "price": 0.00002 },
"cache_read_input_token": { "price": 0.00004 },
"cache_write_input_token": { "price": 0.00016 }
}
}
}
}
| Unit | Description | Providers | Price Range (ยข) |
|---|---|---|---|
web_search | Web search tool usage | OpenAI, Azure, Google, Vertex AI, Perplexity | 0.5 - 3.5 |
file_search | File search tool usage | OpenAI, Azure | 0.25 |
search | Google search grounding | Google, Vertex AI | 1.4 - 3.5 |
thinking_token | Chain-of-thought reasoning | Google, Vertex AI | 0.00004 - 0.0012 |
image_token | Image processing tokens | Google, Vertex AI | 0.003 |
image_1k | Image generation (1K units) | 3.9 | |
megapixels | Image generation by megapixel | Together AI | 0.0027 - 0.08 |
video_seconds | Video generation | Vertex AI | 10 - 50 |
video_duration_seconds_720_1280 | Video (720p) | OpenAI Sora | 10 - 30 |
video_duration_seconds_1080_1920 | Video (1080p) | OpenAI Sora | 50 |
routing_units | Azure OpenAI routing | Azure OpenAI | 0.000014 |
input_image | Image input | Vertex AI | 0.01 |
input_video_essential | Video input (essential) | Vertex AI | 0.05 |
input_video_standard | Video input (standard) | Vertex AI | 0.1 |
input_video_plus | Video input (plus) | Vertex AI | 0.2 |
Perplexity Context-Based Pricing
| Unit | Price (ยข) |
|---|---|
web_search_low_context | 0.5 - 0.6 |
web_search_medium_context | 0.8 - 1.0 |
web_search_high_context | 1.2 - 1.4 |
40+ providers supported
Was this page helpful?