01
One typed interface
Submit provider-native batch jobs without rewriting orchestration for every API.
Submit text, embedding, and image batches through one typed async interface. Batchwork handles provider-specific serialization, polling, and normalized results at roughly 50% lower provider batch pricing.
Python 3.11+ · MIT licensed · Built by Ajanraj
$ uv add batchwork
job = await client.batch(
model="openai/gpt-5.5",
requests=requests,
)
Your workload
1–50,000 requests
Batchwork
serialize · submit · poll
Normalized results
Correlated to every request by custom_id
Install with uv
uv add batchworkInstall with pip
pip install batchworkFrom request to result
Submitting returns a BatchJob immediately. The provider processes it asynchronously—often for minutes and sometimes up to 24 hours—while Batchwork gives you one lifecycle to poll, wait, collect, or cancel.
provider/model syntax.custom_id.import asyncio
from batchwork import BatchRequest, Batchwork
async def main() -> None:
async with Batchwork() as client:
job = await client.batch(
model="openai/gpt-5.5",
requests=[
BatchRequest(custom_id="hello", prompt="Say hello")
],
)
await job.wait(timeout=3600)
for result in await job.collect():
print(result.custom_id, result.text)
asyncio.run(main())Provider coverage
Text batches across every provider, plus embeddings and image generation where native batch APIs support them.
Built for real workloads
Keep application code focused on inputs and outputs while Batchwork owns the provider-specific boundary.
01
Submit provider-native batch jobs without rewriting orchestration for every API.
02
Batchwork handles each provider’s request shape, including file-backed and inline submission.
03
Consume jobs, results, usage, and errors through consistent Python models.
04
Send messages, function tools, structured content, and remote media where supported.
05
Run built-in polling, persistent stores, and signed webhooks for long-lived workloads.
06
The base package uses HTTPX directly—no provider SDK or JavaScript runtime required.
Install Batchwork, add one provider credential, and submit through the same async interface everywhere.