Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

File inputs

Teaches how to provide files to OpenAI models using three distinct methods: Base64-encoded data, file IDs from the Files API, or external URLs, including specific handling for PDFs, text files, and spreadsheet augment...

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

File inputs

Teaches how to provide files to OpenAI models using three distinct methods: Base64-encoded data, file IDs from the Files API, or external URLs, including specific handling for PDFs, text files, and spreadsheet augment...

When To Use

Use when you need to pass documents, spreadsheets, or images to a model via the Responses API using file IDs, Base64 encoding, or external links.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/inputs-workflow-guide.mdA guide explaining how OpenAI models process file inputs via Base64-encoded data, file IDs, or external URLs, including supported file types and limitations.Questions about a guide explaining how OpenAI models process file inputs via Base64-encoded data, file IDs, or external URLs, includi...
examples/inputs-openai-api-inputs-curl-request.bashA curl command demonstrating how to send a request to the OpenAI API using file inputs within a content array.Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a request to the OpenAI API using file inputs within a content array.
examples/inputs-openai-inputs-javascript-response-create.javascriptA JavaScript code example demonstrating how to use the OpenAI client to create a response using a file URL as an input type.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the OpenAI client to create a response using a file URL as an inpu...
examples/inputs-openai-api-python-input-request.pythonA Python script demonstrating how to send a request to the OpenAI API using a file URL as an input type.Exact payloads, commands, or snippets shown in A Python script demonstrating how to send a request to the OpenAI API using a file URL as an input type.
examples/inputs-openai-inputs-csharp-upload.csharpA C# code example demonstrating how to use the OpenAI client to upload a PDF file for use with file inputs.Exact payloads, commands, or snippets shown in A C# code example demonstrating how to use the OpenAI client to upload a PDF file for use with file inputs.
examples/inputs-openai-api-upload-and-response-curl.bashA bash script using curl to upload a file for userdata purpose and subsequently send a request using that file input.Exact payloads, commands, or snippets shown in A bash script using curl to upload a file for userdata purpose and subsequently send a request using that file input.
examples/inputs-openai-api-javascript-input-upload-and-query.javascriptA JavaScript example demonstrating how to upload a file to the OpenAI API and include its file ID in a model response request.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to upload a file to the OpenAI API and include its file ID in a model response...
examples/inputs-openai-api-python-input-creation-and-query.pythonA Python script demonstrating how to upload a file to OpenAI and include its file ID in a model request using the inputfile type.Exact payloads, commands, or snippets shown in A Python script demonstrating how to upload a file to OpenAI and include its file ID in a model request using the inp...
examples/inputs-openai-inputs-csharp-upload-2.csharpA C# code example demonstrating how to upload a file to the OpenAI API using the OpenAIFileClient.Exact payloads, commands, or snippets shown in A C# code example demonstrating how to upload a file to the OpenAI API using the OpenAIFileClient.
examples/inputs-openai-api-inputs-curl-request-2.bashA curl command demonstrating how to send a base64 encoded PDF file as an input within a JSON request body to the OpenAI API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a base64 encoded PDF file as an input within a JSON request body to the Open...
examples/inputs-openai-api-javascript-input-base64-upload.javascriptA JavaScript example demonstrating how to read a local PDF file and send it to the OpenAI API using base64 encoding within a responses create request.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to read a local PDF file and send it to the OpenAI API using base64 encoding w...
examples/inputs-openai-inputs-python-base64-upload.pythonA Python script demonstrating how to encode a PDF file into a base64 string to be used as a file input in an OpenAI API request.Exact payloads, commands, or snippets shown in A Python script demonstrating how to encode a PDF file into a base64 string to be used as a file input in an OpenAI A...

What This Skill Covers

  • OpenAI models can accept files as inputfile items. In the Responses API, you can send a file as Base64-encoded data, a file ID returned by the Files API (/v1...
  • Main sections: How it works, Non-PDF image and chart limitations, How spreadsheet augmentation works, Accepted file types, File URLs.

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/file-inputs.md