Skip to content

Images

Purpose

This section documents the Images endpoints and common usage patterns.

Key concepts

  • Inputs and outputs
  • Model and parameter compatibility
  • Streaming (when supported)

Minimal example

bash
# POST /v1/images/generations
curl https://api.fastapi.ai/v1/images/generations \
  -H "Authorization: Bearer $FAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-image-1.5","prompt":"A cute baby sea otter","n":1,"size":"1024x1024"}'

Common pitfalls

  • Ensure your Authorization header is set for every request.
  • Use the correct Content-Type for the endpoint.
  • For streaming, handle SSE events and error events.

那年我双手插兜, 让bug稳如老狗