Skip to content

Replace custom SDK models with generated models from apify-client #770

Closed

Description

@vdusek

Follow-up to #719

As a follow-up to the work in #719 (adapting the SDK to apify-client v3), we should go further and completely replace the custom models defined in the SDK with the generated models from apify-client-python.

Context

The SDK currently defines its own Pydantic models in src/apify/_models.py, including:

  • ActorRun, ActorRunStats, ActorRunUsage, ActorRunOptions, ActorRunMeta
  • FreeActorPricingInfo, FlatPricePerMonthActorPricingInfo, PricePerDatasetItemActorPricingInfo, PayPerEventActorPricingInfo
  • ActorChargeEvent, PricingPerEvent
  • PricingModel type alias
  • Webhook

Now that apify-client-python v3 provides fully typed, OpenAPI-generated models (e.g. ActorRun, ActorRunStats, ActorRunUsage, Pricing*, ...), we should use those directly instead of maintaining a parallel set of models in the SDK.

Tasks

  • Identify all custom models in src/apify/_models.py that have equivalents in apify-client-python
  • Replace usages of SDK-defined models with the corresponding client-generated models throughout the codebase
  • Also review src/apify/storage_clients/_apify/_models.py for models that may now have client equivalents
  • Remove the now-redundant custom model definitions from the SDK
  • Update re-exports and public API surface as needed
  • Ensure all tests pass with the client-provided models

Activity

  1. added this to the 4.0 milestone on Feb 9, 2026
  2. self-assigned this
    on Feb 9, 2026
  3. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions