Document Reading (PDFs & more)
Send PDFs and text-family documents to Gemini models via the OpenAI-compatible `file` content block.

LLM Gateway now accepts document attachments on chat completions through OpenAI's file content block. Send a PDF (or other supported file type) as base64 file_data and the gateway forwards it to the model.
1curl -X POST "https://api.llmgateway.io/v1/chat/completions" \2 -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model": "gemini-2.5-flash",6 "messages": [{7 "role": "user",8 "content": [9 { "type": "text", "text": "Summarize this document." },10 { "type": "file", "file": {11 "filename": "report.pdf",12 "file_data": "data:application/pdf;base64,JVBERi0xLjQK..."13 }}14 ]15 }]16 }'1curl -X POST "https://api.llmgateway.io/v1/chat/completions" \2 -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "model": "gemini-2.5-flash",6 "messages": [{7 "role": "user",8 "content": [9 { "type": "text", "text": "Summarize this document." },10 { "type": "file", "file": {11 "filename": "report.pdf",12 "file_data": "data:application/pdf;base64,JVBERi0xLjQK..."13 }}14 ]15 }]16 }'- Initial support on Google Gemini via Google AI Studio
- New
documentcapability flag on models — filter at /models?filters=1&document=true - Playground accepts file uploads and persists them across sessions and shares
- Clean
400errors when a model doesn't accept the MIME type, instead of opaque upstream failures