Use LinkHarbor with Claude Code, OpenClaw, Cline, OpenCode, and other Anthropic-compatible tools without modifying the official Anthropic SDK.
It is recommended to configure the API key and endpoint using environment variables. You can get started in just four simple steps.
The recommended setup uses environment variables for both the API key and the Anthropic-compatible endpoint.
Claude Code connects your local development environment to Anthropic-compatible models. Make sure Node.js 18 or later is installed before running the install command.
npm install -g @anthropic-ai/claude-codeYour API key authenticates requests to the Anthropic-compatible API. Store it in ANTHROPIC_API_KEY instead of hardcoding it in source code.
export ANTHROPIC_API_KEY="YOUR_API_KEY"ANTHROPIC_API_KEY is the recommended variable for x-api-key authentication. Use ANTHROPIC_AUTH_TOKEN only if your gateway explicitly requires Bearer authentication.
Set the base URL so Claude Code and Anthropic SDKs send requests to LinkHarbor instead of the default Anthropic endpoint.
export ANTHROPIC_BASE_URL="https://api.linkharbor.ai/anthropic"After configuring the API key and endpoint, start Claude Code from your terminal. You can also specify a model manually.
claudeThe platform supports the standard Anthropic-Compatible API format. All requests should include x-api-key, anthropic-version, and content-type headers.
https://api.linkharbor.ai/anthropicSend messages to Anthropic-compatible models using the standard /v1/messages endpoint and request schema.
https://api.linkharbor.ai/anthropic/v1/messagesSend messages to Anthropic-compatible models using the standard /v1/messages endpoint and request schema.
All Anthropic-compatible requests must include the following headers.
x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
content-type: application/jsonStandard Anthropic Messages format with model, max_tokens, and a messages array.
{
"model": "your-model-name",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}Use the official Anthropic SDK directly — no modification required. The same call shown in three languages.
curl https://api.linkharbor.ai/anthropic/v1/messages \
--header "x-api-key: YOUR_API_KEY" \
--header "anthropic-version: 2023-06-01" \
--header "content-type: application/json" \
--data '{
"model": "your-model-name",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}'Three habits that keep your integration secure and resilient over time.
Avoid committing API keys to source code, examples, terminal history, or public repositories.
Claude Code, OpenClaw, Cline, OpenCode, and similar Anthropic-compatible clients can use this endpoint.
Long-lived keys reduce unexpected tool failures caused by frequent key rotation.
Quick answers to the questions developers ask most.
Use LinkHarbor with OpenAI-compatible SDKs and tools.
View setupFind model IDs available through the LinkHarbor catalog.
View modelsConfigure agent tools for Anthropic-compatible workflows.
Set up tools