PDF Inputs
How to send PDFs to Infron AI models
Using PDF URLs
import requests
import json
url = "https://llm.onerouter.pro/api/v1/chat/completions"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What are the main points in this document?"
},
{
"type": "file",
"file": {
"filename": "document.pdf",
"file_data": "https://domain.org/file.pdf"
}
},
]
}
]
payload = {
"model": "{{MODEL}}",
"messages": messages
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Using Base64 Encoded PDFs
Last updated