Claude Code workflow
Route Claude Code through a local AI gateway
KeyKing's `keyking-claude` wrapper sends compatible Claude Code traffic to the local Anthropic Messages adapter, then applies your configured provider/model Priority Ladder.
Important: KeyKing does not provide Anthropic's paid service for free. You supply credentials and can route to models or providers for which you have access, including available free quotas.
1. Install and open KeyKing
curl -fsSL https://keyking.ledgion.in/install.sh | bashWindows users can download the latest release. Add provider credentials in the desktop vault and start the local proxy.
2. Configure a Priority Ladder
Choose explicit provider/model pairs in the order you want KeyKing to try them. Verify that each selected provider supports the capabilities your Claude Code task requires.
routingRules: [
{ provider: "Groq", model: "llama-3.3-70b-versatile" },
{ provider: "Anthropic", model: "claude-3-5-sonnet-20241022" },
{ provider: "OpenAI", model: "gpt-4o" }
]3. Start the wrapper
keyking-claudeThe wrapper targets KeyKing's local `/v1/messages` route. On eligible rate-limit or upstream failures, KeyKing moves to the next configured route.
Compatibility notes
- Model behavior and tool support differ by provider.
- A fallback model is not guaranteed to behave identically to an Anthropic model.
- Requests sent upstream are governed by the selected provider's terms.
- Use the decision logs to confirm which route served each request.