Back to Documentation

Claude Code Integration Guide

Learn how to configure and use Anthropic's Claude Code CLI tool with ValueAPI to supercharge your development workflow.

1. Prerequisites

To use Claude Code, you need to have Node.js installed on your system.

2. Global Installation

Install the Claude Code CLI globally using npm:

# Install Claude Code globally
npm install -g @anthropic-ai/claude-code

# Verify the installation
claude --version

3. Obtain API Key

Log in to the ValueAPI Dashboard, navigate to the API Keys section, and generate a new key. You will use this key to authenticate Claude Code.

4. Configuration

4.1 Skip Onboarding Authentication

To bypass the default Anthropic login prompt and use ValueAPI directly, add the following configuration to your global ~/.claude.json file. If the file doesn't exist, create it manually.

{
"//": "Other configurations...",
"hasCompletedOnboarding": true
}

4.2 Project-Level Configuration

In the root directory of your project, create a .claude folder, and inside it, create a settings.json file. Replace the placeholders with your actual API key and desired model.

Supported Models

For Claude Code to function properly (especially for file manipulation and agent capabilities), we strongly recommend using models like claude-sonnet-4-6 or claude-opus-4-6. Other LLMs may lack the specific tool-calling capabilities required by Claude Code.

{
"env": {
"ANTHROPIC_BASE_URL": "https://api.valueapi.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-YOUR_VALUEAPI_KEY",
"ANTHROPIC_MODEL": "claude-sonnet-4-6",
"ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4-6",
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": 1
}
}

Once configured, simply run the following command in your project root to start Claude Code:

claude

Note: If you modify the configuration file while Claude Code is running, you will need to restart the terminal session.

4.3 Global Configuration (Optional)

If you prefer not to configure every project individually, you can set these variables globally:

  • Windows: Create or edit C:\Users\%username%\.claude\settings.json
  • macOS / Linux: Create or edit ~/.claude/settings.json

5. Best Practices

The claude.md File

You can add a claude.md file to your project root. Claude Code will prioritize reading this file upon startup. It is highly recommended to use this file to store your project outline, coding conventions, and specific instructions to help Claude understand your codebase faster.

Context Management

When the context window is nearing its limit, Claude Code will display a warning in the bottom right corner. You can use the /compact command to compress the context, or /clear to start a fresh session.

6. Troubleshooting

400 Error / Invalid Beta Flag

If you encounter a 400 error related to beta features, ensure you have disabled experimental betas in your settings.json:

{
"env": {
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": 1
}
}

Insufficient Output Length Error

If Claude Code complains about output token limits, you can manually increase the maximum output tokens in your settings.json:

{
"env": {
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": 32000
}
}