> ## Documentation Index
> Fetch the complete documentation index at: https://docs.airun.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud Providers

> Configure AWS, Google, Anthropic, Azure, and Vercel AI providers

Cloud providers offer powerful AI models through APIs, with pay-as-you-go pricing and no local hardware requirements.

## AWS Bedrock

AWS Bedrock provides Claude models through Amazon's infrastructure.

### Configuration

Add to `~/.ai-runner/secrets.sh`:

```bash theme={null}
export AWS_PROFILE="your-profile-name"
export AWS_REGION="us-west-2"
```

### Authentication Methods

AWS Bedrock supports three authentication methods:

#### 1. AWS Bedrock API Key (Recommended)

```bash theme={null}
export AWS_BEARER_TOKEN_BEDROCK="your-bedrock-api-key"
export AWS_REGION="us-west-2"
```

#### 2. AWS Access Keys

```bash theme={null}
export AWS_ACCESS_KEY_ID="your_access_key"
export AWS_SECRET_ACCESS_KEY="your_secret_key"
export AWS_SESSION_TOKEN="your_session_token"  # Optional
export AWS_REGION="us-west-2"
```

#### 3. AWS Profile

```bash theme={null}
export AWS_PROFILE="your-profile-name"
export AWS_REGION="us-west-2"
```

### Usage

```bash theme={null}
# Use default tier (Opus)
ai --aws

# Use specific tier
ai --aws --opus task.md
ai --aws --sonnet task.md
ai --aws --haiku quick-fix.md
```

<Warning>
  **`--fable`/`--best` on Bedrock needs a one-time data-sharing enablement.** Fable 5 is a Mythos-class *Covered Model*: Anthropic retains inputs/outputs for 30 days with human review **on every platform that offers it** (direct API, Pro, Bedrock, Vertex, Azure) — this is a property of the model, not of Bedrock. Bedrock's default mode doesn't share data with the provider, so it won't serve Fable until you enable provider data sharing; until then requests fail mid-session with `400 data retention mode 'default' is not available for this model`.

  There is no console UI — enable it at the account level via the Data Retention API:

  ```bash theme={null}
  curl -X PUT https://bedrock-mantle.<region>.api.aws/v1/data_retention \
    -H "x-api-key: <your-bedrock-api-key>" \
    -H "Content-Type: application/json" \
    -d '{ "mode": "provider_data_share" }'
  ```

  Bedrock-specific caveat: once enabled, Fable traffic **leaves AWS's data/security boundary** (it goes to Anthropic). `--apikey` and `--azure` don't need this step — not because they retain less, but because their standard config already shares with Anthropic. The only way to avoid 30-day retention entirely is to **not use Fable** (stay on `--opus`). See [Anthropic's data-retention policy for Mythos-class models](https://support.claude.com/en/articles/15425996-data-retention-practices-for-mythos-class-models).
</Warning>

### Custom Models

Override default models in `secrets.sh`:

```bash theme={null}
export CLAUDE_MODEL_FABLE_AWS="global.anthropic.claude-fable-5"
export CLAUDE_MODEL_OPUS_AWS="global.anthropic.claude-opus-5"
export CLAUDE_MODEL_SONNET_AWS="global.anthropic.claude-sonnet-5"
export CLAUDE_MODEL_HAIKU_AWS="us.anthropic.claude-haiku-4-5-20251001-v1:0"
export CLAUDE_SMALL_FAST_MODEL_AWS="us.anthropic.claude-haiku-4-5-20251001-v1:0"
```

<Card title="AWS Bedrock Setup" icon="book" href="https://code.claude.com/docs/en/amazon-bedrock">
  Read the complete AWS Bedrock setup guide
</Card>

***

## Google Vertex AI

Google Vertex AI provides Claude models through Google Cloud Platform.

### Configuration

Add to `~/.ai-runner/secrets.sh`:

```bash theme={null}
export ANTHROPIC_VERTEX_PROJECT_ID="your-gcp-project-id"
export CLOUD_ML_REGION="global"
```

### Authentication

Vertex AI supports three authentication methods (in precedence order):

#### 1. Service Account Key File

```bash theme={null}
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
```

#### 2. Application Default Credentials

```bash theme={null}
gcloud auth application-default login
```

#### 3. User Credentials

```bash theme={null}
gcloud auth login
```

### Prerequisites

1. Install Google Cloud SDK: [https://cloud.google.com/sdk/docs/install](https://cloud.google.com/sdk/docs/install)
2. Authenticate with one of the methods above
3. Enable Claude models in Vertex AI Model Garden

### Usage

```bash theme={null}
# Use default tier (Opus)
ai --vertex

# Use specific tier
ai --vertex --opus task.md
ai --vertex --sonnet task.md
ai --vertex --haiku quick-fix.md
```

<Warning>
  **`--fable`/`--best` on Vertex needs a one-time data-sharing enablement.** Fable 5 is a Mythos-class *Covered Model* (30-day retention + human review on every platform that offers it — a model property, not Vertex-specific). Vertex won't serve it until you enable data sharing for the `anthropic` publisher; until then requests fail with `403 ... requires data sharing to be enabled for publisher 'anthropic'`.

  **Enable it** (project-level), either way:

  * **Console (simplest):** open the [Claude Fable 5 model card](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-fable-5) in Vertex AI Model Garden and accept the data-sharing terms.
  * **API:** call `setPublisherModelConfig`, setting the field named in your 403 (`data_sharing_enabled_provider`) to `anthropic`:

    ```bash theme={null}
    curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
      -H "Content-Type: application/json" \
      "https://<region>-aiplatform.googleapis.com/v1beta1/projects/<project-id>/locations/<region>/publishers/anthropic/models/claude-fable-5:setPublisherModelConfig" \
      -d '{ "publisherModelConfig": { "data_sharing_enabled_provider": "anthropic" } }'
    ```

  `--apikey` and `--azure` don't need this step (their standard config already shares with Anthropic). To avoid 30-day retention entirely, don't use Fable — stay on `--opus`. See [Claude on Vertex AI](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude).
</Warning>

### Custom Models

Override default models in `secrets.sh`:

```bash theme={null}
export CLAUDE_MODEL_FABLE_VERTEX="claude-fable-5"
export CLAUDE_MODEL_OPUS_VERTEX="claude-opus-5"
export CLAUDE_MODEL_SONNET_VERTEX="claude-sonnet-5"
export CLAUDE_MODEL_HAIKU_VERTEX="claude-haiku-4-5@20251001"
export CLAUDE_SMALL_FAST_MODEL_VERTEX="claude-haiku-4-5@20251001"
```

### Regional Overrides

For specific model regional availability:

```bash theme={null}
export VERTEX_REGION_CLAUDE_4_6_OPUS="us-east5"
export VERTEX_REGION_CLAUDE_4_6_SONNET="us-east5"
```

<Card title="Vertex AI Setup" icon="book" href="https://code.claude.com/docs/en/google-vertex-ai">
  Read the complete Vertex AI setup guide
</Card>

***

## Anthropic API

Direct API access to Anthropic's Claude models.

### Configuration

Add to `~/.ai-runner/secrets.sh`:

```bash theme={null}
export ANTHROPIC_API_KEY="sk-ant-..."
```

### Getting an API Key

1. Sign up at [console.anthropic.com](https://console.anthropic.com/)
2. Navigate to API Keys
3. Create a new API key
4. Add it to your `secrets.sh`

### Usage

```bash theme={null}
# Use default tier (Opus)
ai --apikey

# Use specific tier
ai --apikey --opus task.md
ai --apikey --sonnet task.md
ai --apikey --haiku quick-fix.md
```

### Custom Models

Override default models in `secrets.sh`:

```bash theme={null}
export CLAUDE_MODEL_FABLE_ANTHROPIC="claude-fable-5"
export CLAUDE_MODEL_OPUS_ANTHROPIC="claude-opus-5"
export CLAUDE_MODEL_SONNET_ANTHROPIC="claude-sonnet-5"
export CLAUDE_MODEL_HAIKU_ANTHROPIC="claude-haiku-4-5"
export CLAUDE_SMALL_FAST_MODEL_ANTHROPIC="claude-haiku-4-5"
```

<Note>
  If you're also logged into Claude Pro, you'll see an "Auth conflict" warning from Claude Code. This is normal - Claude Code will use the API key for billing. The warning is just informational.
</Note>

<Card title="Anthropic API Docs" icon="book" href="https://docs.anthropic.com/">
  Read the Anthropic API documentation
</Card>

***

## Microsoft Azure

Microsoft Foundry on Azure provides Claude models through Azure.

### Configuration

Add to `~/.ai-runner/secrets.sh`:

```bash theme={null}
export ANTHROPIC_FOUNDRY_API_KEY="your-azure-api-key"
export ANTHROPIC_FOUNDRY_RESOURCE="your-resource-name"
```

Or provide the full URL:

```bash theme={null}
export ANTHROPIC_FOUNDRY_BASE_URL="https://your-resource-name.services.ai.azure.com"
```

### Authentication Methods

#### 1. API Key (Recommended)

```bash theme={null}
export ANTHROPIC_FOUNDRY_API_KEY="your-azure-api-key"
export ANTHROPIC_FOUNDRY_RESOURCE="your-resource-name"
```

#### 2. Azure Default Credentials

```bash theme={null}
az login
export ANTHROPIC_FOUNDRY_RESOURCE="your-resource-name"
```

### Usage

```bash theme={null}
# Use default tier (Opus)
ai --azure

# Use specific tier
ai --azure --opus task.md
ai --azure --sonnet task.md
ai --azure --haiku quick-fix.md
```

### Custom Models

Azure model names are deployment names (user-defined). Override in `secrets.sh`:

```bash theme={null}
export CLAUDE_MODEL_FABLE_AZURE="claude-fable-5"
export CLAUDE_MODEL_OPUS_AZURE="claude-opus-5"
export CLAUDE_MODEL_SONNET_AZURE="claude-sonnet-5"
export CLAUDE_MODEL_HAIKU_AZURE="claude-haiku-4-5"
export CLAUDE_SMALL_FAST_MODEL_AZURE="claude-haiku-4-5"
```

<Card title="Microsoft Foundry Setup" icon="book" href="https://code.claude.com/docs/en/microsoft-foundry">
  Read the complete Microsoft Foundry setup guide
</Card>

***

## Vercel AI Gateway

Vercel AI Gateway provides unified access to 100+ models from multiple providers.

### Configuration

Add to `~/.ai-runner/secrets.sh`:

```bash theme={null}
export VERCEL_AI_GATEWAY_TOKEN="vck_..."
export VERCEL_AI_GATEWAY_URL="https://ai-gateway.vercel.sh"  # Optional
```

### Getting a Token

1. Visit [vercel.com/dashboard/\~/ai](https://vercel.com/dashboard/~/ai)
2. Create a new AI Gateway token
3. Add it to your `secrets.sh`

### Usage with Claude Models

```bash theme={null}
# Use default tier (Opus)
ai --vercel

# Use specific tier
ai --vercel --opus task.md
ai --vercel --sonnet task.md
ai --vercel --haiku quick-fix.md
```

Vercel slugs use the `anthropic/model-name` form. Override the per-tier
defaults in `secrets.sh`:

```bash theme={null}
export CLAUDE_MODEL_FABLE_VERCEL="anthropic/claude-fable-5"
export CLAUDE_MODEL_OPUS_VERCEL="anthropic/claude-opus-5"
export CLAUDE_MODEL_SONNET_VERCEL="anthropic/claude-sonnet-5"
export CLAUDE_MODEL_HAIKU_VERCEL="anthropic/claude-haiku-4.5"
```

### Use Any Model

Vercel AI Gateway supports 100+ models from OpenAI, xAI, Google, Meta, Anthropic, Mistral, DeepSeek, and more — all through one API.

Use `--model provider/model` to run Claude Code with any supported model:

```bash theme={null}
ai --vercel --model xai/grok-code-fast-1         # xAI coding model
ai --vercel --model openai/gpt-5.2-codex         # OpenAI coding model
ai --vercel --model google/gemini-3-pro-preview  # Google reasoning model
ai --vercel --model alibaba/qwen3-coder          # Alibaba coding model
ai --vercel --model zai/glm-5                    # Zhipu AI GLM-5 198K context
```

### Example Coding Models

| Model ID                      | Provider | Description                                        |
| ----------------------------- | -------- | -------------------------------------------------- |
| `xai/grok-code-fast-1`        | xAI      | Fast coding model                                  |
| `openai/gpt-5.2-codex`        | OpenAI   | Coding-optimized GPT (also `openai/gpt-5.3-codex`) |
| `google/gemini-3-pro-preview` | Google   | Latest reasoning model                             |
| `alibaba/qwen3-coder`         | Alibaba  | Open-source coding model                           |
| `zai/glm-5`                   | Zhipu AI | GLM-5, 198K context, MIT license                   |

<Card title="Browse All Models" icon="grid" href="https://vercel.com/ai-gateway/models">
  View all available models on Vercel AI Gateway
</Card>

### Configuration for Non-Anthropic Models

When using non-Anthropic models, configure defaults in `secrets.sh`:

```bash theme={null}
# Use a non-Anthropic model as default for Vercel
export CLAUDE_MODEL_SONNET_VERCEL="xai/grok-code-fast-1"

# Set a specific background/small-fast model
export CLAUDE_SMALL_FAST_MODEL_VERCEL="xai/grok-code-fast-1"

# Fable 5 (--fable/--best) slug; override if Vercel's catalog differs
export CLAUDE_MODEL_FABLE_VERCEL="anthropic/claude-fable-5"
```

<Tip>
  **Automatic small/fast model:** When you use `--model` with a non-Anthropic model (e.g., `xai/grok-code-fast-1`), the background model is automatically set to the same model. This avoids mixing providers (e.g., xAI for main work + Anthropic for background). For Anthropic models on Vercel, the background model defaults to Haiku as usual.
</Tip>

### Set as Default Provider

```bash theme={null}
ai --vercel --model xai/grok-code-fast-1 --set-default
ai --clear-default
```

***

## Claude Pro

Uses your Claude Pro/Max subscription. No API keys needed.

### Prerequisites

* Claude Code installed
* Logged in with Claude subscription:
  ```bash theme={null}
  claude login
  ```

### Usage

```bash theme={null}
# Use default tier (Opus)
ai --pro

# Use specific tier
ai --pro --opus task.md
ai --pro --sonnet task.md
ai --pro --haiku quick-fix.md
```

<Note>
  This is the default provider if you're logged into Claude Code with a subscription.
</Note>

<Note>
  `--fable`/`--best` (Claude Fable 5) works with `--pro`, but availability depends on your Claude subscription plan. If your plan doesn't include Fable, use an API provider (`--apikey`, `--aws`, `--vertex`) instead.
</Note>

<Warning>
  Claude Pro has rate limits. When you hit a limit, switch to an API provider with `--resume` to continue your work.
</Warning>

***

## Provider Comparison

| Provider          | Setup Complexity | Cost Model   | Model Selection    | Best For                       |
| ----------------- | ---------------- | ------------ | ------------------ | ------------------------------ |
| **Ollama**        | Easy             | Free         | Open-source models | Local, privacy, cloud fallback |
| **LM Studio**     | Easy             | Free         | Custom models      | Apple Silicon, custom models   |
| **AWS Bedrock**   | Medium           | Pay-per-use  | Claude models      | AWS integration                |
| **Vertex AI**     | Medium           | Pay-per-use  | Claude models      | GCP integration                |
| **Anthropic API** | Easy             | Pay-per-use  | Claude models      | Direct access                  |
| **Azure**         | Medium           | Pay-per-use  | Claude models      | Azure integration              |
| **Vercel**        | Easy             | Pay-per-use  | 100+ models        | Multi-provider access          |
| **Claude Pro**    | Easiest          | Subscription | Claude models      | Rate limits exist              |

## Next Steps

<CardGroup cols={2}>
  <Card title="Provider Overview" icon="table" href="/providers/overview">
    Learn about the provider system
  </Card>

  <Card title="Switching Providers" icon="arrow-right-arrow-left" href="/providers/switching">
    Switch providers to avoid rate limits
  </Card>
</CardGroup>
