Skip to content

Commit 37bdd21

Browse files
authored
Merge pull request #140 from Portkey-AI/feat/pricing-adjustments
Add pricing_adjustments to integrations API
2 parents a5721ff + e379289 commit 37bdd21

1 file changed

Lines changed: 151 additions & 1 deletion

File tree

openapi.yaml

Lines changed: 151 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32169,6 +32169,8 @@ components:
3216932169
items:
3217032170
$ref: '#/components/schemas/SecretMapping'
3217132171
description: Dynamically resolve secrets from secret references at runtime. Valid target_field values are "key" or "configurations.<field>" (e.g. "configurations.aws_secret_access_key", "configurations.azure_entra_client_secret"). Each target_field must be unique. When "key" is mapped, the key body field can be omitted.
32172+
pricing_adjustments:
32173+
$ref: '#/components/schemas/PricingAdjustments'
3217232174

3217332175
UpdateIntegrationRequest:
3217432176
type: object
@@ -32214,6 +32216,8 @@ components:
3221432216
items:
3221532217
$ref: '#/components/schemas/SecretMapping'
3221632218
description: Dynamically resolve secrets from secret references at runtime. Valid target_field values are "key" or "configurations.<field>" (e.g. "configurations.aws_secret_access_key", "configurations.azure_entra_client_secret"). Each target_field must be unique.
32219+
pricing_adjustments:
32220+
$ref: '#/components/schemas/PricingAdjustments'
3221732221

3221832222
IntegrationDetailResponse:
3221932223
allOf:
@@ -32269,7 +32273,153 @@ components:
3226932273
items:
3227032274
$ref: '#/components/schemas/SecretMapping'
3227132275
description: Secret reference mappings for this integration. Valid target_field values are "key" or "configurations.<field>".
32272-
32276+
pricing_adjustments:
32277+
$ref: '#/components/schemas/PricingAdjustments'
32278+
32279+
PricingAdjustments:
32280+
type: object
32281+
nullable: true
32282+
additionalProperties: false
32283+
description: |
32284+
Per-Integration pricing adjustments applied on top of Portkey's base model pricing
32285+
for cost tracking, analytics, and budget limits. Use to reflect negotiated discounts,
32286+
committed-use rates, or internal markups for cost showback.
32287+
properties:
32288+
multiplier:
32289+
$ref: '#/components/schemas/PricingMultiplier'
32290+
example:
32291+
multiplier:
32292+
default: 0.8
32293+
cache_read_input_token: 0.9
32294+
cache_write_input_token: 0.9
32295+
32296+
PricingMultiplier:
32297+
type: object
32298+
additionalProperties: false
32299+
description: |
32300+
Multipliers applied to the corresponding pricing keys from
32301+
[Portkey Models](https://portkey.ai/models). A multiplier of `1` leaves pricing
32302+
unchanged, `0.8` applies a 20% discount, `1.2` applies a 20% markup. Missing or
32303+
`null` fields inherit from `default`; if `default` is also unset, no change is applied.
32304+
All values must be non-negative numbers.
32305+
properties:
32306+
default:
32307+
type: number
32308+
nullable: true
32309+
minimum: 0
32310+
description: Multiplier applied to every token type unless a more specific multiplier is set.
32311+
request_token:
32312+
type: number
32313+
nullable: true
32314+
minimum: 0
32315+
description: Multiplier for input/request token cost.
32316+
response_token:
32317+
type: number
32318+
nullable: true
32319+
minimum: 0
32320+
description: Multiplier for output/response token cost.
32321+
cache_read_input_token:
32322+
type: number
32323+
nullable: true
32324+
minimum: 0
32325+
description: Multiplier for cache-read input token cost.
32326+
cache_write_input_token:
32327+
type: number
32328+
nullable: true
32329+
minimum: 0
32330+
description: Multiplier for cache-write input token cost.
32331+
cache_read_audio_input_token:
32332+
type: number
32333+
nullable: true
32334+
minimum: 0
32335+
description: Multiplier for cache-read audio input token cost.
32336+
request_audio_token:
32337+
type: number
32338+
nullable: true
32339+
minimum: 0
32340+
description: Multiplier for audio input token cost.
32341+
response_audio_token:
32342+
type: number
32343+
nullable: true
32344+
minimum: 0
32345+
description: Multiplier for audio output token cost.
32346+
reasoning_token:
32347+
type: number
32348+
nullable: true
32349+
minimum: 0
32350+
description: Multiplier for reasoning/thinking token cost.
32351+
prediction_accepted_token:
32352+
type: number
32353+
nullable: true
32354+
minimum: 0
32355+
description: Multiplier for accepted predicted-output token cost.
32356+
prediction_rejected_token:
32357+
type: number
32358+
nullable: true
32359+
minimum: 0
32360+
description: Multiplier for rejected predicted-output token cost.
32361+
request_image_token:
32362+
type: number
32363+
nullable: true
32364+
minimum: 0
32365+
description: Multiplier for image-modality input token cost.
32366+
response_image_token:
32367+
type: number
32368+
nullable: true
32369+
minimum: 0
32370+
description: Multiplier for image-modality output token cost.
32371+
request_text_token:
32372+
type: number
32373+
nullable: true
32374+
minimum: 0
32375+
description: Multiplier for text-modality input token cost.
32376+
response_text_token:
32377+
type: number
32378+
nullable: true
32379+
minimum: 0
32380+
description: Multiplier for text-modality output token cost.
32381+
cache_read_image_input_token:
32382+
type: number
32383+
nullable: true
32384+
minimum: 0
32385+
description: Multiplier for cache-read image-input token cost.
32386+
cache_read_text_input_token:
32387+
type: number
32388+
nullable: true
32389+
minimum: 0
32390+
description: Multiplier for cache-read text-input token cost.
32391+
cache_write_text_input_token:
32392+
type: number
32393+
nullable: true
32394+
minimum: 0
32395+
description: Multiplier for cache-write text-input token cost.
32396+
cache_write_image_input_token:
32397+
type: number
32398+
nullable: true
32399+
minimum: 0
32400+
description: Multiplier for cache-write image-input token cost.
32401+
image:
32402+
type: object
32403+
nullable: true
32404+
additionalProperties: false
32405+
description: Image generation pricing multipliers.
32406+
properties:
32407+
default:
32408+
type: number
32409+
nullable: true
32410+
minimum: 0
32411+
description: Multiplier applied to image generation pricing across all qualities and sizes.
32412+
additional_units:
32413+
type: object
32414+
nullable: true
32415+
description: |
32416+
Multipliers for per-unit charges such as `web_search`, `file_search`, `input_image`,
32417+
`input_video_standard`. Keys must match those returned by Portkey Models for the provider.
32418+
additionalProperties:
32419+
type: number
32420+
nullable: true
32421+
minimum: 0
32422+
3227332423
GlobalWorkspaceAccess:
3227432424
type: object
3227532425
required:

0 commit comments

Comments
 (0)