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

# GPT-4o Image Python SDK for RunAPI

The GPT-4o Image Python SDK is the language-specific package for GPT-4o Image on
RunAPI. Use it for text-to-image, image editing, and creative production 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/gpt-4o-image; for API reference,
use https://runapi.ai/docs#gpt-4o-image; for SDK docs, use
https://runapi.ai/docs#sdk-gpt-4o-image.

## Install

```bash
pip install runapi-gpt-4o-image
```

## Quick start

```python
from runapi.gpt_4o_image import Gpt4oImageClient

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

task = client.text_to_image.create(
    model="gpt-4o-image",
    prompt="A cinematic product photo on warm paper",
    aspect_ratio="1:1",
)
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="gpt-4o-image",
    prompt="A futuristic cityscape at dusk",
    aspect_ratio="3:2",
)
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.gpt_4o_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/gpt-4o-image
- SDK docs: https://runapi.ai/docs#sdk-gpt-4o-image
- Product docs: https://runapi.ai/docs#gpt-4o-image
- Pricing and rate limits: https://runapi.ai/models/gpt-4o-image
- Full catalog: https://runapi.ai/models

## License

Licensed under the Apache License, Version 2.0.
