POST
/
action
/
generate_image
curl --request POST \
  --url https://api-lr.agent.ai/v1/action/generate_image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": "A serene mountain lake at sunset",
  "model": "DALL-E 3",
  "model_style": "default",
  "model_aspect_ratio": "9:16"
}'
{
  "metadata": {
    "images": [
      {
        "prompt": "A serene mountain lake at sunset",
        "url": "https://s3.us-east-2.amazonaws.com/asset-uploads.agent.ai/6b55e6923a78a17534d298e0708c764425dffc85fbd9c1c2d4f8fb3f_8af27bf1-c121-484f-a456-4c6c5628c5d0_20250217144148.jpg"
      }
    ]
  },
  "response": "<img src=\"https://s3.us-east-2.amazonaws.com/asset-uploads.agent.ai/6b55e6923a78a17534d298e0708c764425dffc85fbd9c1c2d4f8fb3f_8af27bf1-c121-484f-a456-4c6c5628c5d0_20250217144148.jpg\" alt=\"A serene mountain lake at sunset\" /><br />",
  "status": 200
}

Authorizations

Authorization
string
header
required

Bearer token from your account (https://agent.ai/user/settings#credits)

Body

application/json
prompt
string
required

Generates an image based on the provided text. Example user prompt: generate an image of a sunset using the DALL-E 3 model.

model
enum<string>
default:
DALL-E 3
required

LLM model to use for text generation.

Available options:
DALL-E 3,
Playground v3,
FLUX.1 [schnell],
Ideogram
model_style
enum<string>
default:
default
required

Style

Available options:
default,
photo,
digital art,
illustration,
drawing
model_aspect_ratio
enum<string>
default:
9:16
required

Aspect Ratio

Available options:
9:16,
1:1,
4:3,
16:9

Response

200 - application/json
Generate Image
status
integer

HTTP status code of the action response

response
object

Response data from the action