Vision with the OpenAI API
Use image understanding for a first analysis of screenshots, documents or mixed visual/text material, with appropriate rule or human verification. It is not error-free OCR or a final financial approval mechanism.
#Responses example
pythonimport os from openai import OpenAI client = OpenAI(timeout=30.0) response = client.responses.create( model=os.environ["OPENAI_VISION_MODEL"], input=[{ "role": "user", "content": [ {"type": "input_text", "text": "Describe the visible layout and uncertainties."}, {"type": "input_image", "image_url": os.environ["IMAGE_URL"], "detail": "auto"}, ], }], ) print(response.output_text)
Use an authorized image and a model that supports the chosen input. Supported workflows can use an image URL, a base64 data URL or an uploaded file reference; check the current endpoint requirements.
#Detail and cost
Where supported, low/high/auto detail controls trade input handling and detail inspection. Start with the detail the task needs rather than assuming the largest image always yields the best result.