Decision Matrix

Your Current SetupRecommended PathWhy Choose ThisSetup Time
Already using OpenAI SDKOpenAI IntegrationDrop-in replacement, minimal changes2 minutes
Using other AI providers (Claude, Anthropic, etc.)Tools IntegrationFramework-agnostic, works with any AI5 minutes
No AI framework or want direct controlCore ClientFull control, no AI dependencies5 minutes
Building custom API or prefer REST callsREST APIMaximum flexibility, any language5 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 →

Tools

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.