# `PhoenixKitAI.Providers.OpenAI`
[🔗](https://github.com/BeamLabEU/phoenix_kit_ai/blob/0.23.1/lib/phoenix_kit_ai/providers/openai.ex#L1)

`PhoenixKitAI.Provider` adapter for OpenAI's own Images API.

  * Editing: `POST <base_url>/images/edits` as multipart form data —
    the GPT Image models take the sources as `image[]` files, never as
    URLs, so data URLs are decoded to bytes and http(s) references are
    downloaded first (`PhoenixKitAI.Providers.HTTP.fetch_image/2`). A
    `:mask` option (PNG whose transparent pixels may be repainted) is
    sent as the `mask` file.
  * Generation: `POST <base_url>/images/generations` (JSON).

OpenAI sizes images with `size` (`1024x1024`, `1536x1024`, `1024x1536`,
`auto`); a canonical `aspect_ratio` is mapped onto it when no `size`
was given. `background: "transparent"` and `output_format` are
supported on the GPT Image models.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
