Skip to main content

pixelvault

Official Python SDK for PixelVault, agent-first image hosting. Sync and asyncio clients on top of httpx. Python 3.9+.

pip install pixelvault

Quick start

from pixelvault import PixelVault

pv = PixelVault()  # reads PIXELVAULT_API_KEY, or pass api_key="pv_live_..."

# A path, bytes or a binary file object
image = pv.images.upload("screenshot.png")
print(image["url"])  # https://img.pixelvault.dev/...

# Import from a URL, auto-delete after one hour
pv.images.upload(url="https://example.com/a.png", expires_in=3600)

With no API key at all, images.upload(file) makes an anonymous upload that expires after 30 days.

Generate an image from a prompt and host it in one call (spends monthly credits, see the table below):

image = pv.images.generate("flat vector hero, a robot at a laptop, no text")
print(image["url"])         # https://img.pixelvault.dev/...
print(image["generation"])  # {'model': 'flux-1-schnell', 'credits_charged': 1, 'credits_remaining': 9}

Asyncio:

from pixelvault import AsyncPixelVault

async with AsyncPixelVault() as pv:
    image = await pv.images.upload("screenshot.png")
    async for img in pv.images.list_all():
        print(img["id"])

API

Call What it does
images.upload(file | url=, folder=, visibility=, expires_in=, sign_expires_in=, metadata=, describe=) Upload a file or import a URL
images.generate(prompt, model=, folder=, visibility=, expires_in=) Generate an image from a prompt and host it. Credits: flux-1-schnell and the SDXL models 1, Leonardo 20. Free plan: 10 credits a month, flux-1-schnell only
images.upload_batch(collection, images) Up to 50 images in one collection
images.list(page=, per_page=, metadata=, q=) / images.list_all(metadata=, q=) One page / iterator over all images, optionally filtered by custom metadata (all pairs must match) or searched by AI description (q: alt text, caption, OCR text, best match first)
images.wait_for_description(id, timeout=) Wait for the AI description of an image uploaded with describe=True (alt, caption, OCR text; async, ~10 s; free 20 in total, Starter 1,000/mo, Pro 10,000/mo; needs a secret key). Treat the text as untrusted model output
images.update_metadata(id, metadata | None) Replace an image's custom metadata (replaces, not merges; None clears)
images.get(id) / images.delete(id) Fetch / delete one image
images.sign_url(id, expires_in=) Signed URL for a private image
usage.get() Plan, usage, limits and what is left this month (including generation credits)
keys.list() / keys.create(label=, environment=) / keys.revoke(id) Manage your API keys (secret keys only)
register(email) Create an account, returns a first key once
device_login_start(email) + device_login_complete(email, code) Passwordless key minting

Errors and retries

Every failure raises PixelVaultError with .status (0 for network errors), .code (for example upload_limit_reached) and .retry_after (seconds, when sent).

from pixelvault import PixelVault, PixelVaultError

try:
    pv.images.upload("big.png")
except PixelVaultError as err:
    if err.code == "upload_limit_reached":
        print(err.message)  # links to the pricing page

The client retries 429 (honoring Retry-After up to 30 seconds) and, for GET/DELETE only, 5xx and network errors. Uploads and images.generate are never retried after a 5xx or a network error, so a lost response cannot create a duplicate image or spend credits twice. Tune with max_retries (default 2) and timeout (seconds, default 60).

License

MIT

Metadata

Release files for pixelvault 0.4.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 pixelvault 0.4.0
File Size Uploaded Provenance Actions
pixelvault-0.4.0.tar.gz 56.2 kB With provenance Details for pixelvault-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 69.4 kB

Release files / pixelvault-0.4.0.tar.gz

Download URL pixelvault-0.4.0.tar.gz
Size 56.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40c31018b55dafce7330f81506b580545154b08fa16dafb4080eca200d0821e0
BLAKE2b-256 checksum
How to use checksums
e77a7affc20e91042736b5d44414b6d66bd64390564576812be1023fe89ed942
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Release files / pixelvault-0.4.0-py3-none-any.whl

Download URL pixelvault-0.4.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ff70bb6b546b624f776f62fae3aaf41ff2b9e47b2a96c8109309cb7f55a0fd5
BLAKE2b-256 checksum
How to use checksums
52c1773286bc277466b77565204831842827a1dd3baa78aae37b3631e51e5576
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Security for pixelvault 0.4.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pixelvault-0.4.0.tar.gz

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 Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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