Metadata-Version: 2.4
Name: runapi-z-image
Version: 0.1.0
Summary: Z-Image text-to-image client for RunAPI
Project-URL: Homepage, https://runapi.ai/models/z-image
Project-URL: Documentation, https://runapi.ai/docs#sdk-z-image
Author-email: RunAPI <contact@runapi.ai>
License-Expression: Apache-2.0
Keywords: ai,runapi,sdk,text-to-image,z-image
Requires-Python: >=3.9
Requires-Dist: runapi-core
Description-Content-Type: text/markdown

# Z-Image Python SDK for RunAPI

The Z-Image Python SDK is the language-specific package for Z-Image on RunAPI.
Use it for text-to-image flows when your application needs JSON request bodies,
task status lookup, and consistent RunAPI errors in Python.

For model details, use https://runapi.ai/models/z-image; for API reference, use
https://runapi.ai/docs#z-image; for SDK docs, use https://runapi.ai/docs#sdk-z-image.

## Install

```bash
pip install runapi-z-image
```

## Quick start

```python
from runapi.z_image import ZImageClient

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

task = client.text_to_image.create(
    model="z-image",
    prompt="A neon city street after rain, cinematic",
    aspect_ratio="16:9",
)
status = client.text_to_image.get(task.id)
```

Use `create` to submit a task and return quickly, `get` to fetch the latest task
state, and `run` to create and poll until completion:

```python
result = client.text_to_image.run(
    model="z-image",
    prompt="A serene mountain lake at dawn",
    aspect_ratio="1:1",
)
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 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.z_image` error
classes when building image jobs or scripts. The available resource is
`text_to_image`. Keep `RUNAPI_API_KEY` in the environment or your secret
manager; never commit API keys or callback secrets.

## Links

- Model page: https://runapi.ai/models/z-image
- SDK docs: https://runapi.ai/docs#sdk-z-image
- Product docs: https://runapi.ai/docs#z-image
- Pricing and rate limits: https://runapi.ai/models/z-image
- Full catalog: https://runapi.ai/models

## License

Licensed under the Apache License, Version 2.0.
