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.8.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.8.0
File Size Uploaded
pipe2-2026.8.0.tar.gz 36.9 kB Details

Built distribution (wheel)

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

Total release size: 98.1 kB

Release files / pipe2-2026.8.0.tar.gz

Download URL pipe2-2026.8.0.tar.gz
Size 36.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dbda67acd9c998a76a3024450e393afc6959ab4d23ac969518e0e3774cbac2d5
BLAKE2b-256 checksum
How to use checksums
1d25feab5615d00d07db7a95e678534eae27643f27177e1fc7d40fae6bfee39a
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.8.0-py3-none-any.whl

Download URL pipe2-2026.8.0-py3-none-any.whl
Size 61.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72c6949093d7e23e28b576ee67f5bdf175117a04044c4c37d6d58cfff36280d7
BLAKE2b-256 checksum
How to use checksums
de40911df5835036c6c07dcd0c30d44bd7a6078155894abe7d2dfdda96430bc5
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