This section details the available configuration options for the Python SDK. All configuration is managed in the gen.yaml file under the python section.
The package manager to use for dependency management and packaging. Options:
(recommended) or
.
Default Value
(new) /
(legacy)
additionalDependencies
Required
false
Description
Specify additional dependencies to include in the generated
file.
Default Value
optionalDependencies
Required
false
Description
Define optional dependency groups (PyPI extras) in the generated
file. Each key becomes an extra that installs the listed packages on demand.
Default Value
compileCommands
Required
false
Description
A list of commands to use for compiling the SDK, replacing the default compile pipeline. Must be an array of arrays where each inner array has the command as the first element and the rest are arguments.
Default Value
N/A
pytestFilterWarnings
Required
false
Description
When the array contains any strings, sets the global pytest
value (filters to control Python warnings, e.g. ignoring or raising as errors). See Python warning filters.
Default Value
pytestTimeout
Required
false
Description
When greater than 0, installs
and sets the global timeout (in seconds) before individual tests are timed out.
Default Value
0
Name
Required
Default Value
Description
packageManager
false
(new) /
(legacy)
The package manager to use for dependency management and packaging. Options:
(recommended) or
.
additionalDependencies
false
Specify additional dependencies to include in the generated
file.
optionalDependencies
false
Define optional dependency groups (PyPI extras) in the generated
file. Each key becomes an extra that installs the listed packages on demand.
compileCommands
false
N/A
A list of commands to use for compiling the SDK, replacing the default compile pipeline. Must be an array of arrays where each inner array has the command as the first element and the rest are arguments.
pytestFilterWarnings
false
When the array contains any strings, sets the global pytest
value (filters to control Python warnings, e.g. ignoring or raising as errors). See Python warning filters.
pytestTimeout
false
0
When greater than 0, installs
and sets the global timeout (in seconds) before individual tests are timed out.
Default compilation pipeline
When compileCommands is not set, the default pipeline runs based on the package manager (uv or poetry) and includes bytecode compilation (compileall), linting (pylint -j=0), and type checking (mypy and pyright in parallel). To reduce pylint parallelism and avoid OOM errors in CI, use compileCommands with -j=1.
Use optionalDependencies to declare optional dependency groups, known as extras, in the generated pyproject.toml file. Extras let end users install packages that the SDK needs only for specific functionality, keeping the default installation lightweight.
Each top-level key under optionalDependencies is the name of an extra. Each extra holds a map of package names to PEP 508 version specifiers:
python:
optionalDependencies:
http2:
h2: ">=4.0.0"
cli:
click: ">=8.1.0"
rich: ">=13.0.0"
This configuration generates the following [project.optional-dependencies] table:
[project.optional-dependencies]
cli = [
"click >=8.1.0",
"rich >=13.0.0",
]
http2 = [
"h2 >=4.0.0",
]
End users then install an extra by name:
Terminal window
pipinstallmy-package[http2]
Extras and their packages are sorted alphabetically in the output. An extra with no packages renders as an empty list, such as http2 = []. Both the uv and poetry package managers support optionalDependencies.
Optional vs. additional dependencies
Use additionalDependencies for packages the SDK always needs, since they are installed with the base package. Use optionalDependencies for packages the SDK needs only for specific features, since they are installed only when an end user requests the matching extra.
The maximum number of parameters a method can have before the resulting SDK endpoint is no longer "flattened" and an input object is generated instead.
means input objects are always used.
Default Value
(new) /
(legacy)
flattenRequests
Required
false
Description
Turn request parameters and body fields into a flat list of method arguments. Takes precedence over
. If there is no request body,
is respected.
Default Value
true (new SDKs)
flatteningOrder
Required
false
Description
When flattening parameters and body fields, determines the ordering of generated method arguments. Options:
or
.
Default Value
parameters-first
methodArguments
Required
false
Description
If
, when all parameters and the request body are optional, the argument to the function will be optional. Alternative:
The maximum number of parameters a method can have before the resulting SDK endpoint is no longer "flattened" and an input object is generated instead.
means input objects are always used.
flattenRequests
false
true (new SDKs)
Turn request parameters and body fields into a flat list of method arguments. Takes precedence over
. If there is no request body,
is respected.
flatteningOrder
false
parameters-first
When flattening parameters and body fields, determines the ordering of generated method arguments. Options:
or
.
methodArguments
false
infer-optional-args
If
, when all parameters and the request body are optional, the argument to the function will be optional. Alternative:
Enable async hooks infrastructure for async SDK methods. SDK maintainers must explicitly register async hooks in
. Adapters wrap sync hooks, but native async implementations are recommended.
Default Value
false
sseFlatResponse
Required
false
Description
Whether to flatten SSE (Server-Sent Events) responses by extracting the
field from wrapper models, providing direct access to event data instead of the wrapper object.
Default Value
false
Name
Required
Default Value
Description
asyncMode
false
both
Whether to generate sync and/or async methods.
generates one constructor with
-suffixed methods.
generates
and
with no method-name suffixes.
useAsyncHooks
false
false
Enable async hooks infrastructure for async SDK methods. SDK maintainers must explicitly register async hooks in
. Adapters wrap sync hooks, but native async implementations are recommended.
sseFlatResponse
false
false
Whether to flatten SSE (Server-Sent Events) responses by extracting the
field from wrapper models, providing direct access to event data instead of the wrapper object.
The asyncMode setting provides two patterns for handling async operations:
Method-based (both, default): Every operation has two methods — a synchronous version and an asynchronous version with an _async suffix.
sdk = MyAPI(api_key="...")
# Synchronous operations
result = sdk.list_users()
# Asynchronous operations
result =await sdk.list_users_async()
Constructor-based (split): Separate constructors for synchronous and asynchronous clients. All method names are identical between sync and async versions.
# Synchronous client
sync_sdk = MyAPI(api_key="...")
result = sync_sdk.list_users()
# Asynchronous client
async_sdk = AsyncMyAPI(api_key="...")
result =await async_sdk.list_users()
The constructor-based pattern eliminates method name duplication and provides clearer IDE suggestions.
Breaking change
Switching to asyncMode: split is a breaking change. Existing SDK consumers will need to update their code to use the new constructor pattern.
Determines the format to express enums in Python. Options:
or
.
Default Value
(new) /
(legacy)
forwardCompatibleEnumsByDefault
Required
false
Description
When true, any enum used in a response is automatically open/forward-compatible — unknown values are tolerated. Single-value enums are not auto-opened. Individual enums can be controlled with
.
Default Value
true (new SDKs)
forwardCompatibleUnionsByDefault
Required
false
Description
Controls forward compatibility for discriminated unions in responses.
makes discriminated unions open to unknown discriminator values.
disables. Individual unions can be controlled with
.
Default Value
(new) /
(legacy)
inferUnionDiscriminators
Required
false
Description
Infer union discriminators for
s missing explicit OpenAPI discriminator mapping.
Default Value
true
preApplyUnionDiscriminators
Required
false
Description
When true, discriminator values are applied as const fields onto union member types when those types are consistently used with the same discriminator value. Simplifies type structure and enables
syntax.
Default Value
true (new SDKs)
Name
Required
Default Value
Description
enumFormat
false
(new) /
(legacy)
Determines the format to express enums in Python. Options:
or
.
forwardCompatibleEnumsByDefault
false
true (new SDKs)
When true, any enum used in a response is automatically open/forward-compatible — unknown values are tolerated. Single-value enums are not auto-opened. Individual enums can be controlled with
.
forwardCompatibleUnionsByDefault
false
(new) /
(legacy)
Controls forward compatibility for discriminated unions in responses.
makes discriminated unions open to unknown discriminator values.
disables. Individual unions can be controlled with
.
inferUnionDiscriminators
false
true
Infer union discriminators for
s missing explicit OpenAPI discriminator mapping.
preApplyUnionDiscriminators
false
true (new SDKs)
When true, discriminator values are applied as const fields onto union member types when those types are consistently used with the same discriminator value. Simplifies type structure and enables
Fixes to apply to the generated SDK. Generally true for new SDKs but may be false for backward compatibility with existing SDKs.
python:
fixes:
responseRequiredSep2024: true
asyncPaginationSep2025: true
conflictResistantModelImportsFeb2026: true
Name
responseRequiredSep2024
Required
false
Description
Enables fixes introduced in September 2024 for response required field handling. For existing SDKs, setting to true is recommended but may be a breaking change.
Default Value
true (new SDKs)
asyncPaginationSep2025
Required
false
Description
Disabling not recommended. Enables changes introduced in September 2025 to fix async pagination methods to return async
functions instead of synchronous ones, preventing blocking fetches after the initial API call. For existing SDKs, setting to true is recommended but will be a breaking change.
Default Value
true (new SDKs)
conflictResistantModelImportsFeb2026
Required
false
Description
Enables conflict-resistant model imports introduced in February 2026. For existing SDKs, setting to true is recommended but may be a breaking change.
Default Value
true (new SDKs)
Name
Required
Default Value
Description
responseRequiredSep2024
false
true (new SDKs)
Enables fixes introduced in September 2024 for response required field handling. For existing SDKs, setting to true is recommended but may be a breaking change.
asyncPaginationSep2025
false
true (new SDKs)
Disabling not recommended. Enables changes introduced in September 2025 to fix async pagination methods to return async
functions instead of synchronous ones, preventing blocking fetches after the initial API call. For existing SDKs, setting to true is recommended but will be a breaking change.
conflictResistantModelImportsFeb2026
false
true (new SDKs)
Enables conflict-resistant model imports introduced in February 2026. For existing SDKs, setting to true is recommended but may be a breaking change.