SpyBara
Go Premium

Documentation 2025-11-14 21:26 UTC to 2025-11-16 00:04 UTC

1 file changed +29 −8. View all changes and history on the product overview
2025
Thu 27 06:02 Wed 26 00:04 Tue 25 03:22 Mon 24 21:01 Fri 21 00:04 Thu 20 18:02 Wed 19 03:21 Tue 18 18:02 Mon 17 03:24 Sun 16 00:04 Fri 14 21:26 Thu 6 18:02 Tue 4 18:02 Mon 3 21:01 Sun 2 18:01 Sat 1 21:01

llm-gateway.md +29 −8

Details

1# LLM gateway configuration1# LLM gateway configuration

2 2 

3> Learn how to configure Claude Code with LLM gateway solutions, including LiteLLM setup, authentication methods, and enterprise features like usage tracking and budget management.3> Learn how to configure Claude Code to work with LLM gateway solutions. Covers gateway requirements, authentication configuration, model selection, and provider-specific endpoint setup.

4 4 

5LLM gateways provide a centralized proxy layer between Claude Code and model providers, offering:5LLM gateways provide a centralized proxy layer between Claude Code and model providers, often providing:

6 6 

7* **Centralized authentication** - Single point for API key management7* **Centralized authentication** - Single point for API key management

8* **Usage tracking** - Monitor usage across teams and projects8* **Usage tracking** - Monitor usage across teams and projects


10* **Audit logging** - Track all model interactions for compliance10* **Audit logging** - Track all model interactions for compliance

11* **Model routing** - Switch between providers without code changes11* **Model routing** - Switch between providers without code changes

12 12 

13## Gateway requirements

14 

15For an LLM gateway to work with Claude Code, it must meet the following requirements:

16 

17**API format**

18 

19The gateway must expose to clients at least one of the following API formats:

20 

211. **Anthropic Messages**: `/v1/messages`, `/v1/messages/count_tokens`

22 * Must forward request headers: `anthropic-beta`, `anthropic-version`

23 

242. **Bedrock InvokeModel**: `/invoke`, `/invoke-with-response-stream`

25 * Must preserve request body fields: `anthropic_beta`, `anthropic_version`

26 

273. **Vertex rawPredict**: `:rawPredict`, `:streamRawPredict`, `/count-tokens:rawPredict`

28 * Must forward request headers: `anthropic-beta`, `anthropic-version`

29 

30Failure to forward headers or preserve body fields may result in reduced functionality or inability to use Claude Code features.

31 

32## Configuration

33 

34### Model selection

35 

36By default, Claude Code will use standard model names for the selected API format.

37 

38If you have configured custom model names in your gateway, use the environment variables documented in [Model configuration](/en/model-config) to match your custom names.

39 

13## LiteLLM configuration40## LiteLLM configuration

14 41 

15<Note>42<Note>


129export CLOUD_ML_REGION=us-east5156export CLOUD_ML_REGION=us-east5

130```157```

131 158 

132### Model selection

133 

134By default, the models will use those specified in [Model configuration](/en/third-party-integrations#model-configuration).

135 

136If you have configured custom model names in LiteLLM, set the aforementioned environment variables to those custom names.

137 

138For more detailed information, refer to the [LiteLLM documentation](https://docs.litellm.ai/).159For more detailed information, refer to the [LiteLLM documentation](https://docs.litellm.ai/).

139 160 

140## Additional resources161## Additional resources