Documentation Index
Fetch the complete documentation index at: https://docs.openfiles.ai/llms.txt
Use this file to discover all available pages before exploring further.
Decision Matrix
| Your Current Setup | Recommended Path | Why Choose This | Setup Time |
|---|
| Already using OpenAI SDK | OpenAI Integration | Drop-in replacement, minimal changes | 2 minutes |
| Using other AI providers (Claude, Anthropic, etc.) | Tools Integration | Framework-agnostic, works with any AI | 5 minutes |
| No AI framework or want direct control | Core Client | Full control, no AI dependencies | 5 minutes |
| Building custom API or prefer REST calls | REST API | Maximum flexibility, any language | 5 minutes |
Integration Options
OpenAI Integration
When to use: You’re already using the OpenAI SDK
import OpenAI from '@openfiles-ai/sdk/openai' // Change this line
const ai = new OpenAI({
apiKey: 'sk-...',
openFilesApiKey: 'oa-...' // Add this line
})
// Everything else stays the same
- ✅ Minimal code changes
- ✅ Automatic file operations
- ✅ Works with existing OpenAI code
- ❌ Currently limited to OpenAI models
OpenAI Integration Guide →
When to use: You’re using Anthropic Claude, multiple AI providers, or need framework flexibility
import { OpenFilesTools } from '@openfiles-ai/sdk/tools'
import Anthropic from '@anthropic-ai/sdk'
const tools = new OpenFilesTools({ apiKey: 'oa-...' })
const anthropic = new Anthropic({ apiKey: 'ant-...' })
// Use with Anthropic Claude
const response = await anthropic.messages.create({
model: 'claude-sonnet-4-20250514',
messages: [...],
tools: tools.anthropic.definitions
})
// Process file operations
const processed = await tools.anthropic.processToolCalls(response)
- ✅ Works with OpenAI, Anthropic, and more
- ✅ Provider-specific optimizations
- ✅ Mix with your custom tools
- ❌ Requires manual tool handling
Tools Integration Guide →
Core SDK & REST API
When to use: You need direct control or don’t use AI frameworks
import { OpenFilesClient } from '@openfiles-ai/sdk/core'
const client = new OpenFilesClient({ apiKey: 'oa-...' })
// Direct file operations
await client.writeFile({ path: 'report.md', content: 'Hello' })
const content = await client.readFile({ path: 'report.md' })
- ✅ No AI framework required
- ✅ Full control over operations
- ✅ Can integrate anywhere
- ❌ No automatic AI integration
REST API Example:
# Create a file
curl -X POST https://api.openfiles.ai/functions/v1/api/files \
-H "x-api-key: oa_your_key" \
-H "Content-Type: application/json" \
-d '{"path": "report.md", "content": "Hello World"}'
# Read a file
curl https://api.openfiles.ai/functions/v1/api/files/report.md \
-H "x-api-key: oa_your_key"
Core Client Guide → | API Reference →
Next Steps
Still unsure? Start with the Quickstart using OpenAI Integration if you’re using OpenAI, or the Core Client for other frameworks.