What You’ll Build
By the end of this guide, you’ll have:- switchAILocal server running on
http://localhost:18080 - At least one AI provider configured (CLI, API, or local)
- Made your first successful API request
First time running? The hub script will automatically check for Go dependencies and build the binary for you.
The default API key
sk-test-123 is for testing only. Update api-keys in config.yaml for production use.Next Steps
Configure Providers
Set up multiple AI providers and accounts for load balancing
API Reference
Explore the full OpenAI-compatible API
Intelligent Routing
Enable Cortex Router for automatic model selection
Management Dashboard
Use the web UI to configure and monitor your gateway
Quick Tips
How do I use a specific provider?
How do I use a specific provider?
Use the Without a prefix, switchAILocal auto-routes to any available provider.
provider:model format to route to a specific provider:How do I enable streaming?
How do I enable streaming?
Add
"stream": true to your request:How do I list available models?
How do I list available models?
Query the This returns all models from all configured providers.
/v1/models endpoint:Server not starting?
Server not starting?
Run diagnostics:
Troubleshooting
Connection Refused
Problem:
curl: (7) Failed to connectSolution:- Check if server is running:
./ail.sh status - Verify port 18080 is not in use:
lsof -i :18080 - Review logs:
./ail.sh logs
401 Unauthorized
Problem: API key rejectedSolution:
- Ensure your API key matches one in
config.yaml: - Restart server after config changes:
./ail.sh restart
No Models Available
Problem: Empty models list or “model not found”Solution:
- Verify provider is enabled in
config.yaml - Check CLI tools are installed:
which gemini claude - Enable auto-discovery for local providers:
Build Failed
Problem: Go build errorsSolution:
- Update Go to 1.24+:
go version - Clean modules:
go clean -modcache - Re-download dependencies:
go mod download
Need more help? Check the Installation Guide for detailed setup instructions or visit our GitHub Issues.