openai · OpenAI Platform Docs
Images and vision | OpenAI API
Explains how to integrate vision capabilities into prompts by passing image URLs or base64 encoded data to multimodal models.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Images and vision | OpenAI API
Explains how to integrate vision capabilities into prompts by passing image URLs or base64 encoded data to multimodal models.
When To Use
Use when you need to implement multimodal workflows that require an AI agent to analyze, describe, or extract data from image files.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/images-and-vision-openai-api-workflow-guide.md | A Python function demonstrating how to encode a local image file into a base64 string for use with the OpenAI Vision API. | Questions about a Python function demonstrating how to encode a local image file into a base64 string for use with the OpenAI Vision... |
examples/images-and-vision-openai-api-openai-api-image-generation-nodejs.text | A Node.js code example demonstrating how to use the OpenAI API to generate an image of a cat and an otter using the image generation tool. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI API to generate an image of a cat and an otter using the i... |
examples/images-and-vision-openai-api-openai-api-python-image-generation-request.text | A Python code example using the OpenAI client to generate an image of a cat and an otter using the image generation tool. | Exact payloads, commands, or snippets shown in A Python code example using the OpenAI client to generate an image of a cat and an otter using the image generation t... |
examples/images-and-vision-openai-api-openai-vision-image-generation-cli.text | A shell command demonstrating how to use the OpenAI CLI to generate an image of a cat and an otter using a YAML-formatted input. | Exact payloads, commands, or snippets shown in A shell command demonstrating how to use the OpenAI CLI to generate an image of a cat and an otter using a YAML-forma... |
examples/images-and-vision-openai-api-openai-api-vision-chat-completions-nodejs.text | A Node.js code example demonstrating how to send an image URL to the OpenAI Chat Completions API for visual analysis. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to send an image URL to the OpenAI Chat Completions API for visual analysis. |
examples/images-and-vision-openai-api-openai-api-vision-chat-completions-python.text | A Python code example demonstrating how to use the OpenAI Chat Completions API to analyze an image URL using a vision-capable model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the OpenAI Chat Completions API to analyze an image URL using a vision... |
examples/images-and-vision-openai-api-openai-api-vision-chat-completions-curl-req.text | A curl command demonstrating how to send a text and image URL payload to the OpenAI chat completions endpoint for vision tasks. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a text and image URL payload to the OpenAI chat completions endpoint for vis... |
examples/images-and-vision-openai-api-openai-api-vision-chat-completions-nodejs-2.text | A Node.js code example demonstrating how to send a base64 encoded image to the OpenAI Chat Completions API for vision analysis. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to send a base64 encoded image to the OpenAI Chat Completions API for vision... |
examples/images-and-vision-openai-api-openai-vision-python-base64-image-encoding.text | A Python script demonstrating how to encode a local image file into a base64 string for use with the OpenAI Vision API. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to encode a local image file into a base64 string for use with the OpenAI Vision API. |
examples/images-and-vision-openai-api-openai-api-vision-chat-completions-curl-bas.text | A curl command demonstrating how to send a base64 encoded image to the OpenAI chat completions endpoint for vision analysis. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a base64 encoded image to the OpenAI chat completions endpoint for vision an... |
examples/images-and-vision-openai-api-openai-api-vision-nodejs-image-analysis.text | A Node.js code example demonstrating how to send an image URL to the OpenAI API to request visual analysis using the vision model. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to send an image URL to the OpenAI API to request visual analysis using the... |
examples/images-and-vision-openai-api-openai-api-vision-gpt-4o-mini-python-reques.text | A Python code example using the OpenAI client to send a text prompt and an image URL to the gpt-4o-mini model for visual analysis. | Exact payloads, commands, or snippets shown in A Python code example using the OpenAI client to send a text prompt and an image URL to the gpt-4o-mini model for vis... |
examples/images-and-vision-openai-api-openai-api-vision-csharp-image-analysis.text | A C# code example demonstrating how to use the OpenAI API to perform image analysis using a vision-capable model. | Exact payloads, commands, or snippets shown in A C# code example demonstrating how to use the OpenAI API to perform image analysis using a vision-capable model. |
examples/images-and-vision-openai-api-openai-api-vision-curl-request.text | A curl command demonstrating how to send an image URL and text prompt to the OpenAI vision model. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send an image URL and text prompt to the OpenAI vision model. |
examples/images-and-vision-openai-api-openai-api-vision-gpt-model-cli-request.text | A CLI command using the OpenAI API to send an image URL and a text prompt to a vision-capable model. | Exact payloads, commands, or snippets shown in A CLI command using the OpenAI API to send an image URL and a text prompt to a vision-capable model. |
examples/images-and-vision-openai-api-openai-api-vision-nodejs-image-analysis-2.text | A Node.js code example demonstrating how to send a base64 encoded image to the OpenAI API for visual analysis using the OpenAI client library. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to send a base64 encoded image to the OpenAI API for visual analysis using t... |
examples/images-and-vision-openai-api-openai-api-vision-python-base64-image-encod.text | A Python script demonstrating how to encode a local image file into a base64 string for use with the OpenAI Vision API. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to encode a local image file into a base64 string for use with the OpenAI Vision API. |
examples/images-and-vision-openai-api-openai-api-vision-csharp-image-analysis-2.text | A C# code example demonstrating how to use the OpenAI API to analyze an image URL using a vision-capable model. | Exact payloads, commands, or snippets shown in A C# code example demonstrating how to use the OpenAI API to analyze an image URL using a vision-capable model. |
examples/images-and-vision-openai-api-openai-files-api-nodejs-create-vision-purpo.text | A Node.js code example demonstrating how to use the OpenAI Files API to upload a file with the vision purpose. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the OpenAI Files API to upload a file with the vision purpose. |
examples/images-and-vision-openai-api-openai-api-vision-files-create-python.text | A Python script demonstrating how to use the OpenAI Files API to upload a file with the purpose set to vision. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI Files API to upload a file with the purpose set to vision. |
examples/images-and-vision-openai-api-openai-api-vision-csharp-image-analysis-3.text | A C# code example demonstrating how to use the OpenAI API to analyze an image using a vision-capable model. | Exact payloads, commands, or snippets shown in A C# code example demonstrating how to use the OpenAI API to analyze an image using a vision-capable model. |
examples/images-and-vision-openai-api-openai-api-vision-image-url-request.text | A text representation of an OpenAI API request payload using an image URL with specific detail settings for vision capabilities. | Exact payloads, commands, or snippets shown in A text representation of an OpenAI API request payload using an image URL with specific detail settings for vision ca... |
examples/images-and-vision-openai-api-openai-api-vision-input-image-json-payload.text | A JSON payload demonstrating the structure for passing an image URL and detail level to the OpenAI vision API. | Exact payloads, commands, or snippets shown in A JSON payload demonstrating the structure for passing an image URL and detail level to the OpenAI vision API. |
examples/images-and-vision-openai-api-openai-vision-image-patch-calculation-formu.text | The mathematical formula for calculating the original patch count based on image width and height for vision processing. | Exact payloads, commands, or snippets shown in The mathematical formula for calculating the original patch count based on image width and height for vision processing. |
examples/images-and-vision-openai-api-openai-vision-image-shrink-factor-calculati.text | A text representation of the mathematical formula used to calculate the shrink factor for image processing in the OpenAI vision API. | Exact payloads, commands, or snippets shown in A text representation of the mathematical formula used to calculate the shrink factor for image processing in the Ope... |
examples/images-and-vision-openai-api-openai-vision-image-resizing-formula.text | A text representation of the mathematical formula used to calculate the resized patch count for vision model image processing. | Exact payloads, commands, or snippets shown in A text representation of the mathematical formula used to calculate the resized patch count for vision model image pr... |
What This Skill Covers
- Function to encode the image def encodeimage(imagepath): with open(imagepath, "rb") as imagefile: return base64.b64encode(imagefile.read()).decode("utf-8")
- Main sections:
Image input requirements,Choose an image detail level,Model sizing behavior,Calculating costs,Patch-based image tokenization.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/vision
