MandAPI
English ▾
Coding tools

Connect Claude Code to MandAPI

Configure the Anthropic-compatible endpoint, choose a supported model and check your first coding session.

Use this recipe with your coding assistant

Read the prompt
Help me configure the installed Claude Code CLI for MandAPI. Check the installed version and existing configuration before editing, and preserve my current permissions and unrelated settings. Use ANTHROPIC_BASE_URL=https://api.mandapi.com and a MandAPI key supplied privately through ANTHROPIC_AUTH_TOKEN. Never display, commit or hard-code the key. Ask me for the exact account-visible MODEL_ID if it is not configured; do not invent a model ID or assume every model supports tools. Start with session-scoped settings. Show how to inspect /status and run one short read-only README summary when the key is available. Report the configuration changed and how to restore the previous connection. Do not buy credits, deploy a service or disable permission prompts.
TXT

What you will set up

Claude Code runs on your computer and sends model requests through MandAPI. This guide covers the command-line tool. The Claude desktop application has a different gateway setup. For a managed Windows setup, you can use MandAPI Connect.

Install Claude Code using its current official installation guide. Create a MandAPI key from your dashboard, and choose an account-visible model that supports the Anthropic Messages format and the coding features you need. Replace MODEL_ID below with that exact model ID. A model appearing in a catalog does not establish every tool capability.

Set the connection for one terminal session

The Anthropic-compatible base address is https://api.mandapi.com. Claude Code adds its Messages path. Start with session-scoped settings so you can check the connection before making it permanent.

Bash:

bash
export ANTHROPIC_BASE_URL="https://api.mandapi.com"
read -rsp "MandAPI key: " ANTHROPIC_AUTH_TOKEN
printf '\n'
export ANTHROPIC_AUTH_TOKEN
unset ANTHROPIC_API_KEY
claude --model MODEL_ID

PowerShell:

powershell
$env:ANTHROPIC_BASE_URL = 'https://api.mandapi.com'
$env:ANTHROPIC_AUTH_TOKEN = [Net.NetworkCredential]::new('', (Read-Host 'MandAPI key' -AsSecureString)).Password
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
claude --model MODEL_ID

Keep the credential in your own environment or secret store. A shared project settings file should contain instructions, not your real key. Session variables disappear when you close that terminal.

Check the first session

Open a small project, start Claude Code and run /status to inspect its active connection. Ask: “Read the README and summarize this project in three sentences. Do not change files.” Check that a normal answer arrives, then inspect the corresponding usage in your MandAPI dashboard. This tests a small text task; test your required tool actions separately before using a large project.

Fix connection problems

If authentication fails, check that the launched terminal inherited ANTHROPIC_AUTH_TOKEN and that the key is active. Check presence without printing the value. If the model or route is missing, recheck the exact model ID and the base address: this Claude Code configuration uses the host without a /v1 suffix. Restart the tool after changing its environment. Keep your normal permission confirmations enabled.

Finish or restore the previous session

Close the configured terminal to discard these session settings. To continue in the same Bash session, unset the two ANTHROPIC_ variables; in PowerShell, remove them from Env:. A saved personal Claude login is separate from the MandAPI key. Reopen your normal terminal to return to its usual setup.

References

Topics inspired by public documentation; instructions and examples adapted for MandAPI.