Skip to main content

renderly-ai for Python

Official client for the Renderly API: one key and one credit wallet (1 credit = $0.01) for image, video, audio, 3D and language models. Standard library only; Python 3.8+. Keep your API key on a server.

pip install renderly-ai
export RENDERLY_API_KEY="rly_…"   # Settings → API access
from renderly_ai import Renderly

renderly = Renderly()  # reads RENDERLY_API_KEY (and RENDERLY_BASE_URL if set)

result = renderly.run(
    model_id="model-…",            # from renderly.search_models("…")
    operation="text-to-image",
    input={"prompt": "A glass fox in morning light"},
    max_credits=50,                # refuse anything pricier, before any charge
)

for artifact in result["job"]["artifacts"]:
    data = renderly.download_artifact(artifact["id"])

run() quotes, checks max_credits, creates the job with a server-side wait of up to 60 seconds and then long-polls until the job is completed or refunded.

Step by step

models = renderly.search_models("portrait", kind="image", available=True)["models"]
model = renderly.model(models[0]["id"])            # creation fields + inputSchema
quote = renderly.quote(model_id=model["id"], operation=model["operation"], sku=model["sku"], input=input)  # free
job = renderly.create_job(quote_id=quote["quoteId"], input=input, webhook_url="https://example.com/hooks/renderly", wait=30)["job"]
done = renderly.wait_for_job(job["id"], on_update=lambda j: print(j["status"]))
link = renderly.artifact(done["artifacts"][0]["id"])  # {"url", "expiresIn"}: 15 minutes
Area Methods
Models (public) models(...), search_models(q, ...), iter_models(...), model(id), catalog(), catalog_details(ids), catalog_prices(ids)
Account account(), wallet() (incl. reserved), ledger(...), iter_ledger(...), usage(from_=, to=, group_by=)
Jobs quote(), create_job(..., wait=), get_job(id, wait=), list_jobs(status=, model_id=, from_=, to=, key_id=), iter_jobs(), wait_for_job(), cancel_job(id), run()
Files upload(data, kind=), upload_from_url(url, kind=), artifact(id), artifact_url(id), download_artifact(id)
Service status()
  • Inputs: file = renderly.upload(data, kind="image") or renderly.upload_from_url("https://…/photo.png", kind="image"), then pass {"inputAssetId": file["id"]} in the model's input field.
  • Retries: GETs and job creation retry network errors, 5xx and 429 (honouring Retry-After up to 60 s); job creation reuses one request ID, so a retry never starts a second job. Quotes retry at most once; uploads and cancellation retry only after 429.
  • Rate limits: renderly.last_rate_limit holds limit, remaining, reset and retry_after; renderly.last_request_id the latest X-Request-Id.
  • Errors: failures raise RenderlyError with code, status, request_id and, for 429, retry_after.

Webhooks

from renderly_ai import verify_webhook

# Use the raw request body exactly as received.
event = verify_webhook(raw_body, headers["Renderly-Signature"], os.environ["RENDERLY_WEBHOOK_SECRET"])
if event["type"] == "job.completed":
    artifacts = event["data"]["job"]["artifacts"]
elif event["type"] == "balance.low":
    balance = event["data"]["balance"]

Full guide: https://renderly-web-production.up.railway.app/docs.html · OpenAPI: https://renderly-web-production.up.railway.app/openapi.json

Metadata

Release files for renderly-ai 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 renderly-ai 0.2.0
File Size Uploaded Provenance Actions
renderly_ai-0.2.0.tar.gz 15.3 kB Without provenance Details for renderly_ai-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for renderly-ai 0.2.0
File Interpreter ABI Platform Actions
renderly_ai-0.2.0-py3-none-any.whl Python 3 none any Details for renderly_ai-0.2.0-py3-none-any.whl

Total release size: 25.9 kB

Release files / renderly_ai-0.2.0.tar.gz

Download URL renderly_ai-0.2.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
55184fbf8d6e462735cf3390f9b29431f08912738756bef928da53489c81fcc7
BLAKE2b-256 checksum
How to use checksums
e718fd4555fea5622a5d300935ecbb3c6dc24398cc2e3c59748c95d4d8cad734
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

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

Download URL renderly_ai-0.2.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80b2d0c294418cf41411b03ac88fe9b16270ef52ba631ee2f2b6ca508f182bdd
BLAKE2b-256 checksum
How to use checksums
b95a94974662a83c8c438bad1625d625b33795570365fff7274c449e90bab35e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for renderly-ai 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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