Skip to content

Image generation

POST /v1/images/generations for OpenAI-compatible text-to-image requests.

http
POST https://api.webway.sh/v1/images/generations

Pass the exact routing ID of an image model from the live catalogue. Set WEBWAY_IMAGE_MODEL to that ID before running the example.

Request

bash
curl https://api.webway.sh/v1/images/generations \
  -H "Authorization: Bearer $WEBWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"$WEBWAY_IMAGE_MODEL\",
    \"prompt\": \"A paper map of an imaginary coastal city, editorial illustration\",
    \"size\": \"1024x1024\",
    \"n\": 1
  }"
Field Type Notes
model string Required image model ID
prompt string Required image description
size string Supported output size; model-dependent
n integer Number of images
quality string Quality tier; model-dependent
response_format string url or b64_json

Response

json
{
  "created": 1787700000,
  "data": [
    {"url": "https://…/generated-image.png"}
  ]
}

URLs are temporary. Download generated files promptly if you need to retain them.