vercel.AiGatewayImageClient$stream

The Vercel AI Gateway image client: POST {base_url}/image-model.

Reference version

Signature

class vercel.AiGatewayImageClient$stream

The Vercel AI Gateway image client: POST {base_url}/image-model.

client "ai-gateway-images/bfl/flux-2-pro" in an LLM function constructs this class. The gateway fronts many image providers behind one endpoint; the model id — including its provider prefix — rides in the ai-model-id header, not in the body.

function DrawLamp(subject: string) -> image {
    client "ai-gateway-images/bfl/flux-2-pro"
    prompt `A studio photograph of ${subject}.`
}

Image inputs ARE supported: an image prompt part becomes a files[] entry, which is how the endpoint does editing and variations —

function Restyle(source: image) -> image {
    client "ai-gateway-images/openai/gpt-image-1"
    prompt `Redraw ${source} in watercolor.`
}

Audio/video/pdf inputs have no representation and are rejected, as is tool calling. (mask, the other editing input, has no first-class field yet; pass it through request_body as {"mask": {"type": "file", "mediaType": …, "data": …}}.)

Source:<builtin>/vercel/images.bamlbytes 0–0

Fields

model

string | null

api_key

ai.Credential$stream | null

base_url

ai.Credential$stream | null

n

int | null

size

string | null

aspect_ratio

string | null

seed

int | null

request_body

baml.json.json$stream | null

headers

map<string, string> | null

query_params

map<string, string> | null

capture_wire

bool | null