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.9.2
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.9.2.tar.gz | 44.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pipe2-2026.9.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 121.4 kB
Release files / pipe2-2026.9.2.tar.gz
| Download URL | pipe2-2026.9.2.tar.gz |
|---|---|
| Size | 44.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2101a75d8afde064add217055a7043ea7162ce75ef7cdf9987d485a825ed905
|
|
BLAKE2b-256 checksum How to use checksums |
ef6002ee0541bd8a4143c4f85ac896723a23f835ff11a0fbd5c54766952551cf
|
| 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.9.2-py3-none-any.whl
| Download URL | pipe2-2026.9.2-py3-none-any.whl |
|---|---|
| Size | 76.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b3d5badbef6ecd56c16e1bb67c47a8b0240279d3168c87e7405d0aeb02c398e0
|
|
BLAKE2b-256 checksum How to use checksums |
d83c150a5602e3be11b288f3659b5341e3006b05d05853c8944128737946bcf1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|