pipe2
Official Python SDK for Pipe2.ai — run AI media pipelines (video generation, image generation, text-to-speech, video reframing) and track their results.
Async, fully typed with Pydantic models.
Install
pip install pipe2
Requires Python 3.10+.
Authenticate
Pipe2Client takes a bearer token — a personal access token from your
Pipe2.ai account, or a user JWT. It defaults to the
production endpoint https://api.pipe2.ai/v1/graphql.
from pipe2 import Pipe2Client
client = Pipe2Client(token=os.environ["PIPE2_TOKEN"])
Run a pipeline
Pipeline inputs vary per pipeline, so they are passed as a dict. Browse the catalog and each pipeline's inputs at pipe2.ai.
import asyncio, os
from pipe2 import Pipe2Client
async def main():
client = Pipe2Client(token=os.environ["PIPE2_TOKEN"])
run = await client.run_pipeline(
pipeline_slug="video-generator",
input={"prompt": "a red fox in falling snow, cinematic"},
)
print("run:", run.run_pipeline.run_id)
# Runs are asynchronous — fetch the current status by run id, and repeat
# until it reaches a terminal state.
status = await client.get_pipeline_run(id=run.run_pipeline.run_id)
print("status:", status.pipeline_runs_by_pk.status)
asyncio.run(main())
Estimate cost before running
Runs are billed in credits. estimate_pipeline_cost returns the price for a
given pipeline and input without starting anything.
estimate = await client.estimate_pipeline_cost(
pipeline_slug="video-generator",
input={"prompt": "a red fox in falling snow"},
)
Browse pipelines
pipelines = await client.get_pipelines()
Related
- Pipe2.ai — pipeline catalog, pricing, and docs
- pipe2-cli — agent-native command line tool
- sdk-go — Go client
License
Apache-2.0
Metadata
Release files for pipe2 2026.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pipe2-2026.10.0.tar.gz | 44.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pipe2-2026.10.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 121.5 kB
Release files / pipe2-2026.10.0.tar.gz
| Download URL | pipe2-2026.10.0.tar.gz |
|---|---|
| Size | 44.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f35aba537b883b86a8deba99a38474a62285a444ebd15f2e77ab0ed141c9d56a
|
|
BLAKE2b-256 checksum How to use checksums |
041862b335fb7f03eea47438455a8e1615d2ffc992c796064ae551915eb87a82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / pipe2-2026.10.0-py3-none-any.whl
| Download URL | pipe2-2026.10.0-py3-none-any.whl |
|---|---|
| Size | 76.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
77e99337793be072afdb3a6e1f1b6a7e5f1e4fc72d1d8f9e48248132760ecbda
|
|
BLAKE2b-256 checksum How to use checksums |
a51b04a604fb4ec54db9062999c928bbb47cf1f21a026b6060636c5b7461e569
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|