Registry / http-networking / reductoai

reductoai

JSON →
library0.22.0pypypi✓ verified 25d ago

The Reducto Python SDK provides a type-safe interface for convenient access to the Reducto REST API from any Python 3.9+ application. It handles authentication, request formatting, and response parsing automatically. The library is currently at version 0.22.0 and has a frequent release cadence, with multiple updates often occurring within a single month.

pip install reductoai
INSTALL
IMPORT
SIG · REDUCTOAI
R
reductoai
http-networkingpythonv0.22.0
Install
5.1s avg
Import
1117ms
Disk
42MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.22.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 1.180s · 41.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 5.1s · import 1.054s · 43MB
42MB installed
● package 42MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Reducto
from reducto import Reducto
AsyncReducto
from reducto import AsyncReducto
Use for asynchronous API calls.
Path
from pathlib import Path
Commonly used for specifying local files for upload.

This quickstart demonstrates how to initialize the `Reducto` client, upload a local file, and then parse its content. It assumes your Reducto API key is set as an environment variable `REDUCTO_API_KEY`. A dummy file is created for demonstration purposes and then cleaned up.

import os from pathlib import Path from reducto import Reducto # Ensure REDUCTO_API_KEY is set in your environment # export REDUCTO_API_KEY="your_api_key_here" api_key = os.environ.get('REDUCTO_API_KEY', '') if not api_key: print("Warning: REDUCTO_API_KEY environment variable not set.") print("Please set it to run the quickstart example.") exit(1) # Initialize the client client = Reducto(api_key=api_key) # Create a dummy file for upload example dummy_file_path = Path("dummy_document.txt") dummy_file_path.write_text("This is a dummy document for Reducto.") try: # Upload a document upload_response = client.upload(file=dummy_file_path) print(f"Uploaded file with ID: {upload_response.file_id}") # Parse the document using the uploaded file_id parse_result = client.parse.run(input=upload_response.file_id) # Access the extracted content (example: print first chunk content) if parse_result.result and parse_result.result.chunks: print(f"First chunk content: {parse_result.result.chunks[0].content}") else: print("No chunks found in the parsed result.") except Exception as e: print(f"An error occurred: {e}") finally: # Clean up the dummy file if dummy_file_path.exists(): dummy_file_path.unlink()
Debug
Known issues
breakingThe `file` parameter for the `client.upload()` method in `v0.22.0` and later now expects binary file-like objects (e.g., `Path`, `bytes`, or a `(filename, contents, media_type)` tuple) instead of a `str` file path.
fix
Update your file upload calls to pass `pathlib.Path('your_file.pdf')`, `open('your_file.pdf', 'rb').read()`, or `('filename.pdf', b'content', 'application/pdf')` instead of just the string path.
affects: >=0.22.0
gotchaUploaded files to Reducto's servers (identified by `reducto://` URIs) are temporary and expire after 24 hours. Attempting to use an expired `file_id` will result in an error.
fix
Re-upload the file if you need to process it again after 24 hours, or implement a mechanism to manage `file_id` lifecycles if persistent storage is required.
affects: All
gotchaDirect file uploads via `client.upload()` are limited to 100MB. For files larger than 100MB (up to 5GB), you must use the presigned URL upload method.
fix
For large files, refer to the Reducto documentation on 'Presigned URL Upload' to handle the upload process correctly.
affects: All
gotchaThe SDK automatically reads the API key from the `REDUCTO_API_KEY` environment variable by default. If it's not set, client initialization might fail or requests will be unauthenticated.
fix
Always set the `REDUCTO_API_KEY` environment variable or explicitly pass `api_key='YOUR_KEY'` when initializing the `Reducto` client.
affects: All
gotchaWhile the async client uses `httpx` by default, for improved concurrency performance, it's recommended to install `aiohttp` and configure the client to use it.
fix
Install with `pip install reductoai[aiohttp]` and then initialize `AsyncReducto` with `http_client=DefaultAioHttpClient()` if `aiohttp` is desired.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'reductoai'
The `reductoai` package has not been installed in your current Python environment.
fix
pip install reductoai
ImportError: cannot import name 'Client' from 'reductoai'
The top-level package name for import is `reducto`, not `reductoai`, even though the pip package name is `reductoai`.
fix
from reducto import Client
TypeError: Client.__init__() missing 1 required keyword-only argument: 'api_key'
The `api_key` argument is mandatory when initializing the `reducto.Client` and was not provided.
fix
client = Client(api_key="YOUR_API_KEY")
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'https://api.reducto.ai/v1/messages'
The Reducto API key provided is invalid, expired, or has insufficient permissions, leading to an unauthorized access error.
fix
Verify your Reducto API key is correct and active. Ensure it is correctly passed to the `Client` constructor or set as the `REDUCTO_API_KEY` environment variable.
Upgrade
Version history
0.22.0latest on PyPI · released Mar 29, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.9 or higher.
aiohttpoptionalOptional dependency for improved concurrency performance with the asynchronous client.
Agent activity
27 hits · last 30 days
node
20
OpenAI (training)
1
Resources
reductoai — pip install reductoai · libregistry