Images
Overview
Section titled “Overview”Available Operations
Section titled “Available Operations”- create - Create image
create
Section titled “create”Generate images from text prompts
Example Usage
Section titled “Example Usage”from r9s import R9S
with R9S(api_key=os.getenv("R9S_API_KEY",""),) as r9_s:
res = r9_s.images.create(prompt="A cute cat sitting on a windowsill", model="gpt-4o-mini", n=1, quality="standard", response_format="url", size="1024x1024", style="vivid")
# Handle response print(res)Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | str | :heavy_check_mark: | Image description prompt |
model | str | :heavy_minus_sign: | Model name |
n | int | :heavy_minus_sign: | Number of images to generate |
quality | object | :heavy_minus_sign: | N/A |
response_format | object | :heavy_minus_sign: | N/A |
size | object | :heavy_minus_sign: | N/A |
style | string (vivid, natural) | :heavy_minus_sign: | N/A |
user | str | :heavy_minus_sign: | N/A |
retries | object | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
Section titled “Response”ImageGenerationResponse
Errors
Section titled “Errors”| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestError | 400 | application/json |
| errors.AuthenticationError | 401 | application/json |
| errors.PermissionDeniedError | 403 | application/json |
| errors.UnprocessableEntityError | 422 | application/json |
| errors.RateLimitError | 429 | application/json |
| errors.InternalServerError | 500 | application/json |
| errors.ServiceUnavailableError | 503 | application/json |
| errors.R9SDefaultError | 4XX, 5XX | */* |