Create pricing override
Creates a new pricing override. The most specific matching scope always wins during cost resolution.
AuthorizationBearer <token>
Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT.
Virtual keys (prefixed with sk-bf-) can also be passed here.
In: header
namestring
Human-readable label
scope_kindstring
Value in
"global" | "provider" | "provider_key" | "virtual_key" | "virtual_key_provider" | "virtual_key_provider_key"virtual_key_id?string
Required for virtual_key* scopes
provider_id?string
Required for provider and virtual_key_provider scopes
provider_key_id?string
Required for provider_key and virtual_key_provider_key scopes
match_typestring
Value in
"exact" | "wildcard"patternstring
Model name or wildcard prefix ending with * (e.g. "claude-3*")
request_typesarray<PricingOverrideRequestType>
Request types this override applies to. At least one value is required.
Items
1 <= itemspatch?PricingPatch
Pricing fields to override. Only non-zero/non-null fields are applied. All values are cost per unit in USD.
Response Body
curl -X POST "https://loading/{AI_GATEWAY_URL}/api/governance/pricing-overrides" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "scope_kind": "global", "match_type": "exact", "pattern": "string", "request_types": [ "chat_completion" ] }'{
"message": "string",
"pricing_override": {
"id": "string",
"name": "string",
"scope_kind": "global",
"virtual_key_id": "string",
"provider_id": "string",
"provider_key_id": "string",
"match_type": "exact",
"pattern": "string",
"request_types": [
"chat_completion"
],
"pricing_patch": "string",
"patch": {
"input_cost_per_token": 0,
"output_cost_per_token": 0,
"input_cost_per_token_batches": 0,
"output_cost_per_token_batches": 0,
"input_cost_per_token_priority": 0,
"output_cost_per_token_priority": 0,
"input_cost_per_character": 0,
"input_cost_per_token_above_128k_tokens": 0,
"output_cost_per_token_above_128k_tokens": 0,
"input_cost_per_token_above_200k_tokens": 0,
"output_cost_per_token_above_200k_tokens": 0,
"cache_creation_input_token_cost": 0,
"cache_read_input_token_cost": 0,
"cache_creation_input_token_cost_above_200k_tokens": 0,
"cache_read_input_token_cost_above_200k_tokens": 0,
"cache_read_input_token_cost_priority": 0,
"cache_read_input_image_token_cost": 0,
"cache_creation_input_audio_token_cost": 0,
"input_cost_per_image": 0,
"output_cost_per_image": 0,
"input_cost_per_pixel": 0,
"output_cost_per_pixel": 0,
"input_cost_per_image_token": 0,
"output_cost_per_image_token": 0,
"output_cost_per_image_low_quality": 0,
"output_cost_per_image_medium_quality": 0,
"output_cost_per_image_high_quality": 0,
"output_cost_per_image_auto_quality": 0,
"output_cost_per_image_premium_image": 0,
"output_cost_per_image_above_512_and_512_pixels": 0,
"output_cost_per_image_above_1024_and_1024_pixels": 0,
"output_cost_per_image_above_2048_and_2048_pixels": 0,
"output_cost_per_image_above_4096_and_4096_pixels": 0,
"input_cost_per_audio_token": 0,
"output_cost_per_audio_token": 0,
"input_cost_per_audio_per_second": 0,
"input_cost_per_second": 0,
"input_cost_per_video_per_second": 0,
"output_cost_per_video_per_second": 0,
"output_cost_per_second": 0,
"search_context_cost_per_query": 0,
"code_interpreter_cost_per_session": 0
},
"config_hash": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}{
"event_id": "string",
"type": "string",
"is_bifrost_error": true,
"status_code": 0,
"error": {
"type": "string",
"code": "string",
"message": "string",
"param": "string",
"event_id": "string"
},
"extra_fields": {
"provider": "openai",
"model_requested": "string",
"request_type": "string"
}
}{
"event_id": "string",
"type": "string",
"is_bifrost_error": true,
"status_code": 0,
"error": {
"type": "string",
"code": "string",
"message": "string",
"param": "string",
"event_id": "string"
},
"extra_fields": {
"provider": "openai",
"model_requested": "string",
"request_type": "string"
}
}