# Generated contract types (/sdks/python/contract-types)

Generate types after you have created a resource and published its revision. Choose one generated-code folder in your Python project:

```toml title="pyproject.toml"
[tool.recuut]
contracts-output-dir = "my_app/recuut_contracts"
```

Download the published revisions for the merchant API key in your environment:

```bash
recuut pull-contracts -v
```

The command prints planned changes before it writes files. Commit the generated files and run this check in continuous integration:

```bash
recuut pull-contracts --check
```

For the **Text generation API** example, the configured directory becomes a Python package containing `__init__.py` and a resource module such as `text_generation_api__generated.py`. The package re-exports revision and payment names such as `TextGenerationV1` and `TextGenerationPayment`, which are the names used in the framework guides. Exact names come from your resource and revision names; verbose output prints the package and planned files before writing.

If no published revision is visible, verify that the test key belongs to the expected workspace and that the revision is published. If `--check` fails, rerun the verbose pull, review the diff, and commit the generated change. A new revision can produce new types because its reporting contract changed. A price change does not change the values your application reports.
