Dokumentation

AI Provider Configuration

How to configure OpenAI, Anthropic, Google, and other AI providers in Fabric AI.

Fabric AI supports multiple AI providers through the Vercel AI SDK. This guide shows you how to configure your preferred provider.

Supported Providers

OpenAI

GPT-4, GPT-4 Turbo, GPT-3.5 Turbo

Best for: Complex reasoning, code generation

Anthropic

Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku

Best for: Long context, nuanced understanding

Google

Gemini Pro, Gemini Ultra

Best for: Multimodal tasks, general purpose

Others

Mistral, Llama, Cohere, and more

Available through custom configuration

Configuration Methods

The easiest way to configure AI providers is through the Fabric UI:

Click your profile icon in the top right, then select Settings.

Open AI Gateway

In the settings sidebar, click AI Gateway.

Add Provider

Click Add Provider and select your AI provider from the list.

Enter API Key

Paste your API key from your provider's dashboard:

Test Connection

Click Test Connection to verify your API key works correctly. You should see a success message.

Save

Click Save to store your configuration. Your AI provider is now ready to use!

Method 2: Organization Configuration

For teams and organizations, you can configure AI providers at the organization level:

Switch to Organization

Use the organization switcher in the top bar to select your organization.

Open Organization Settings

Click Settings → Organization Settings → AI Gateway.

Configure Provider

Add your organization's API key. All organization members will use this configuration by default.

Priority Order:

  1. Organization configuration (if member of an organization)
  2. Personal account configuration
  3. Environment variable fallback

Method 3: Environment Variables (Self-Hosted)

For self-hosted deployments, you can configure providers via environment variables:

# Primary AI Gateway key
AI_GATEWAY_API_KEY="your-api-key"

# Or provider-specific keys
OPENAI_API_KEY="sk-..."
ANTHROPIC_API_KEY="sk-ant-..."
GOOGLE_AI_API_KEY="..."

Provider-Specific Setup

OpenAI

  1. Go to platform.openai.com
  2. Navigate to API Keys
  3. Click Create new secret key
  4. Copy the key (you won't see it again!)
  5. Paste in Fabric Settings → AI Gateway
OPENAI_API_KEY="sk-..."

Available Models:

  • gpt-4 — Most capable, best for complex tasks
  • gpt-4-turbo — Faster, good balance of speed and capability
  • gpt-4o — Latest model with vision capabilities
  • gpt-3.5-turbo — Fast and cost-effective

Anthropic

  1. Go to console.anthropic.com
  2. Navigate to Settings → API Keys
  3. Click Create Key
  4. Copy the key
  5. Paste in Fabric Settings → AI Gateway
ANTHROPIC_API_KEY="sk-ant-..."

Available Models:

  • claude-3-5-sonnet-20241022 — Best balance of capability and speed
  • claude-3-opus-20240229 — Most capable, best for complex analysis
  • claude-3-haiku-20240307 — Fastest, great for simple tasks

Google (Gemini)

  1. Go to aistudio.google.com
  2. Click Get API Key
  3. Create a new key or select existing
  4. Copy the key
  5. Paste in Fabric Settings → AI Gateway
GOOGLE_AI_API_KEY="..."

Available Models:

  • gemini-pro — General purpose, good for text
  • gemini-pro-vision — Multimodal with image understanding

Using Vercel AI Gateway

For production deployments, we recommend using Vercel AI Gateway for:

  • Unified API — Single endpoint for all providers
  • Cost tracking — Monitor usage across providers
  • Rate limiting — Protect against runaway costs
  • Caching — Reduce costs with intelligent caching
  • Fallbacks — Automatic provider failover

Setup

  1. Go to vercel.com/dashboard/ai/gateway
  2. Create a new gateway or select existing
  3. Add your provider API keys
  4. Copy the Gateway API key
  5. Paste in Fabric Settings → AI Gateway
# Environment variable for Vercel AI Gateway
AI_GATEWAY_API_KEY="vck_..."

Choosing the Right Model

Use CaseRecommended ModelWhy
Complex PRDsGPT-4 or Claude 3 OpusBest reasoning capabilities
Quick draftsClaude 3.5 SonnetFast with good quality
Long documentsClaude 3.5 Sonnet200K token context
Code generationGPT-4Strong code understanding
Cost-sensitiveGPT-3.5 Turbo or Claude HaikuLower cost per token
MultimodalGPT-4V or Gemini Pro VisionImage understanding

Model Settings

When using agents, you can customize model settings:

Temperature

Controls randomness in outputs:

  • 0.0 — Deterministic, consistent outputs
  • 0.7 — Balanced creativity (default)
  • 1.0 — More creative, varied outputs

Max Tokens

Maximum length of the response:

  • 1024 — Short responses
  • 4096 — Medium documents (default)
  • 8192+ — Long documents

System Prompt

Instructions that guide the model's behavior. Fabric provides optimized system prompts for each agent type.

Troubleshooting

"Invalid API Key"

  • Double-check the key is copied correctly (no extra spaces)
  • Verify the key hasn't been revoked
  • Make sure you're using the right key format for the provider

"Rate Limited"

  • You've exceeded your provider's rate limits
  • Wait a few minutes and try again
  • Consider upgrading your provider plan

"Model Not Available"

  • The selected model may not be available in your region
  • Check your provider's model availability
  • Try a different model

"Insufficient Credits"

  • Your provider account has run out of credits
  • Add payment method or purchase more credits
  • Check usage in your provider's dashboard

Security Best Practices

  • Never share your API keys
  • Rotate keys periodically
  • Use organization keys for team deployments
  • Monitor usage to detect anomalies
  • Set spending limits with your provider

Next Steps