Last updated: Aug 12, 2025, 01:09 PM UTC

Claude Model Access Configuration in Sasha Studio

Overview

This document explains how Claude model access works in Sasha Studio, why certain models are available in deployed environments, and how to obtain API keys with access to premium models like Opus.

Current Model Access Architecture

How Claude CLI is Integrated

  1. Docker Installation: Claude CLI is installed globally in the Docker container

    RUN npm install -g @anthropic-ai/claude-code@latest
    
  2. API Key Configuration: The system uses the ANTHROPIC_API_KEY environment variable

    • Set via .env file in local development
    • Set via environment variables in production deployments
    • Passed to Claude CLI through the server's process environment
  3. Model Selection Flow:

    User Request β†’ Sasha Server β†’ Claude CLI spawn β†’ Claude API
                                   ↑
                            ANTHROPIC_API_KEY
    

Why "System Configuration" Message Appears

The message "model selection is configured by system configuration" appears because:

  • Claude CLI uses its default configuration when no explicit --model flag is provided
  • The current Sasha implementation doesn't pass model selection to Claude CLI
  • Model availability is determined by the API key's permissions, not the UI

Current Implementation Details

From claudecodeui/server/claude-cli.js:

// Claude CLI inherits server's environment
const processEnv = { ...process.env };
if (process.env.ANTHROPIC_API_KEY) {
  console.log('πŸ”‘ Using server-configured Claude CLI');
}

API Key Tiers and Model Access

Understanding Anthropic API Access Levels

1. Free Tier / Basic API Keys

  • Access to: Claude 3 Haiku, Claude 3.5 Sonnet
  • Rate limits: Lower requests per minute
  • Use case: Development, testing, light production use
  • Cost: Free or low monthly minimum

2. Professional / Standard API Keys

  • Access to: All Claude 3 models including Sonnet
  • Rate limits: Higher throughput
  • Use case: Production applications
  • Cost: Pay-per-use pricing

3. Enterprise / Premium API Keys

  • Access to: All models including Claude 3 Opus
  • Rate limits: Highest available
  • Use case: High-volume production, enterprise applications
  • Additional features: Priority support, SLAs

How to Obtain Keys with Opus Access

Option 1: Anthropic Console (Recommended)

  1. Create an Anthropic Account:

  2. Upgrade to Professional/Enterprise Plan:

    • Navigate to Billing/Plans section
    • Select a plan that includes Opus access
    • Add payment method
    • Note: Opus access typically requires:
      • Verified business account
      • Payment method on file
      • May require minimum monthly commitment
  3. Generate API Key:

    • Go to API Keys section
    • Create new key with appropriate permissions
    • Store securely

Option 2: Claude Code Subscription

  1. Claude Code Built-in Access:

    • Claude Code (claude.ai/code) includes Opus access
    • Uses its own authentication, not API keys
    • Model selection available through CLI flags
  2. Using Claude Code's Models in Sasha:

    • The deployed Sasha leverages Claude Code's installation
    • This is why Opus appears available in some deployments

Option 3: AWS Bedrock (Alternative)

  1. Set up AWS Bedrock:

    • Enable Bedrock in AWS Console
    • Request access to Anthropic models
    • Configure IAM permissions
  2. Use Bedrock Configuration:

    {
      "provider": "bedrock",
      "region": "us-east-1",
      "models": ["anthropic.claude-3-opus-*"]
    }
    

Configuring Model Access in Sasha

Method 1: Environment Variable (Current)

# .env file
ANTHROPIC_API_KEY=sk-ant-api03-...

Method 2: Explicit Model Selection (Future Enhancement)

To enable explicit model selection, modify claude-cli.js:

// Add model parameter to spawn options
if (options.model) {
  args.push('--model', options.model);
}

Method 3: Fallback Models

Configure fallback models for rate limit handling:

args.push('--fallback-model', 'claude-3-haiku-20240307');

Verification and Testing

Check Available Models

# List all available models with your API key
claude list-models

# Test specific model access
claude --model opus "Test message"

Verify in Sasha Deployment

  1. Check Docker logs:

    docker logs sasha-container 2>&1 | grep "API"
    
  2. Test model access:

    • Send a request through Sasha UI
    • Check server logs for model selection
    • Verify response headers for model used

Best Practices

Security Considerations

  1. Never commit API keys:

    • Use environment variables
    • Store in secure vaults (AWS Secrets Manager, etc.)
    • Rotate keys regularly
  2. Limit API key scope:

    • Create project-specific keys
    • Use minimum required permissions
    • Monitor usage and costs

Cost Management

  1. Model Selection Strategy:

    • Haiku: Simple queries, high volume
    • Sonnet: Complex tasks, balanced cost
    • Opus: Critical reasoning, premium features
  2. Implement Usage Controls:

    • Rate limiting per user/organization
    • Model restrictions based on user tier
    • Cost alerts and budgets

Troubleshooting

Common Issues

  1. "Model not available" error:

    • Check API key tier
    • Verify billing status
    • Confirm model name/version
  2. "System configuration" message:

    • Normal when using Claude CLI defaults
    • Not an error, indicates system-level config
  3. Opus not showing in UI:

    • UI may not reflect all available models
    • Check via claude list-models command
    • May need UI update to show all models

Future Enhancements

Planned Improvements

  1. Dynamic Model Selection:

    • Pass model choice from UI to Claude CLI
    • Store user preferences
    • Organization-specific model policies
  2. Multi-Provider Support:

    • Anthropic direct API
    • AWS Bedrock
    • Azure OpenAI
    • Google Vertex AI
  3. Cost Tracking:

    • Per-request cost calculation
    • Usage dashboards
    • Budget alerts

References

Contact and Support

For API key upgrades or enterprise access: