mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2026-03-20 18:11:27 -07:00
1.6 KiB
1.6 KiB
Image API quick reference
Endpoints
- Generate:
POST /v1/images/generations(client.images.generate(...)) - Edit:
POST /v1/images/edits(client.images.edit(...))
Models
- Default:
gpt-image-1.5 - Alternatives:
gpt-image-1-mini(for faster, lower-cost generation)
Core parameters (generate + edit)
prompt: text promptmodel: image modeln: number of images (1-10)size:1024x1024,1536x1024,1024x1536, orautoquality:low,medium,high, orautobackground:transparent,opaque, orauto(transparent requirespng/webp)output_format:png(default),jpeg,webpoutput_compression: 0-100 (jpeg/webp only)moderation:auto(default) orlow
Edit-specific parameters
image: one or more input images (first image is primary)mask: optional mask image (same size, alpha channel required)input_fidelity:low(default) orhigh(support varies by model) - set it tohighif the user needs a very specific edit and you can't achieve it with the defaultlowfidelity.
Output
data[]list withb64_jsonper image
Limits & notes
- Input images and masks must be under 50MB.
- Use edits endpoint when the user requests changes to an existing image.
- Masking is prompt-guided; exact shapes are not guaranteed.
- Large sizes and high quality increase latency and cost.
- For fast iteration or latency-sensitive runs, start with
quality=low; raise tohighfor text-heavy or detail-critical outputs. - Use
input_fidelity=highfor strict edits (identity preservation, layout lock, or precise compositing).