> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/n4ze3m/page-assist/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI-Compatible APIs

> Connect Page Assist to OpenAI-compatible API providers

Page Assist supports any service that implements the OpenAI API specification. This includes cloud providers, self-hosted services, and other local inference servers.

## Supported Providers

Page Assist includes built-in support for many popular providers:

### Cloud Providers

* **OpenAI** - GPT models (GPT-4, GPT-3.5, etc.)
* **Anthropic (Claude)** - Claude models
* **Google AI** - Gemini models
* **Groq** - Fast inference API
* **DeepSeek** - DeepSeek models
* **Fireworks** - Fast inference platform
* **Together AI** - Open source models
* **OpenRouter** - Unified API gateway
* **Mistral** - Mistral AI models
* **xAI** - Grok models
* **Novita AI** - AI inference platform
* **Hugging Face** - Inference API
* **Infinigence AI** - AI platform
* **SiliconFlow** - AI inference
* **Moonshot** - AI platform
* **BigModel (Zhipu)** - Chinese AI models
* **MiniMax** - Chinese AI models
* **VolcEngine** - ByteDance AI
* **TencentCloud** - Tencent AI
* **AlibabaCloud** - Alibaba AI

### Self-Hosted / Local

* **LLaMA.cpp** - C++ implementation
* **Llamafile** - Single-file executables
* **vLLM** - High-performance inference
* **Ollama** (secondary instances)
* **Vercel AI Gateway** - AI proxy service
* **Chutes** - Custom deployments

## Adding a Provider

<Steps>
  <Step title="Open Settings">
    Click the Page Assist icon in your browser toolbar, then click the Settings icon.
  </Step>

  <Step title="Navigate to OpenAI Compatible API">
    Go to the "OpenAI Compatible API" tab.
  </Step>

  <Step title="Click Add Provider">
    Click the "Add Provider" button.
  </Step>

  <Step title="Select Provider">
    Choose your provider from the dropdown:

    * If listed, select it directly (e.g., "OpenAI", "Anthropic", "Groq")
    * If not listed, select "Custom"
  </Step>

  <Step title="Enter Configuration">
    Provide the required information:

    <CodeGroup>
      ```text OpenAI theme={null}
      Base URL: https://api.openai.com/v1
      API Key: sk-...
      ```

      ```text Anthropic theme={null}
      Base URL: https://api.anthropic.com/v1
      API Key: sk-ant-...
      ```

      ```text Groq theme={null}
      Base URL: https://api.groq.com/openai/v1
      API Key: gsk_...
      ```

      ```text Custom Provider theme={null}
      Base URL: https://your-api.example.com/v1
      API Key: your-api-key (if required)
      ```
    </CodeGroup>
  </Step>

  <Step title="Add Models (if required)">
    Some providers require manual model entry:

    * **Auto-detected**: Ollama, LM Studio, LLaMA.cpp, Llamafile, vLLM
    * **Manual entry**: Most cloud providers

    For manual entry, click "Add Model" and enter model names like:

    * `gpt-4-turbo`
    * `claude-3-5-sonnet-20241022`
    * `llama-3.1-70b-versatile`
  </Step>

  <Step title="Save Configuration">
    Click "Save" to store your provider configuration.
  </Step>
</Steps>

## Provider-Specific Setup

### OpenAI

<Steps>
  <Step title="Get API Key">
    1. Visit [platform.openai.com](https://platform.openai.com)
    2. Sign in or create an account
    3. Navigate to API Keys
    4. Create a new API key
  </Step>

  <Step title="Configure in Page Assist">
    * **Base URL**: `https://api.openai.com/v1`
    * **API Key**: Your OpenAI API key (starts with `sk-`)
    * **Models**: `gpt-4-turbo`, `gpt-4o`, `gpt-3.5-turbo`, etc.
  </Step>
</Steps>

### Anthropic (Claude)

<Steps>
  <Step title="Get API Key">
    1. Visit [console.anthropic.com](https://console.anthropic.com)
    2. Sign in or create an account
    3. Navigate to API Keys
    4. Create a new API key
  </Step>

  <Step title="Configure in Page Assist">
    * **Base URL**: `https://api.anthropic.com/v1`
    * **API Key**: Your Anthropic API key (starts with `sk-ant-`)
    * **Models**: `claude-3-5-sonnet-20241022`, `claude-3-opus-20240229`, etc.
  </Step>
</Steps>

### Groq

<Steps>
  <Step title="Get API Key">
    1. Visit [console.groq.com](https://console.groq.com)
    2. Sign in with your account
    3. Navigate to API Keys
    4. Create a new API key
  </Step>

  <Step title="Configure in Page Assist">
    * **Base URL**: `https://api.groq.com/openai/v1`
    * **API Key**: Your Groq API key
    * **Models**: `llama-3.1-70b-versatile`, `mixtral-8x7b-32768`, etc.
  </Step>
</Steps>

### LLaMA.cpp Server

<Steps>
  <Step title="Start LLaMA.cpp Server">
    Run the LLaMA.cpp server with OpenAI API compatibility:

    ```bash theme={null}
    ./server -m model.gguf --port 8080
    ```
  </Step>

  <Step title="Configure in Page Assist">
    * **Provider**: Select "LLaMA.cpp"
    * **Base URL**: `http://localhost:8080/v1` (or your custom URL)
    * **API Key**: Not required for local instances
    * **Models**: Auto-detected from running server
  </Step>
</Steps>

### vLLM

<Steps>
  <Step title="Start vLLM Server">
    Launch vLLM with OpenAI-compatible API:

    ```bash theme={null}
    python -m vllm.entrypoints.openai.api_server \
      --model meta-llama/Llama-2-7b-hf \
      --port 8000
    ```
  </Step>

  <Step title="Configure in Page Assist">
    * **Provider**: Select "vLLM"
    * **Base URL**: `http://localhost:8000/v1`
    * **API Key**: Not required for local instances
    * **Models**: Auto-detected
  </Step>
</Steps>

### Custom Provider

For any unlisted OpenAI-compatible service:

<Steps>
  <Step title="Select Custom">
    Choose "Custom" from the provider dropdown.
  </Step>

  <Step title="Enter Details">
    * **Provider Name**: Give it a recognizable name
    * **Base URL**: Your API endpoint (must end with `/v1`)
    * **API Key**: If required by your service
  </Step>

  <Step title="Add Models">
    Manually add model names or let Page Assist attempt auto-detection.
  </Step>
</Steps>

## Model Management

### Auto-Detection

The following providers support automatic model detection:

* Ollama (secondary instances)
* LM Studio
* LLaMA.cpp
* Llamafile
* vLLM

Page Assist will automatically fetch available models when you save the provider.

### Manual Model Entry

For most cloud providers, you need to manually add models:

1. After saving the provider, click "Add Model"
2. Enter the exact model identifier
3. Optionally specify if it's a chat or embedding model
4. Save the model

### Model Types

Specify the model type for proper functionality:

* **Chat Models**: For conversations (GPT-4, Claude, etc.)
* **Embedding Models**: For RAG features (text-embedding-ada-002, etc.)

## Authentication

### API Keys

Most cloud providers require API keys:

```text theme={null}
OpenAI: sk-...
Anthropic: sk-ant-...
Groq: gsk_...
```

API keys are stored securely in your browser's extension storage.

### Custom Headers

Some providers require custom headers:

1. In provider settings, expand "Advanced Options"
2. Add custom headers as key-value pairs:
   ```
   Key: X-Custom-Header
   Value: your-value
   ```

### Bearer Tokens

For services using bearer tokens:

1. Enter the token in the "API Key" field
2. Or add a custom header: `Authorization: Bearer your-token`

## Troubleshooting

### Connection Failed

<Steps>
  <Step title="Verify Base URL">
    Ensure the URL is correct and includes `/v1` at the end (if required).
  </Step>

  <Step title="Check API Key">
    Verify your API key is valid and has sufficient credits/permissions.
  </Step>

  <Step title="Test Endpoint">
    Use curl or Postman to test the endpoint directly:

    ```bash theme={null}
    curl https://api.openai.com/v1/models \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```
  </Step>

  <Step title="Check CORS">
    Some self-hosted services may need CORS configuration to work with browser extensions.
  </Step>
</Steps>

### Models Not Loading

1. Check if models need manual entry for your provider
2. Verify the API endpoint supports `/v1/models` for auto-detection
3. Try manually adding model names
4. Check API key permissions

### Authentication Errors

1. Verify API key format is correct
2. Check for extra spaces in the API key
3. Ensure the API key has necessary permissions
4. Verify the API key hasn't expired

### Rate Limiting

If you encounter rate limit errors:

1. Wait before sending more requests
2. Check your provider's rate limits
3. Consider upgrading your plan
4. Use a different provider for high-volume usage

## Best Practices

1. **Secure Your API Keys**: Never share your API keys publicly
2. **Monitor Usage**: Track API usage to avoid unexpected charges
3. **Test with Small Models**: Start with smaller/cheaper models for testing
4. **Set Usage Limits**: Configure spending limits in your provider's dashboard
5. **Use Multiple Providers**: Distribute usage across providers for reliability
6. **Keep Keys Rotated**: Regularly rotate API keys for security

## Provider Comparison

| Provider                 | Strengths                 | Best For                    |
| ------------------------ | ------------------------- | --------------------------- |
| OpenAI                   | Most capable models       | Complex tasks, reasoning    |
| Anthropic                | Long context, safety      | Document analysis, safe AI  |
| Groq                     | Ultra-fast inference      | Speed-critical applications |
| Local (Ollama/LM Studio) | Privacy, no costs         | Private data, development   |
| Together AI              | Open models, good pricing | Open source model access    |
| OpenRouter               | Access to many models     | Model variety, fallbacks    |

## Next Steps

* Learn about [Ollama setup](/providers/ollama)
* Explore [LM Studio integration](/providers/lm-studio)
* Set up [Chrome AI](/providers/chrome-ai)
* Configure [Knowledge Base features](/features/knowledge-base)
