Image generation / edit
The gateway exposes OpenAI-compatible POST /v1/images/generations and POST /v1/images/edits (multipart). Auth matches Chat (user sk-…). Models need an active OpenAI-protocol route and Image pricing on the catalog entry.
What to do in Admin
Section titled “What to do in Admin”- Provider: add keys for OpenAI or a compatible upstream.
endpoints.openai.basecan derive…/images/generations, or set a fullimages.generationsURL. For Seedream-style hosts without OpenAI edits, do not setbase(avoids a dead derived edits URL). - Models: import or create an image preset (
outputincludesimage). Setimage_billing_mode:token: meter from upstream image / text token usage (e.g. GPT Image).per_image: catalog price per image (e.g. Seedream), with optional reference-image input price.
- Routes: add an OpenAI, active route for that model.
- Validate: Playground probes one route (no user billing); Simulator hits real Proxy → check Request logs for
billing_kind/ image counts and charges.
Model listing
Section titled “Model listing”- Default authenticated
GET /v1/modelsreturns LLMs only — not pure image-generation models. Passkind=imageorkind=allwhen needed. - Portals should use public
GET /catalog/models(no user key). It is not a drop-in replacement for/v1/models.
Minimal client call
Section titled “Minimal client call”curl -sS "$GATEWAY_URL/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2","prompt":"a watercolor fox","size":"1024x1024"}'