Documentation Index
Fetch the complete documentation index at: https://mintlify.com/reductoai/reducto-python-sdk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheReducto class is the main synchronous client for interacting with the Reducto API. It handles authentication, request configuration, and provides access to all API resources.
Constructor
Parameters
Your Reducto API key. If not provided, the client will automatically read from the
REDUCTO_API_KEY environment variable.You can obtain your API key from the Reducto dashboard.The API environment to use. Available options:
production- US production environment (https://platform.reducto.ai)eu- EU production environment (https://eu.platform.reducto.ai)au- Australia production environment (https://au.platform.reducto.ai)
Override the base URL for the API. If provided, this takes precedence over the
environment parameter.You can also set this via the REDUCTO_BASE_URL environment variable.Request timeout in seconds. Defaults to 1 hour (3600 seconds).For more granular control, pass an
httpx.Timeout object:Maximum number of retries for failed requests. Defaults to 2.The client automatically retries:
- Connection errors
- 408 Request Timeout
- 409 Conflict
- 429 Rate Limit
- 5xx Server errors
0 to disable retries.Additional headers to include with every request.
Default query parameters to include with every request.
Custom httpx client instance for advanced use cases. Use this to configure:
- Custom proxies
- Custom transports
- Connection pooling
Basic Usage
With Environment Variable
The recommended approach is to set your API key as an environment variable:With Explicit API Key
With EU Environment
Client Methods
upload()
Upload a file directly to Reducto for processing. Returns areducto:// URL that can be used in subsequent API calls.
The file to upload. Can be:
- A
Pathobject - Raw bytes
- A tuple of
(filename, contents, media_type)
Optional file extension hint (e.g., “pdf”, “docx”)
api_version()
Get the current API version.Available Resources
The Reducto client provides access to the following resource namespaces:client.parse- Document parsing operationsclient.split- Document splitting operationsclient.extract- Data extraction operationsclient.edit- Document editing operationsclient.job- Job management operationsclient.pipeline- Pipeline operationsclient.webhook- Webhook configuration
Advanced Features
Context Manager
Use the client as a context manager to ensure proper resource cleanup:Per-Request Configuration
Override client settings for individual requests:Raw Response Access
Access raw HTTP response data including headers:Streaming Response
Stream response data for large payloads:Error Handling
The client raises specific exceptions for different error types:See Also
- AsyncReducto Client - Async version of the client
- Parse Operations - Document parsing methods
- Extract Operations - Data extraction methods