Claude Code
Configure Claude Code to use Engy models through the Anthropic-compatible API.
This page explains how to configure Claude Code to send its requests to Engy. It is intended for developers who want to use open models from Engy in Claude Code.
Prerequisites
Before you begin, make sure you have:
- Claude Code installed
- An Engy API key. For details, see API keys
Configure Claude Code
Open the settings file
Open ~/.claude/settings.json in a text editor. If the file does not exist, create it.
Add the Engy settings
Add the following env object, and replace sk-engy-... with your API key:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.engy.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-engy-...",
"ANTHROPIC_MODEL": "kimi-k3[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "kimi-k3",
"CLAUDE_CODE_AUTO_MODE_SERVER": "0"
}
}If the file already contains other settings, add the env object to the existing JSON object.
Start Claude Code
Run claude in your terminal. Claude Code now sends its requests to Engy.
Settings reference
| Setting | Value | Description |
|---|---|---|
ANTHROPIC_BASE_URL | https://api.engy.ai | The Engy API base URL. Do not append /v1. |
ANTHROPIC_AUTH_TOKEN | Your API key | The key that authorizes the requests. |
ANTHROPIC_MODEL | A model ID, optionally with [1m] | The main model. |
ANTHROPIC_DEFAULT_HAIKU_MODEL | A model ID | The model for background tasks. Keep this setting, so that Claude Code does not request a model that Engy does not serve. |
CLAUDE_CODE_AUTO_MODE_SERVER | 0 | Turns off the server-side safety check for auto mode. For details, see Auto mode. |
Choose a model
You can use any model from Models and pricing.
Claude Code assumes a context window of 200,000 tokens for models that it does not recognize, and it rejects longer prompts before it sends them. To use a larger context window, append [1m] to the model ID. Claude Code removes the suffix before it sends the request.
Append [1m] only to models with a context window of about 1 million tokens:
deepseek-v4-flash-0731deepseek-v4.1-flashkimi-k3qwen3.8-27b
For other models, use the model ID without the suffix.
Auto mode
Claude Code 2.1.278 and later asks the API to run the auto mode safety classifier inside each request. Engy does not run this classifier.
Without CLAUDE_CODE_AUTO_MODE_SERVER set to 0, Claude Code shows a notice that the session is not eligible, and then runs the classifier itself. These classifier calls are billed as normal requests on your API key.
With the setting, Claude Code skips the request and the notice. Auto mode works the same way in both cases.
Limitations
The following Anthropic features have no effect on Engy:
cache_controlmarkers. Engy caches prompts automatically. For details, see Prompt caching.- Thinking budgets. The model thinks at its default level. For details, see Reasoning.
- Document content blocks