ArtGen FastAPI Service API
A simple API for generating images using OpenAI models.
Endpoints
POST /api/v1/generate/
Generate an image based on the provided prompt and parameters.
Parameters
Name | Type | Required | Description |
---|---|---|---|
prompt | string | Required | The text prompt to generate an image from |
model | string | Optional | The model to use for image generation (gpt-image-1, dall-e-3, dall-e-2) |
n | integer | Optional | Number of images to generate (1-10) |
size | string | Optional | The size of the generated image |
quality | string | Optional | Quality of the generated image |
format | string | Optional | Format to return the image in (png, jpeg) |
background | string | Optional | Whether to make the background transparent |
Response
Returns a JSON object containing URLs to the generated images.
POST /api/v1/variants/
Create variations of an existing image.
Parameters
Name | Type | Required | Description |
---|---|---|---|
image | file | Required | The image to create variations of |
n | integer | Optional | Number of variations to generate (1-10) |
Response
Returns a JSON object containing URLs to the generated image variations.