Skip to content

Files API

The /v1/files endpoint handles large images, audio, PDFs, and reusable media across requests.

Terminal window
curl https://llmtr.com/v1/files \
-H "Authorization: Bearer llmtr-your_key" \
-F "provider=google" \
-F "purpose=user_upload" \
-F "file=@./invoice.pdf"
ValueWhen to use
user_uploadGeneral-purpose upload. PDFs, images or audio referenced from chat via input_file.file_id.
vision_referenceReference images sent to /v1/images/generations via file_id or file_ids. Try-on, image-to-image and image-merging flows use this purpose.

Defaults to user_upload when omitted. Any other value returns 400 invalid_request.

Only google is currently supported. Defaults to google when omitted; any other value returns 400 unsupported_provider.

Response:

{
"id": "file_xxx",
"object": "file",
"provider": "google",
"purpose": "user_upload",
"filename": "invoice.pdf",
"bytes": 184732,
"mime_type": "application/pdf",
"created_at": 1739200000
}

Reference the returned file_id in any content-part:

{
"model": "google/gemini-2.5-flash",
"messages": [
{
"role": "user",
"content": [
{ "type": "text", "text": "Summarize this PDF." },
{
"type": "input_file",
"input_file": {
"file_id": "file_xxx",
"mime_type": "application/pdf"
}
}
]
}
]
}
CategoryTypes
Imageimage/jpeg, image/png, image/webp, image/heic
Audioaudio/wav, audio/mp3, audio/flac, audio/ogg, audio/webm
Videovideo/mp4, video/webm, video/quicktime
Documentapplication/pdf
  • Max 20 MB per file (varies by provider)
  • Uploaded files are deleted automatically 7 days after upload
  • The same file_id can be reused across models of the same provider

Uploaded files are managed by LLMTR; you only see the canonical file_id. Use this identifier directly in input_file.file_id, or in the file_id and file_ids fields of /v1/images/generations.