From 80a1fd3e0d21eda0848df69e27a84a114ced6825 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 21 May 2026 20:16:16 +0200 Subject: [PATCH 1/2] fix(openapi): align Actor pricing and version schemas with live API Pydantic models generated from the spec reject real responses from `GET /v2/acts/{id}` and `GET /v2/acts/{id}/builds/default` because the schemas don't model tiered pricing and use an overly strict version pattern. Make `pricePerUnitUsd` / `eventPriceUsd` optional, add `tieredPricing` / `eventTieredPricingUsd` (plus `isPrimaryEvent` and `isOneTimeEvent`), add common pricing-info flags returned by the API, and relax the actor `version` pattern to accept multi-segment values like `0.0.1`. Fixes apify/apify-client-python#811. --- .../actor-pricing-info/ActorChargeEvent.yaml | 23 ++++++++++++++++--- .../CommonActorPricingInfo.yaml | 6 +++++ .../PricePerDatasetItemActorPricingInfo.yaml | 6 ++++- .../TieredPricingPerDatasetItem.yaml | 8 +++++++ .../TieredPricingPerDatasetItemEntry.yaml | 9 ++++++++ .../TieredPricingPerEvent.yaml | 8 +++++++ .../TieredPricingPerEventEntry.yaml | 9 ++++++++ .../schemas/actors/ActorDefinition.yaml | 4 ++-- 8 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml create mode 100644 apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItemEntry.yaml create mode 100644 apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml create mode 100644 apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEventEntry.yaml diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml index 2c06df7c11..dd722acf2e 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml @@ -1,13 +1,30 @@ title: ActorChargeEvent +description: | + Definition of a single chargeable event for a pay-per-event Actor. + Each event is either flat-priced (`eventPriceUsd` is set) or + tier-priced (`eventTieredPricingUsd` is set); the two are mutually + exclusive. type: object required: - - eventPriceUsd - eventTitle - eventDescription properties: - eventPriceUsd: - type: number eventTitle: type: string + description: Human-readable title shown to users in the billing UI. eventDescription: type: string + description: Human-readable description of what triggers this event. + eventPriceUsd: + type: number + description: | + Flat price per event in USD. Present only for non-tiered events; + mutually exclusive with `eventTieredPricingUsd`. + eventTieredPricingUsd: + $ref: ./TieredPricingPerEvent.yaml + isPrimaryEvent: + type: boolean + description: Whether this event is the Actor's primary chargeable event. + isOneTimeEvent: + type: boolean + description: Whether this event can only be charged once per Actor run. diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/CommonActorPricingInfo.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/CommonActorPricingInfo.yaml index b11a920712..895d33624c 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/CommonActorPricingInfo.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/CommonActorPricingInfo.yaml @@ -27,3 +27,9 @@ properties: reasonForChange: type: [string, "null"] x-internal: true + isPriceChangeNotificationSuppressed: + type: boolean + x-internal: true + forceContainsSignificantPriceChange: + type: boolean + x-internal: true diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml index a912818d51..f26f4b3319 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml @@ -4,7 +4,6 @@ allOf: - type: object required: - pricingModel - - pricePerUnitUsd - unitName properties: pricingModel: @@ -15,3 +14,8 @@ allOf: description: Name of the unit that is being charged pricePerUnitUsd: type: number + description: | + Price per unit in USD. Mutually exclusive with `tieredPricing` — + exactly one of the two is present on a pricing record. + tieredPricing: + $ref: ./TieredPricingPerDatasetItem.yaml diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml new file mode 100644 index 0000000000..e8e6989ffe --- /dev/null +++ b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml @@ -0,0 +1,8 @@ +title: TieredPricingPerDatasetItem +description: | + Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. + `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual + price applied to a run is resolved from the user's tier. +type: object +additionalProperties: + $ref: ./TieredPricingPerDatasetItemEntry.yaml diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItemEntry.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItemEntry.yaml new file mode 100644 index 0000000000..b2d2992d93 --- /dev/null +++ b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItemEntry.yaml @@ -0,0 +1,9 @@ +title: TieredPricingPerDatasetItemEntry +description: A single tier's price-per-dataset-item entry. +type: object +required: + - tieredPricePerUnitUsd +properties: + tieredPricePerUnitUsd: + type: number + description: Price per unit in USD for this tier. diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml new file mode 100644 index 0000000000..910846bcec --- /dev/null +++ b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml @@ -0,0 +1,8 @@ +title: TieredPricingPerEvent +description: | + Tiered price-per-event pricing for a single charge event, keyed by + subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, + `DIAMOND`). The actual price applied is resolved from the user's tier. +type: object +additionalProperties: + $ref: ./TieredPricingPerEventEntry.yaml diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEventEntry.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEventEntry.yaml new file mode 100644 index 0000000000..35d6646e38 --- /dev/null +++ b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEventEntry.yaml @@ -0,0 +1,9 @@ +title: TieredPricingPerEventEntry +description: A single tier's price-per-event entry. +type: object +required: + - tieredEventPriceUsd +properties: + tieredEventPriceUsd: + type: number + description: Price per event in USD for this tier. diff --git a/apify-api/openapi/components/schemas/actors/ActorDefinition.yaml b/apify-api/openapi/components/schemas/actors/ActorDefinition.yaml index 64b8cf420e..6ce7137305 100644 --- a/apify-api/openapi/components/schemas/actors/ActorDefinition.yaml +++ b/apify-api/openapi/components/schemas/actors/ActorDefinition.yaml @@ -11,8 +11,8 @@ properties: description: The name of the Actor. version: type: string - pattern: ^[0-9]+\.[0-9]+$ - description: The version of the Actor, specified in the format [Number].[Number], e.g., 0.1, 1.0. + pattern: ^[0-9]+(\.[0-9]+)+$ + description: The version of the Actor, typically a dot-separated sequence of numbers (e.g., `0.1`, `1.0`, or `0.0.1`). buildTag: type: string description: The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified. From 81214f09230aaeeaf32863d29297210ef2bfab47 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 22 May 2026 13:54:58 +0200 Subject: [PATCH 2/2] polish docstrings --- .../schemas/actor-pricing-info/ActorChargeEvent.yaml | 9 +++------ .../PricePerDatasetItemActorPricingInfo.yaml | 4 ++-- .../actor-pricing-info/TieredPricingPerDatasetItem.yaml | 5 ++--- .../actor-pricing-info/TieredPricingPerEvent.yaml | 5 ++--- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml index dd722acf2e..4de6d998cb 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/ActorChargeEvent.yaml @@ -1,9 +1,7 @@ title: ActorChargeEvent description: | - Definition of a single chargeable event for a pay-per-event Actor. - Each event is either flat-priced (`eventPriceUsd` is set) or - tier-priced (`eventTieredPricingUsd` is set); the two are mutually - exclusive. + Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced + (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive. type: object required: - eventTitle @@ -18,8 +16,7 @@ properties: eventPriceUsd: type: number description: | - Flat price per event in USD. Present only for non-tiered events; - mutually exclusive with `eventTieredPricingUsd`. + Flat price per event in USD. Present only for non-tiered events. Mutually exclusive with `eventTieredPricingUsd`. eventTieredPricingUsd: $ref: ./TieredPricingPerEvent.yaml isPrimaryEvent: diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml index f26f4b3319..6e929f7c03 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/PricePerDatasetItemActorPricingInfo.yaml @@ -15,7 +15,7 @@ allOf: pricePerUnitUsd: type: number description: | - Price per unit in USD. Mutually exclusive with `tieredPricing` — - exactly one of the two is present on a pricing record. + Price per unit in USD. Mutually exclusive with `tieredPricing` - exactly one of the two is present + on a pricing record. tieredPricing: $ref: ./TieredPricingPerDatasetItem.yaml diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml index e8e6989ffe..6d5c6ef636 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerDatasetItem.yaml @@ -1,8 +1,7 @@ title: TieredPricingPerDatasetItem description: | - Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. - `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual - price applied to a run is resolved from the user's tier. + Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, + `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier. type: object additionalProperties: $ref: ./TieredPricingPerDatasetItemEntry.yaml diff --git a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml index 910846bcec..f14f75cbbf 100644 --- a/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml +++ b/apify-api/openapi/components/schemas/actor-pricing-info/TieredPricingPerEvent.yaml @@ -1,8 +1,7 @@ title: TieredPricingPerEvent description: | - Tiered price-per-event pricing for a single charge event, keyed by - subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`, `PLATINUM`, - `DIAMOND`). The actual price applied is resolved from the user's tier. + Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`, + `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier. type: object additionalProperties: $ref: ./TieredPricingPerEventEntry.yaml