Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

File inputs | OpenAI API

Teaches how to upload and use PDF files as inputs for OpenAI API models, including file handling and integration into prompts.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

File inputs | OpenAI API

Teaches how to upload and use PDF files as inputs for OpenAI API models, including file handling and integration into prompts.

When To Use

Use when you need to upload PDF documents to the OpenAI API and include them as context for model reasoning or analysis.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/inputs-openai-api-workflow-guide.mdA guide explaining how OpenAI models process file inputs via Base64 encoding, file IDs, or external URLs, including supported file types and limitations.Questions about a guide explaining how OpenAI models process file inputs via Base64 encoding, file IDs, or external URLs, including s...
examples/inputs-openai-api-openai-api-pdf-input-curl.textA curl command demonstrating how to send a PDF file as an input type within an OpenAI API request.Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a PDF file as an input type within an OpenAI API request.
examples/inputs-openai-api-openai-api-pdf-input-nodejs.textA Node.js code snippet demonstrating how to pass a PDF file URL as an input type within an OpenAI API request.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to pass a PDF file URL as an input type within an OpenAI API request.
examples/inputs-openai-api-openai-api-python-pdf-input.textA Python code snippet demonstrating how to use the OpenAI client to send a PDF file via a file URL for analysis.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the OpenAI client to send a PDF file via a file URL for analysis.
examples/inputs-openai-api-openai-api-csharp-pdf-upload.textA C# code example demonstrating how to upload a PDF file to the OpenAI API using the OpenAI.Files namespace.Exact payloads, commands, or snippets shown in A C# code example demonstrating how to upload a PDF file to the OpenAI API using the OpenAI.Files namespace.
examples/inputs-openai-api-openai-api-upload-curl.textA curl command demonstrating how to upload a PDF file to the OpenAI API using the files endpoint with a specified purpose.Exact payloads, commands, or snippets shown in A curl command demonstrating how to upload a PDF file to the OpenAI API using the files endpoint with a specified pur...
examples/inputs-openai-api-openai-api-nodejs-pdf-input.textA Node.js code snippet demonstrating how to upload a PDF file and include it as an input file in an OpenAI API request.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to upload a PDF file and include it as an input file in an OpenAI API request.
examples/inputs-openai-api-openai-api-python-pdf-upload-userdata.textA Python script using the OpenAI client to upload a PDF file for the userdata purpose and include it in a model request.Exact payloads, commands, or snippets shown in A Python script using the OpenAI client to upload a PDF file for the userdata purpose and include it in a model request.
examples/inputs-openai-api-openai-api-csharp-upload.textA C# code example demonstrating how to upload a PDF file to the OpenAI API using the OpenAIFileClient.Exact payloads, commands, or snippets shown in A C# code example demonstrating how to upload a PDF file to the OpenAI API using the OpenAIFileClient.
examples/inputs-openai-api-openai-api-upload-curl-2.textA curl command demonstrating how to upload a PDF file to the OpenAI API using the files endpoint with the userdata purpose.Exact payloads, commands, or snippets shown in A curl command demonstrating how to upload a PDF file to the OpenAI API using the files endpoint with the userdata pu...
examples/inputs-openai-api-openai-api-nodejs-pdf-input-2.textA Node.js code snippet demonstrating how to upload a PDF file and include it in a chat completion request using the OpenAI client.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to upload a PDF file and include it in a chat completion request using the O...
examples/inputs-openai-api-openai-api-python-pdf-input-2.textA Python code snippet demonstrating how to upload a PDF file and use its file ID within a chat completion request using the OpenAI client.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to upload a PDF file and use its file ID within a chat completion request usi...
examples/inputs-openai-api-openai-api-pdf-input-curl-request.textA curl command demonstrating how to send a base64 encoded PDF file as an input to the OpenAI API responses endpoint.Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a base64 encoded PDF file as an input to the OpenAI API responses endpoint.
examples/inputs-openai-api-openai-api-nodejs-pdf-input-3.textA Node.js code snippet demonstrating how to read a PDF file and pass it as a base64-encoded input to the OpenAI API.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to read a PDF file and pass it as a base64-encoded input to the OpenAI API.
examples/inputs-openai-api-openai-api-python-pdf-input-3.textA Python code snippet demonstrating how to encode a PDF file into base64 and pass it as an input file to the OpenAI API.Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to encode a PDF file into base64 and pass it as an input file to the OpenAI API.
examples/inputs-openai-api-openai-api-chat-completions-pdf-input-curl.textA curl command demonstrating how to send a base64 encoded PDF file within a chat completions request to the OpenAI API.Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a base64 encoded PDF file within a chat completions request to the OpenAI API.
examples/inputs-openai-api-openai-api-nodejs-pdf-input-4.textA Node.js code snippet demonstrating how to read a PDF file and pass it as a file input to the OpenAI Chat Completions API.Exact payloads, commands, or snippets shown in A Node.js code snippet demonstrating how to read a PDF file and pass it as a file input to the OpenAI Chat Completion...
examples/inputs-openai-api-openai-api-python-pdf-input-4.textA Python script demonstrating how to encode a PDF file into base64 and pass it as a file input to the OpenAI Chat Completions API.Exact payloads, commands, or snippets shown in A Python script demonstrating how to encode a PDF file into base64 and pass it as a file input to the OpenAI Chat Com...

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 ( /v...
  • 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/pdf-files