ai-provider-setup

ai-provider-setup is a command for Claude Code from Matt-Dionis/claude-code-configs. It costs 7 tokens per session (948 once invoked), scanned A, original, MIT.

A setup guide for configuring one or more AI service providers through the Vercel AI SDK. It covers shared configuration, environment variables, provider switching, and fallback between providers.

In plain words
What is it for?
Use it to configure single- or multi-provider AI applications, add automatic failover, track usage and costs, and test provider behaviour.
Why use it?
It helps avoid provider-specific code and reduces failures when one AI service is unavailable. It also brings provider credentials, errors, health checks, usage, and costs into one setup.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to configure single- or multi-provider AI applications, add automatic failover, track usage and costs, and test provider behaviour.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/matt-dionis/claude-code-configs/ai-provider-setup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-provider-setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/ai-provider-setup/github.svg)](https://agentmods.dev/commands/matt-dionis/claude-code-configs/ai-provider-setup)
Your own site
<a href="https://agentmods.dev/commands/matt-dionis/claude-code-configs/ai-provider-setup"><img src="https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/ai-provider-setup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-provider-setup

Your own site · 80×15
<a href="https://agentmods.dev/commands/matt-dionis/claude-code-configs/ai-provider-setup"><img src="https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/ai-provider-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 948 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00007 $0.00948
Opus 5.5 $0.00003 $0.00379
Sonnet 5.5 $0.00001 $0.00190
Haiku 4.5 $0.00001 $0.00095

Measured 1mo ago against content hash 31ac9eb3bac5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ai-provider-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

configurations/tooling/vercel-ai-sdk/.claude/commands/ai-provider-setup.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Set up AI Provider Configuration

Configure robust AI provider setup with the Vercel AI SDK: $ARGUMENTS

Current Configuration Analysis

Existing provider setup: !grep -r "@ai-sdk/" . --include="*.ts" --include="*.tsx" | head -5

Environment variables: !grep -r "API_KEY\|_KEY" .env* 2>/dev/null | head -5 || echo "No API keys found in .env files"

Provider imports: !grep -r "from '@ai-sdk/" . --include="*.ts" | head -10

Configuration Strategy

Single Provider: Focus on one provider with optimal configuration Multi Provider: Set up multiple providers with consistent interface Fallback: Implement automatic failover between providers

Your Task

  1. Analyze current provider setup and identify improvements needed
  2. Design provider architecture with proper abstraction layers
  3. Implement configuration management with environment handling
  4. Set up provider fallback logic for reliability
  5. Add usage tracking and cost monitoring for optimization
  6. Create provider health checks for monitoring
  7. Implement proper error handling and recovery
  8. Add comprehensive testing for all providers

Implementation Requirements

Environment Configuration
  • Secure API key management
  • Environment-specific configurations
  • Provider availability detection
  • Default provider selection
  • Feature flag support for provider switching
Provider Abstraction
  • Unified interface across all providers
  • Model capability mapping
  • Feature detection and adaptation
  • Consistent error handling
  • Performance monitoring integration
Fallback and Reliability
  • Automatic provider failover
  • Health check implementation
  • Circuit breaker patterns
  • Retry logic with exponential backoff
  • Graceful degradation strategies

Expected Deliverables

  1. Provider configuration system with environment management
  2. Multi-provider client wrapper with unified interface
  3. Fallback and health monitoring implementation
  4. Usage tracking and analytics system
  5. Cost optimization utilities for model selection
  6. Testing suite covering all provider scenarios
  7. Documentation with setup guides and best practices

Read the full file on GitHub · 170 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 170 lines · 7 tokens per session scan A 31ac9eb3bac5

Subscribe to this mod's changes

ai-provider-setup is a command published in the GitHub repository Matt-Dionis/claude-code-configs (619 stars, last pushed 1y ago), licensed MIT. It adds 7 tokens to every session and 948 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.