> ## 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.

# Choose Your Integration

> Select the integration method that matches your current setup and requirements.

## 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

<CodeGroup>
  ```typescript TypeScript theme={null}
  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
  ```

  ```python Python theme={null}
  from openfiles_ai import OpenAI  # Change this line

  ai = OpenAI(
      api_key='sk-...',
      openfiles_api_key='oa-...'  # Add this line  
  )
  # Everything else stays the same
  ```
</CodeGroup>

* ✅ Minimal code changes
* ✅ Automatic file operations
* ✅ Works with existing OpenAI code
* ❌ Currently limited to OpenAI models

[OpenAI Integration Guide →](/guides/openai-integration)

### Tools

**When to use**: You're using Anthropic Claude, multiple AI providers, or need framework flexibility

<CodeGroup>
  ```typescript TypeScript theme={null}
  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)
  ```

  ```python Python theme={null}
  from openfiles_ai.tools import OpenFilesTools
  import anthropic

  tools = OpenFilesTools(api_key='oa-...')
  client = anthropic.Anthropic(api_key='ant-...')

  # Use with Anthropic Claude
  response = client.messages.create(
      model='claude-sonnet-4-20250514',
      messages=[...],
      tools=tools.anthropic.definitions
  )

  # Process file operations
  processed = await tools.anthropic.process_tool_calls(response)
  ```
</CodeGroup>

* ✅ Works with OpenAI, Anthropic, and more
* ✅ Provider-specific optimizations
* ✅ Mix with your custom tools
* ❌ Requires manual tool handling

[Tools Integration Guide →](/guides/tools-integration)

### Core SDK & REST API

**When to use**: You need direct control or don't use AI frameworks

<CodeGroup>
  ```typescript TypeScript theme={null}
  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' })
  ```

  ```python Python theme={null}
  from openfiles_ai import OpenFilesClient

  client = OpenFilesClient(api_key='oa-...')

  # Direct file operations  
  await client.write_file(path='report.md', content='Hello')
  content = await client.read_file(path='report.md')
  ```
</CodeGroup>

* ✅ No AI framework required
* ✅ Full control over operations
* ✅ Can integrate anywhere
* ❌ No automatic AI integration

**REST API Example:**

```bash theme={null}
# 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 →](/guides/core-client) | [API Reference →](/api-reference)

## Next Steps

Still unsure? Start with the [Quickstart](/getting-started/quickstart) using OpenAI Integration if you're using OpenAI, or the Core Client for other frameworks.
