llms.txt Content
# FileGraph API
> Document conversion and processing API. Extract text from any document, convert between formats, and manipulate PDFs.
Base URL: https://api.filegraph.ai
## Authentication
All endpoints require an API key in the `X-API-Key` header:
```
X-API-Key: your-api-key
```
Get your API key at https://filegraph.ai/dashboard
## Quick Start
```python
httpx.post("https://api.filegraph.ai/any/to-text",
headers={
"X-API-Key": "YOUR_API_KEY"
},
params={
"ocr_language": "eng",
"ocr_fallback": "true"
},
files=[
("file", open("document.pdf", "rb"))
]
)
```
# --- Production Usage ---
from __future__ import annotations
from pathlib import Path
from typing import Any
import time
import random
import httpx
from pydantic import BaseModel, Field, ConfigDict, field_validator
class ExtractTextResponse(BaseModel):
"""
Response model for the /any/to-text endpoint.
"""
text: str = Field(description="Extracted text content")
format_detected: str = Field(description="Detected input format (e.g., 'pdf', 'docx', 'image')")
word_count: int = Field(description="Number of words extracted")
char_count: int = Field(description="Number of characters extracted")
used_ocr: bool = Field(description="Whether OCR was used for extraction")
metadata: dict[str, Any] | None = Field(default=None, description="Additional format-specific metadata")
model_config = ConfigDict(strict=True)
class ExtractTextRequest(BaseModel):
"""
Request model for the /any/to-text endpoint.
Parameters:
- ocr_language: Language code for OCR processing (default 'eng')
- ocr_fallback: Whether to fallback to OCR if text extraction fails (default True)
- file: Path to the document file to extract text from (must exist)
"""
ocr_language: str = Field(default="eng", description="Language code for OCR processing")
ocr_fallback: bool = Field(default=True, description="Whether to fallback to O
OpenAPI Spec (preview)
{"openapi":"3.1.0","info":{"title":"DocConvert API","description":"\nDocument conversion and processing API.\n\n## Skip the Docs — Use Our MCP Server\n\nYou don't need to read through these docs manually. Connect your AI coding assistant (Claude, Cursor, Windsurf, etc.) to our **MCP server** and let it explore the API for you.\n\nYour AI will:\n- Discover available endpoints and their capabilities\n- Generate working code examples tailored to your use case\n- Handle authentication and error pa