Before you start: create a Fortytwo API key and buy credits — see Quickstart, step 1. Give each agent its own key with a Spend limit.
1
Install LiteLLM and Claude Code
2
Configure LiteLLM
Create Use the
litellm.yaml:litellm.yaml
custom_openai/ prefix: with openai/, LiteLLM sends Messages requests to the Responses API, which the Fortytwo API does not serve. The same file works for the Codex guide.The master key is a password for your local LiteLLM proxy; LiteLLM does not start without it. You do not get it anywhere: make up any string that starts with sk-, or let the command in the next step create a random one. Claude Code sends it to LiteLLM; LiteLLM sends your Fortytwo key to Fortytwo.3
Start LiteLLM
echo line prints the master key: copy it for the next step. Keep this terminal open while you use Claude Code.4
Start Claude Code
In a second terminal, in your project folder:
ANTHROPIC_AUTH_TOKENreplaces the sign-in: Claude Code does not ask for an Anthropic account.- The
ANTHROPIC_DEFAULT_*andCLAUDE_CODE_SUBAGENT_MODELlines send Claude Code’s background tasks and subagents to the same model. Without them, Claude Code asks LiteLLM for Claude models that it does not have. CLAUDE_CODE_MAX_CONTEXT_TOKENSsets the model’s context window. Without it, Claude Code does not recognise the model and assumes 200,000 tokens.
Something not working with your agent, or using one we have not listed? Tell us in the platform: Feedback for ideas and small bugs, Contact support if it blocks your work, or Report a security issue.