file or input_audio content part to a message, alongside text and image_url. This works for documents (PDF, and on some models TXT, CSV, DOCX, XLSX) and for audio.
Sending a File
Add a content part withtype: "file" to the content array of a message. Provide the file either as a base64-encoded data URL in file_data, or as a public URL in file_id.
A public URL is accepted in either
file_data or file_id — both fields work the same way for a URL. file_data is the field to use for base64-encoded data.chat.completion object, the same shape you’d get from a text-only request — there’s no separate annotations, file hash, or provider-specific metadata attached to file content.
Supported Formats by Model
PDF input is broadly supported. Support for other document formats depends on the model:
Since support varies by model and can change as providers update their backends, use tag routing to guarantee your request lands on a backend that supports file input, instead of hardcoding a model:
Sending Audio
Audio uses a dedicatedinput_audio content part instead of file. Provide base64-encoded audio data and its format:
input_audio and type: "file" with a data:audio/... data URL) is currently only supported on Gemini models. Use the audio_input tag to route to a backend that supports it:
To have the model generate audio back, see the
modalities and audio parameters on Create Chat Completion.Choosing Models by File Capability
Query/v1/models and filter by the pdf_input or audio_input tags to find models that support the file type you need — see Tag Routing for the full list of capability tags and how to filter or route by them.