匠人学院 JR Academy
Skip to article
Learning guide
OpenAI API Guide

Build with the OpenAI API using Responses API, streaming, tools, embeddings, and multimodal inputs.

3 chapters·9 guides·Access varies by chapter
Vision
On this page

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

python
import 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.

#Review boundaries

Check tiny text, ambiguous fields, crop/orientation, missing context and any important extracted figures against the original. Preserve uncertainty instead of turning a plausible observation into a confirmed fact.

#Reference

Published by
JR Academy
Learning resources

Individual authors and reviewers are credited where recorded.

System Design

Core system design concepts and practical case studies

Learn the trade-offs and patterns that matter in technical interviews.

Open System Design →

Related Roadmaps

FAQ

Which OpenAI API model should I use now?
As of 2026-11-09 OpenAI features GPT-6 Astra (gpt-6-astra, $10 input / $50 output per million tokens), GPT-6.1 Sol ($2 / $10) and GPT-6 Luna ($0.10 / $0.50) for cost-sensitive work. Build new projects on the Responses API.
How long can I keep using gpt-4o and gpt-5?
As of 2026-11-09 gpt-5, gpt-5-mini, o3 and related snapshots shut down on 2026-12-11; gpt-4o, gpt-4o-mini, gpt-4.1 and gpt-4.1-mini shut down on 2027-01-14, with gpt-6-luna as the recommended replacement.
Can I still use the Assistants API?
No. As of 2026-11-09 the Assistants API is closed: OpenAI shut it down on 2026-08-26; migrate to the Responses and Conversations APIs. Reusable prompt objects and the v1/prompts API are also deprecated and scheduled to shut down on 2026-11-30.

Done reading? Next steps