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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipe2-2026.7.6.tar.gz.
File metadata
- Download URL: pipe2-2026.7.6.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b8b1514d659b30da33a74442dd9ca5fec284a9b8683749b96499abb2a1e086b
|
|
| MD5 |
f6eacbc6fa3a263dda9b72005ec909db
|
|
| BLAKE2b-256 |
20ac59e5c7b9de4afff1485fc9b62b2eefab57efa348e86205a52e62c5c17086
|
File details
Details for the file pipe2-2026.7.6-py3-none-any.whl.
File metadata
- Download URL: pipe2-2026.7.6-py3-none-any.whl
- Upload date:
- Size: 55.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99228f1b4ecec9b82b0a70ffa9ab062bd27999dcdc19554b5c3af321083404f0
|
|
| MD5 |
2803aa035720f03c960bc6c6bbc4c64b
|
|
| BLAKE2b-256 |
ecd678a0bf26c32f22d1f7ce5c9af1e613b464d25cf63cd4428ddd6ad350abce
|