Send a prompt to an image model deployment; get back base64 image data.
From CCA-F: New for you: Claude reads images but doesn't make them. The prompt craft carries over (be specific about subject, style, framing); the API is OpenAI's images API on a Foundry deployment.
How it works
- Deploy gpt-image-2 (or 2.5)
- client.images.generate(model=..., prompt=..., size=...)
- Decode data[0].b64_json and save
Must know
- GA: gpt-image-2 and the gpt-image-2.5 family (custom sizes up to 3840 px).
- Limited access: gpt-image-1.x. Retired: DALL-E 3 (March 2026).
- Results are b64_json, not URLs.
- background="transparent" needs PNG output.
Traps
- DALL-E 3 in an option is a retired service: never correct now.
- gpt-image-1 works only after a limited-access approval.
Check yourself: d3-n1 · d3-y1 · Microsoft Learn
3.2Edit images: masks and inpainting
Send the image, a mask and a prompt; only the masked area is redrawn.
From CCA-F: New for you. Think of it as a scoped edit: like telling Claude Code to change one function and leave the file alone, the mask is the scope.
How it works
- Make a PNG mask the same size as the image
- Make the area to change fully transparent
- client.images.edit(image=..., mask=..., prompt=...)
Must know
- Transparent pixels = edited; opaque pixels = kept.
- Up to 16 input images per edit.
- input_fidelity keeps faces and style closer to the input.
- No mask = the prompt can change the whole image.
Traps
- Black or white for the edit area is other tools' convention; Azure uses transparency.
- A mask of a different size is rejected.
Check yourself: d3-q19 · d3-c1 · Microsoft Learn
3.3Generate and remix video (Sora 2)
Video is a job: create, poll, download. To change a finished video, remix it.
From CCA-F: Same shape as the Message Batches API in CCA-F: submit, poll status, fetch results. Nothing comes back on the first call.
How it works
- client.videos.create(model="sora-2", prompt=..., size=..., seconds=...)
- Poll videos.retrieve(id) until completed
- videos.download_content(id); change it later with videos.remix(id, prompt=...)
Must know
- Sora 2 is preview; billed per second of video.
- size 720x1280 (default) or 1280x720; seconds 4, 8 or 12.
- input_reference sets the first frame and must match size exactly.
- Rejected: real people, copyrighted characters and music, input images with faces.
Traps
- Changing one thing in a finished clip = remix, not a new generation.
- Any face in the reference image is rejected, however the size is set.
Check yourself: d3-q20 · d3-o1 · Microsoft Learn