Requirements
The Autumn Python SDK requires Python 3.10 or higher.Installation
You can install the Autumn Python SDK using your preferred Python package manager:The SDK uses modern Python tooling and is optimized for use with uv, a fast Python package installer and resolver.
Getting Your API Key
- Log in to your Autumn dashboard
- Navigate to Settings > API Keys
- Create a new secret key or copy an existing one
- Store it securely (we recommend using environment variables)
Basic Setup
Create a new Python file and initialize the SDK:Environment Variables
Create a.env file in your project root:
.env
Configuration Options
The SDK supports several configuration options:Configuration Parameters
string
required
Your Autumn API secret key. You can also pass a callable that returns the key for dynamic authentication.
string
API version to use. Defaults to the latest stable version (2.1).
string
Override the default API server URL. Useful for testing or using a proxy.
int
Request timeout in milliseconds. Applied to all operations unless overridden per-request.
HttpClient
Custom httpx client instance for synchronous operations.
AsyncHttpClient
Custom httpx async client instance for asynchronous operations.
Retry Configuration
The SDK automatically retries failed requests with exponential backoff. You can customize this behavior:Resource Management
The SDK implements proper resource management using Python context managers:IDE Support
The SDK includes full type hints and works great with modern IDEs:PyCharm
For enhanced Pydantic integration in PyCharm, install the Pydantic plugin:VS Code
VS Code provides excellent autocomplete and type checking out of the box. For the best experience:- Install the Python extension
- Enable type checking in your
settings.json:
Testing Your Installation
Verify your installation with this simple test:test.py
Debugging
Enable debug logging to troubleshoot issues:Next Steps
Usage Guide
Learn how to use the SDK for common billing and usage tracking tasks
API Reference
Explore the complete API reference