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
Docker Installation: Claude CLI is installed globally in the Docker container
RUN npm install -g @anthropic-ai/claude-code@latestAPI Key Configuration: The system uses the
ANTHROPIC_API_KEYenvironment variable- Set via
.envfile in local development - Set via environment variables in production deployments
- Passed to Claude CLI through the server's process environment
- Set via
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
--modelflag 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)
Create an Anthropic Account:
- Visit console.anthropic.com
- Sign up for an account
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
Generate API Key:
- Go to API Keys section
- Create new key with appropriate permissions
- Store securely
Option 2: Claude Code Subscription
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
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)
Set up AWS Bedrock:
- Enable Bedrock in AWS Console
- Request access to Anthropic models
- Configure IAM permissions
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
Check Docker logs:
docker logs sasha-container 2>&1 | grep "API"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
Never commit API keys:
- Use environment variables
- Store in secure vaults (AWS Secrets Manager, etc.)
- Rotate keys regularly
Limit API key scope:
- Create project-specific keys
- Use minimum required permissions
- Monitor usage and costs
Cost Management
Model Selection Strategy:
- Haiku: Simple queries, high volume
- Sonnet: Complex tasks, balanced cost
- Opus: Critical reasoning, premium features
Implement Usage Controls:
- Rate limiting per user/organization
- Model restrictions based on user tier
- Cost alerts and budgets
Troubleshooting
Common Issues
"Model not available" error:
- Check API key tier
- Verify billing status
- Confirm model name/version
"System configuration" message:
- Normal when using Claude CLI defaults
- Not an error, indicates system-level config
Opus not showing in UI:
- UI may not reflect all available models
- Check via
claude list-modelscommand - May need UI update to show all models
Future Enhancements
Planned Improvements
Dynamic Model Selection:
- Pass model choice from UI to Claude CLI
- Store user preferences
- Organization-specific model policies
Multi-Provider Support:
- Anthropic direct API
- AWS Bedrock
- Azure OpenAI
- Google Vertex AI
Cost Tracking:
- Per-request cost calculation
- Usage dashboards
- Budget alerts
References
- Anthropic API Documentation
- Claude Model Pricing
- Claude Code CLI Documentation
- AWS Bedrock Claude Models
Contact and Support
For API key upgrades or enterprise access:
- Anthropic Sales: sales@anthropic.com
- Support: support@anthropic.com
- Console: console.anthropic.com/support