Skip to main content

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()
  • 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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipe2 2026.9.0
File Size Uploaded
pipe2-2026.9.0.tar.gz 42.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pipe2 2026.9.0
File Interpreter ABI Platform
pipe2-2026.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.1 kB

Release files / pipe2-2026.9.0.tar.gz

Download URL pipe2-2026.9.0.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d0043dfdddc28c41bed469192b3f1e15f180b199336a33f218a401e02e300175
BLAKE2b-256 checksum
How to use checksums
2f6b7e7b44f42888e19cfdc9e5cb83fde07ade274236e8cc9adccc5a45297a7b
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.0-py3-none-any.whl

Download URL pipe2-2026.9.0-py3-none-any.whl
Size 71.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a372bb2b510e20104ae3c02bc6c11d66888549e79cd1d9de462fbe2bc9e690e0
BLAKE2b-256 checksum
How to use checksums
8cc0d9ec051afa45aecc8ed14ac7ebe8cce3cdffcc80172092ec26d21525c29a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page