Skip to main content

Imagegen Bridge Python SDK

Typed sync and async clients for the normalized Imagegen Bridge HTTP API. The package targets Python 3.10 and newer.

uv add imagegen-bridge
from imagegen_bridge import (
    AsyncImagegenBridgeClient,
    ImagePresetCreate,
    ImagePresetTemplate,
    ImageRequest,
    OutputOptions,
    ProviderRoute,
    RoutingOptions,
)

async with AsyncImagegenBridgeClient("http://127.0.0.1:8787") as client:
    result = await client.images.generate(ImageRequest.generate(
        "a paper fox",
        output=OutputOptions(
            response_format="artifact",
            directory="illustrations",
            filename="fox.png",
            collision="suffix",
            metadata="sidecar",
        ),
        routing=RoutingOptions(
            provider="codex-responses",
            fallbacks=(ProviderRoute("codex-app-server", "gpt-image-2"),),
        ),
    ))
    print(result.data[0].name, result.data[0].metadata_name)

    queued = await client.jobs.create(ImageRequest.generate("a second paper fox"))
    partial = await client.jobs.partial(queued.id)  # transient while the job runs
    completed = await client.jobs.get(queued.id)
    preset = await client.presets.create(ImagePresetCreate(
        name="paper-fox",
        template=ImagePresetTemplate(prompt="a paper fox"),
    ))
    page = await client.jobs.list(
        status="succeeded", visibility="active", favorite=True, search="paper fox"
    )
    diagnostics = await client.diagnostics()
    print(diagnostics.configuration.listener_scope, diagnostics.providers)

Set provider in ImageRequest.routing to switch between configured bridge providers; client construction and response types do not change. Fallback routes are ordered and returned as typed provider attempts. OutputOptions.transparency selects native or local chroma-key alpha when the generation parameters request a transparent background. OutputOptions.metadata accepts none, sidecar, embedded, or sidecar_and_embedded. Embedded XMP is carried inside the returned PNG, JPEG, or WebP bytes; the latter combined mode requires artifact output. client.jobs is also available on the synchronous client and exposes create, get, list, partial, cancel, and update with typed durable job models. partial returns the latest verified in-memory preview and normally returns 404 before the first partial event or after the job becomes terminal. List filters include stable cursor pagination, status, active/hidden/all visibility, favorite state, and literal prompt search. client.presets exposes typed list, get, create, update, and delete operations for reusable input-free request configurations. diagnostics() returns the same typed, redaction-safe operator snapshot used by the embedded dashboard; it never includes credential values, prompts, or host paths.

Plain HTTP is accepted only for literal loopback addresses and localhost. Remote bridge URLs must use HTTPS unless the caller explicitly sets allow_insecure_remote_http=True, which disables transport confidentiality and server authentication. Redirects remain governed by HTTPX and should not be enabled for credential-bearing clients.

Per-call timeout omission inherits the timeout configured on the client; passing None explicitly disables HTTPX timeouts for that call, while a number or httpx.Timeout overrides them. Ordinary JSON bodies, error bodies, partial previews, SSE lines, and aggregate SSE events have independent configurable limits and are counted while streaming. Idempotency-Key can be supplied with idempotency_key= to both image and durable-job creation methods.

Metadata

Release files for imagegen-bridge 0.2.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 imagegen-bridge 0.2.0
File Size Uploaded
imagegen_bridge-0.2.0.tar.gz 44.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imagegen-bridge 0.2.0
File Interpreter ABI Platform
imagegen_bridge-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 62.0 kB

Release files / imagegen_bridge-0.2.0.tar.gz

Download URL imagegen_bridge-0.2.0.tar.gz
Size 44.7 kB
Tags Source
SHA-256 checksum
How to use checksums
271c8ecee8aa017df8a57e3863922e5d12789704cc0de9a23626ab099b12a5ca
BLAKE2b-256 checksum
How to use checksums
0a5a551e6e5cdeeb95bd0f0c855fb938f3421f6a0726531e4b20111e172ddcdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release files / imagegen_bridge-0.2.0-py3-none-any.whl

Download URL imagegen_bridge-0.2.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e324b5fd3f7d511c5f4d136de89f4ea20e513cf35c15322ec8052ed0445b36ba
BLAKE2b-256 checksum
How to use checksums
6159a709c5d4447a5423fa1b4082631eda6bb24a43bfe3ad7e330da37001cdce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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