AELDER

Connect Claude Code

Point Claude Code at the Messages endpoint using a local credential and an exact compatible model ID.

AELDER · SERVICE BASE URL
https://aelder.dev/v1

LOCAL CONFIGURATION

Let my agent set this up

Copy this task to an agent already running on your computer. Enter your API key locally when asked.

SETUP PROMPT
Help me connect Claude Code to AELDER using this guide: https://aelder.dev/docs/claude-code/
Service Base URL: https://aelder.dev/v1
First inspect my installed version, active profile and configuration. Explain any mismatch with the guide before changing anything.
Use the documented local configuration or CLI method. Do not automate the GUI, install software or change permissions without asking.
Preserve existing accounts, providers, models, defaults, permissions and unrelated settings. Propose the smallest change, show a redacted diff, and back up any files before editing.
Have me enter my API key locally using the tool's secret storage or an environment variable. Never ask me to paste a key into chat, print it, or include it in a command, diff, log or commit.
Use the exact model ID I choose from my account's model list. Do not invent model IDs or assume every model supports every API format or tool feature.
Validate syntax and configuration loading before making any generation request. If there is no dry-run, say so.
Explain any proposed paid test, the model and what it sends, and ask for approval before running it. Do not send project files or private conversation history as a test.
Finish with the settings changed, checks performed and steps to restore the backup.

Claude Code can use a custom endpoint through its native environment settings. It sends the Anthropic Messages format to /v1/messages; this is different from OpenAI-compatible Chat Completions.

Use a Claude model exposed by the service and compatible with Claude Code’s requests. Anthropic’s gateway documentation does not support routing Claude Code to non-Claude models. This guide does not establish compatibility for every model in our catalog.

1. Set the endpoint and credential locally

In Bash or Zsh, set SERVICE_BASE_URL to the Base URL above, including /v1, and SERVICE_MODEL_ID to an exact compatible ID from the authenticated models endpoint:

export SERVICE_BASE_URL="https://aelder.dev/v1"
export SERVICE_MODEL_ID="YOUR_MODEL_ID"
printf 'Service API key: '
IFS= read -r -s ANTHROPIC_AUTH_TOKEN
printf '\n'
export ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL="${SERVICE_BASE_URL%/v1}"
export ANTHROPIC_MODEL="$SERVICE_MODEL_ID"

Replace YOUR_MODEL_ID before running. The URL expression removes the final /v1: Claude Code needs the API root, because its client appends /v1/messages. Do not set ANTHROPIC_BASE_URL to /v1/messages.

ANTHROPIC_AUTH_TOKEN sends your service key in Authorization: Bearer. Enter just the key at the hidden prompt, without Bearer. Keep it out of shell history, project files and agent conversations. Resolve conflicting credential or endpoint values in existing Claude Code settings; do not overwrite unrelated settings or managed configuration.

2. Start and select the model

Launch an existing Claude Code CLI from that same terminal:

claude --model "$SERVICE_MODEL_ID"

Start a fresh conversation. Run /status and confirm the custom base URL and the ANTHROPIC_AUTH_TOKEN credential source. Run /model to inspect the selection, or use /model YOUR_MODEL_ID with a real compatible ID to switch the current session.

The CLI does not treat our entire /v1/models response as a verified Claude Code model catalog. An exact ID avoids assuming its built-in sonnet, opus or haiku aliases map to a service ID.

Claude Code may make additional requests using family aliases or explicitly configured subagent, background or advisor models. Map ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL only to compatible IDs you intend to use; inspect existing subagent and feature settings too. Setting the main model does not rewrite every separate model choice.

3. Check the connection

/status verifies configuration, not generation. Send “Reply with OK” when ready for a billable request, then confirm the model and usage in your service dashboard. Test a small tool task separately before a larger coding session.

For 401 errors, confirm the credential variable and key. For a URL containing /v1/v1/messages, remove /v1 from the Claude Code base URL. If an unknown model appears, inspect both the main selection and any auxiliary model choices.

If the service rejects a feature-specific header or request field, check that feature’s compatibility rather than assuming Messages support includes it. Extended thinking, prompt caching controls, images, server tools, compaction and fast mode each need separate support. This guide covers a text connection; it does not promise those features.

For persistent setup, keep the credential in your secrets tooling and merge only the intended environment/model values into your existing Claude Code configuration. Restart the process after changing its environment. GUI extensions and desktop apps may not inherit variables from your terminal.

Sources: Anthropic’s gateway connection guide, gateway protocol requirements and model configuration. The native configuration was reviewed; a live Claude Code session through this service has not been verified.

Need the key? Open your AELDER dashboard. For direct API calls, see the API reference.