Skip to main content

File Attachments

Send documents, PDFs, and files to LLMs for analysis and processing.

Overview

Eden AI V3 LLM endpoints support file attachments, enabling you to:
  • Analyze PDF documents
  • Process text files
  • Extract data from structured documents
  • Summarize reports and papers
  • Answer questions about document content
File support varies by provider, with some supporting advanced document understanding and others focused on text extraction.

Supported File Formats

FormatExtensionOpenAIAnthropicGoogleUse Cases
PDF.pdfReports, invoices, contracts
Text.txtLogs, code, plain text
Word.docxDocuments, reports
Rich Text.rtf--Formatted documents

File Input Methods

V3 provides three ways to send files to LLMs: Upload files once, reference multiple times:

2. File URL

Use publicly accessible file URLs:

3. Base64 File Data

Encode files directly in the request:

Common Use Cases

Document Summarization

Extract key points from long documents:

Question Answering on Documents

Ask specific questions about document content:

Data Extraction

Extract structured data from documents:

Contract Analysis

Review legal documents and contracts:

Code Review

Analyze code files and provide feedback:

Provider Capabilities

OpenAI (GPT-4o, GPT-4-turbo)

Strengths:
  • Fast document processing
  • Good for structured extraction
  • Reliable with common formats
  • Strong multi-page PDF handling
Limitations:
  • Max file size: 512 MB
  • Best for text-heavy documents
Example:
"model": "openai/gpt-4o"

Anthropic (Claude 3 Family)

Strengths:
  • Excellent reasoning about documents
  • Superior for complex analysis
  • Great for legal/technical documents
  • Detailed, thoughtful responses
Limitations:
  • Max file size: 10 MB (per file)
  • Slightly slower than OpenAI
Example:
"model": "anthropic/claude-3-5-sonnet-20241022"

Google (Gemini 1.5)

Strengths:
  • Massive context window (2GB+ files)
  • Best for very large documents
  • Fast processing (Flash variant)
  • Multi-document analysis
Limitations:
  • May be less detailed on complex reasoning
Example:
"model": "google/gemini-1.5-pro"

File Management Best Practices

Upload Once, Use Multiple Times

Files uploaded to /v3/upload persist for 7 days:

File Size Optimization

For large files, consider preprocessing:

Handling Expiration

Track and refresh expired files:

Advanced Patterns

Multi-Document Analysis

Analyze multiple documents together:

Conversational Document Analysis

Build multi-turn conversations about documents:

Error Handling

Common File Errors

File too large:
{
  "error": {
    "code": "file_too_large",
    "message": "File size exceeds maximum allowed (512 MB for this provider)"
  }
}
Unsupported format:
{
  "error": {
    "code": "unsupported_file_type",
    "message": "File type .xlsx is not supported for this provider"
  }
}
File not found:
{
  "error": {
    "code": "file_not_found",
    "message": "File with ID 550e8400-e29b-41d4-a716-446655440000 not found or expired"
  }
}

Robust Error Handling

Next Steps