---
title: "AI Providers"
description: "Connect GitHub Copilot, OpenAI, and other AI providers for your cloud coding agents."
section: "get-started"
url: "https://forkline.dev/docs/getting-started/ai-providers"
markdown: "https://forkline.dev/docs/getting-started/ai-providers.md"
source: "src/content/docs/getting-started/ai-providers.md"
---

# AI Providers

Connect AI providers to power your coding agents in Forkline.

## Overview

Forkline supports the same provider ecosystem as OpenCode through [models.dev](https://models.dev). You can connect providers with OAuth when available, or add API keys for direct access to their models.

Forkline supports:

- **GitHub Copilot** with OAuth
- **OpenAI** with OAuth or API key
- **Anthropic, xAI, Mistral, Groq, Cohere, Perplexity, DeepSeek, Amazon Bedrock, Azure OpenAI,** and many more with API keys
- **Custom OpenAI-compatible providers** for managed gateways and enterprise endpoints

> **Info**: Your API keys are stored securely with per-user isolation. They're never exposed in logs.

![Add AI provider modal](https://forkline.dev/docs/screenshots/ai-providers/add-provider-modal.webp)

## Connection Methods

Choose the setup that matches your provider:

| Provider | Sign-in method | Best for |
|----------|----------------|----------|
| GitHub Copilot | OAuth | Teams already using Copilot subscriptions |
| OpenAI | OAuth or API key | ChatGPT/OpenAI users who want fast setup or direct API billing |
| Most other providers | API key | Anthropic, xAI, Mistral, Groq, Cohere, and similar services |
| Custom provider | API key + base URL | Managed OpenAI-compatible gateways and enterprise endpoints |

> **Note**: Forkline also includes free OpenCode Zen models. Adding your own provider gives you access to the models and billing account you already use.

## GitHub Copilot

GitHub Copilot is the fastest way to connect a coding-focused provider through OAuth:

1. Go to **Git Providers** and scroll to **AI Providers**
2. Click **Add Provider**
3. Select **GitHub Copilot**
4. Click **Connect with OAuth**
5. Complete the GitHub authorization flow
6. Return to Forkline and choose a model

**Best for:**

- Teams already paying for GitHub Copilot
- Quick setup without managing API keys
- Coding workflows where Copilot model access is already approved

### Requirements

| Requirement | Why it matters |
|-------------|----------------|
| GitHub account | Used for OAuth sign-in |
| Active Copilot plan | Required for Copilot model access |
| Copilot enabled for your account or organization | Ensures the connected account can use the models |

## OpenAI

OpenAI supports both OAuth and API key authentication in Forkline.

### Connect OpenAI with OAuth

1. Go to **Git Providers** and scroll to **AI Providers**
2. Click **Add Provider**
3. Select **OpenAI**
4. Choose **Connect with OAuth**
5. Sign in to your OpenAI account and approve access
6. Return to Forkline and set your preferred model

**Best for:**

- Fast account setup
- Users already signed in to OpenAI
- Reducing manual credential handling

### Connect OpenAI with an API key

1. Open **Git Providers**
2. Click **Add Provider**
3. Select **OpenAI**
4. Paste your API key
5. Save the provider

Use an API key if you want direct control over billing, organization settings, or project-scoped credentials.

## API Key Providers

Most providers use an API key instead of OAuth:

- Anthropic
- OpenAI
- xAI
- Mistral
- Groq
- Cohere
- Perplexity
- DeepSeek
- Amazon Bedrock
- Azure OpenAI
- [and many more on models.dev](https://models.dev)

To add an API key provider:

1. Go to **Git Providers**
2. Click **Add Provider**
3. Select the provider
4. Paste your API key
5. Save the provider

**Best for:**

- Providers that do not offer OAuth in Forkline
- Teams that want explicit billing ownership
- Enterprise accounts with provider-managed API access

## Custom Providers

Forkline can also connect to managed OpenAI-compatible endpoints.

Use this when you have a provider or gateway that exposes an OpenAI-compatible API, such as Azure OpenAI or an enterprise AI gateway.

1. Go to **Git Providers**
2. Click **Add Provider**
3. Select **Custom Provider**
4. Enter the provider name, base URL, and API key
5. Add one or more model IDs
6. Save the provider

```yaml
# Example managed OpenAI-compatible endpoint
Provider: Azure OpenAI
Base URL: https://your-resource.openai.azure.com/openai/deployments/your-deployment
API Key: your-azure-key
Model: gpt-4.1
```

## Setting a Default Model

After connecting a provider, set the model Forkline should use by default.

### Account-level default

1. Go to **Settings**
2. Find **Default Model**
3. Select your preferred model

### Repository override

1. Navigate to **Repositories**
2. Open repository settings
3. Choose a different default model for that repository

## Model Selection in Runners

You can override the default model each time you start a runner:

1. Click **Start runner**
2. Use the **Model** dropdown
3. Select a different model

## Credential Sharing and Metadata

Forkline stores your provider credentials with per-user isolation and stable identity. You can create multiple credentials per provider (for example, separate API keys for different projects) and switch between them.

**Labels and metadata**: Credential labels are display-only metadata, not identity. You can rename credentials without affecting their identity or active status. Inactive credentials remain in your inventory until explicitly deleted.

**Deletes and rotation**: When you delete the active credential, Forkline automatically promotes another credential for that provider (if one exists). To rotate a credential, add the new one first, activate it, then delete the old one. Bulk delete removes all credentials for a provider.

**OAuth concurrency limitation**: When the same OAuth credential is used across multiple runners, concurrent token refresh attempts may race. This is a known limitation of distributed OAuth refresh coordination. For critical workflows, consider using independent credentials per runner or API keys where available.

## Troubleshooting

### OAuth option not available

If you do not see an OAuth button for a provider, that provider must be connected with an API key in Forkline.

### OpenAI connected but no models appear

Check that your OpenAI account or API project has access to the model you want to use.

### GitHub Copilot authentication succeeds but models fail

Verify that the GitHub account you connected has an active Copilot plan and that Copilot access is enabled for your user or organization.

## Next Steps

- [Start a runner](https://forkline.dev/docs/runners/starting) to begin coding
- [Connect a git provider](https://forkline.dev/docs/getting-started/connectors) to access repositories
- [Configure webhooks](https://forkline.dev/docs/automation/webhooks) for automation
