Skip to content
Batchwork
Esc
navigateopen⌘Jpreview
Native batch jobs across seven AI providers

Ship large AI workloads through one Python 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

batchwork.py

$ uv add batchwork

job = await client.batch(

model="openai/gpt-5.5",

requests=requests,

)

Your workload

1–50,000 requests

Batchwork

serialize · submit · poll

OpenAI
Anthropic
Gemini
Groq
Mistral
Together
xAI

Normalized results

Correlated to every request by custom_id

Install with uv

uv add batchwork

Install with pip

pip install batchwork

From request to result

Familiar Python. Provider-native execution.

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.

  • Models use provider/model syntax.
  • Results correlate through custom_id.
  • Provider output order never has to match input order.
Explore more examples
quickstart.py
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

Seven APIs. One batch workflow.

Text batches across every provider, plus embeddings and image generation where native batch APIs support them.

Built for real workloads

The batch plumbing is already handled.

Keep application code focused on inputs and outputs while Batchwork owns the provider-specific boundary.

01

One typed interface

Submit provider-native batch jobs without rewriting orchestration for every API.

02

Native serialization

Batchwork handles each provider’s request shape, including file-backed and inline submission.

03

Normalized results

Consume jobs, results, usage, and errors through consistent Python models.

04

Rich requests

Send messages, function tools, structured content, and remote media where supported.

05

Production lifecycle

Run built-in polling, persistent stores, and signed webhooks for long-lived workloads.

06

Lean dependencies

The base package uses HTTPX directly—no provider SDK or JavaScript runtime required.

Start your next batch in Python.

Install Batchwork, add one provider credential, and submit through the same async interface everywhere.