Get Started
Examples
Concepts
Resources
Integrations
copy markdown
Pass files as base64, binary file object or URL in prompt with URL context understanding.
Pass a publicly accessible file URL directly in the prompt text. The model fetches and reads the file at inference time.
This is great for handling large files that don't fit in the context window.
OpenAI SDK
Vercel AI SDK
LangChain SDK
Follows the same pattern as OpenAI file handling SDK.
Read a local file, encode it as base64, and pass it in the message content using the file content type.
OpenAI SDK
Vercel AI SDK
LangChain SDK
Read a file as a binary Buffer or Blob (TypeScript) / bytes (Python) and pass it directly in the message. The SDK handles serialization automatically.
OpenAI SDK
Vercel AI SDK
LangChain SDK