openai.ImageClient$stream

The OpenAI image-generation client: POST {base_url}/images/generations.

Reference version

Signature

class openai.ImageClient$stream

The OpenAI image-generation client: POST {base_url}/images/generations.

client "openai-images/gpt-image-1" in an LLM function constructs this class. Its output type is media — -> image, -> image[], -> image?, -> string | image — which the runner builds from the turn's media blocks (ai/runner.baml) instead of parsing text.

function DrawLamp(subject: string) -> image {
    client "openai-images/gpt-image-1"
    prompt `A studio photograph of ${subject}.`
}

The endpoint takes a text prompt only: media inputs are rejected (image editing is a different, multipart endpoint) and tools are not supported.

Source:<builtin>/openai/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

quality

string | null

background

string | null

output_format

string | null

output_compression

int | null

moderation

string | null

style

string | null

user

string | null

response_format

string | null

request_body

baml.json.json$stream | null

headers

map<string, string> | null

query_params

map<string, string> | null

capture_wire

bool | null