Skip to main content
Get switchAILocal up and running with your first AI request in minutes. This guide will help you install, configure, and test your unified AI gateway.

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

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

Use the provider:model format to route to a specific provider:
Without a prefix, switchAILocal auto-routes to any available provider.
Add "stream": true to your request:
Query the /v1/models endpoint:
This returns all models from all configured providers.
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.