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...
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/inputs-workflow-guide.md | A 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.bash | A 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.javascript | A 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.python | A 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.csharp | A 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.bash | A 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.javascript | A 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.python | A 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.csharp | A 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.bash | A 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.javascript | A 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.python | A 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
- 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/file-inputs.md
