Skip to main content

Recraft Python SDK for RunAPI

The Recraft Python SDK is the language-specific package for Recraft on RunAPI. Use this package for image generation, image editing, and creative production workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Python.

This README is the Python package guide inside the public recraft-sdk repository. For the repository overview, start at ../README.md; for model details, use https://runapi.ai/models/recraft; for API reference, use https://runapi.ai/docs/api/recraft/remove-background; for SDK docs, use https://runapi.ai/docs/resources/sdks.

Install

pip install runapi-recraft

Quick start

from runapi.recraft import RecraftClient

client = RecraftClient()  # reads RUNAPI_API_KEY, or pass api_key="sk-..."

task = client.upscale_image.create(
    model="recraft-crisp-upscale",
    source_image_url="https://cdn.runapi.ai/public/samples/image.jpg",
)
status = client.upscale_image.get(task.id)

removed = client.remove_background.create(
    model="recraft-remove-background",
    source_image_url="https://cdn.runapi.ai/public/samples/image.jpg",
)

Use create when you want to submit a task and return quickly, get when you need the latest task state, and run when a script should create and poll until completion:

result = client.upscale_image.run(
    model="recraft-crisp-upscale",
    source_image_url="https://cdn.runapi.ai/public/samples/image.jpg",
)
print(result.images[0].url)

In web request handlers, prefer create plus webhook or later get polling so a worker is not held open.

RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.

Language notes

Pass parameters as keyword arguments and catch the runapi.recraft error classes when building image jobs, workers, or scripts. The available resources are upscale_image and remove_background. Keep RUNAPI_API_KEY in the environment or your secret manager; never commit API keys or callback secrets.

License

Licensed under the Apache License, Version 2.0.

Metadata

Release files for runapi-recraft 0.3.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 runapi-recraft 0.3.0
File Size Uploaded
runapi_recraft-0.3.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for runapi-recraft 0.3.0
File Interpreter ABI Platform
runapi_recraft-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / runapi_recraft-0.3.0.tar.gz

Download URL runapi_recraft-0.3.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e80009333c9be7ad39b26bd49bbbfb01a835518e54324580a269cc6655d790bd
BLAKE2b-256 checksum
How to use checksums
acbcca550903fb932a338b71032edd331fde3053f91200673606b575bae02973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.1","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / runapi_recraft-0.3.0-py3-none-any.whl

Download URL runapi_recraft-0.3.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f3465392f5ac9a02a2ded2377a7b3c9d5a590eb9651a4fd9646b221a2ae4c00
BLAKE2b-256 checksum
How to use checksums
69216ed7a96e60f58bc406bec590b60d6d0a6e72007304606e4ba85a1a06d16b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.1","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

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