Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/images-and-vision-openai-api-workflow-guide.mdA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textA 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.textThe 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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