Skip to main content
Andi AIRun extends Claude Code with multi-provider support. Switch between your Claude subscription, AWS Bedrock, Google Vertex AI, Azure, local models, and more — all using the same ai command.

What Are Providers?

Providers are different backend services that run AI models. Each provider has its own:
  • Authentication: API keys, credentials, or subscriptions
  • Pricing: Some free (local), some pay-per-token (API), some subscription (Claude Pro)
  • Rate limits: Different limits per provider and tier
  • Model selection: Not all providers have all models
  • Geographic regions: Different data residency and compliance

Available Providers

Providers are configured once in ~/.ai-runner/secrets.sh and switched with simple flags. No need to edit config files or set environment variables.

Cross-Runtime Providers

Provider flags work across runtimes where possible: For Codex-specific providers (OpenRouter, Mistral, etc.), use --profile:
See Runtimes for the complete compatibility matrix.

Why Switch Providers?

There are several reasons to switch providers mid-task:

1. Avoiding Rate Limits

The most common reason. Claude Pro has rate limits that can block you for hours:
You can continue your exact conversation on a different provider without losing context.

2. Cost Optimization

Different providers have different pricing:

3. Local vs Cloud

Run models locally for privacy, or in the cloud for power:

4. Geographic Compliance

Different providers operate in different regions:

5. Model Availability

Test different models or use alternate AI systems:

The —resume Flag for Continuity

The --resume flag picks up your previous conversation on a different provider:
What --resume does:
  • Loads the most recent conversation session
  • Continues from where you left off
  • Preserves all context and history
  • Works across any provider switch
Use cases:
Use ai-sessions to view your active conversation sessions and see which one would be resumed.

Session-Scoped Behavior

All provider switches are session-scoped — they only affect the current terminal session:
When you exit an ai session:
  • Your original Claude Code settings are automatically restored
  • No global configuration is changed
  • Other terminals are completely unaffected
This non-destructive design means you can safely experiment with providers without breaking your Claude Code installation.

Setting Default Providers

If you frequently use a specific provider, save it as your default:
Saved defaults are stored in ~/.ai-runner/default.conf. Flag precedence (highest to lowest):

Provider Examples

Switch Between Major Clouds

Use Anthropic API Directly

Local Models (Free)

Alternate Models via Vercel

Vercel AI Gateway gives access to 100+ models from multiple providers through a single API.

Model Tiers

Most providers support three model tiers: Combine tiers with providers:
Use --haiku or --sonnet for cost savings. The default is --opus (highest tier) — use --mid or --low to explicitly downgrade.

Provider Configuration

Providers are configured in ~/.ai-runner/secrets.sh:
Add credentials for the providers you want to use:
You only need to configure the providers you plan to use.
Configuration is loaded at startup. After editing secrets.sh, start a new session or run source ~/.ai-runner/secrets.sh.

Check Current Configuration

Use ai-status to verify your setup:
Example output:

Advanced: Agent Teams with Any Provider

Agent teams work with all providers:
Teams coordination uses Claude Code’s internal task list and mailbox — it’s provider-independent. Token usage scales with team size (5 teammates ≈ 5× tokens).
Agent teams only work in interactive mode — not supported in shebang/piped script modes.

Practical Workflows

Rate Limit Recovery Workflow

Cost-Optimized Development

Multi-Provider Testing

Privacy-Conscious Workflow

View Active Sessions

See all your conversation sessions:
Example output:
The most recent session is used by --resume.

Provider Setup

Detailed configuration for each provider

Executable Markdown

Use provider flags in shebang scripts