Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Response Input Image Content Param

From Leeroopedia
Knowledge Sources
Domains API_Types, Responses_API
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete TypedDict parameter type for supplying image input content to the model provided by the openai-python SDK.

Description

ResponseInputImageContentParam is a TypedDict used to construct image input content items for the Responses API request payload. The type field must always be "input_image". The optional detail field controls image resolution ("low", "high", or "auto", defaulting to "auto"). The image can be referenced by file_id (an uploaded file) or by image_url (a fully qualified URL or base64-encoded data URL). All fields except type are optional. Learn more about image inputs.

Usage

Import this type when constructing request payloads that include image content items as part of a message's content array in the Responses API.

Code Reference

Source Location

Signature

class ResponseInputImageContentParam(TypedDict, total=False):
    """An image input to the model."""

    type: Required[Literal["input_image"]]
    detail: Optional[Literal["low", "high", "auto"]]
    file_id: Optional[str]
    image_url: Optional[str]

Import

from openai.types.responses import ResponseInputImageContentParam

I/O Contract

Fields

Name Type Required Description
type Literal["input_image"] Yes The type of the input item. Always input_image.
detail Optional[Literal["low", "high", "auto"]] No The detail level of the image. One of high, low, or auto. Defaults to auto.
file_id Optional[str] No The ID of the file to be sent to the model.
image_url Optional[str] No The URL of the image to be sent to the model. A fully qualified URL or base64-encoded data URL.

Usage Examples

import openai

client = openai.OpenAI()

response = client.responses.create(
    model="gpt-4o",
    input=[
        {
            "role": "user",
            "content": [
                {
                    "type": "input_image",
                    "image_url": "https://example.com/photo.jpg",
                    "detail": "high",
                },
                {"type": "input_text", "text": "Describe this image in detail."},
            ],
        }
    ],
)
print(response.output_text)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment