Generate an image into the media library

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-ai-image"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/55cc3653-45a7-441a-b584-77cfb174fd87/social-card.svg?v=3e7ae33eec8b" alt="Generate an image into the media library" width="600" height="315"></a>
POST http://localhost:4000/api/v1/media/generate/image

Answers the new file like GET /media/{id}. 503 AI_NOT_CONFIGURED when the server has no image generator.

Request body

application/json
prompt
string
required
aspect
string
1:1 | 4:5 | 16:9 | 9:16 = 1:1
style
string
generator
string
clientId
string
{
  "prompt": "string",
  "aspect": "1:1",
  "style": "string",
  "generator": "string",
  "clientId": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/media/generate/image" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"string","aspect":"1:1","style":"string","generator":"string","clientId":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
Updated