Anthropic-Compatible API
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.
Quick Start
The recommended setup uses environment variables for both the API key and the Anthropic-compatible endpoint.
Install Claude Code
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.
Configure API Key
Your API key authenticates requests to the Anthropic-compatible API. Store it in ANTHROPIC_API_KEY instead of hardcoding it in source code.
ANTHROPIC_API_KEY is the recommended variable for x-api-key authentication. Use ANTHROPIC_AUTH_TOKEN only if your gateway explicitly requires Bearer authentication.
Configure Anthropic-Compatible Endpoint
Set the base URL so Claude Code and Anthropic SDKs send requests to LinkHarbor instead of the default Anthropic endpoint.
Launch Claude Code
After configuring the API key and endpoint, start Claude Code from your terminal. You can also specify a model manually.
API Reference
The platform supports the standard Anthropic-Compatible API format. All requests should include x-api-key, anthropic-version, and content-type headers.
Base URL
https://api.linkharbor.ai/anthropicSend messages to Anthropic-compatible models using the standard /v1/messages endpoint and request schema.
Messages Endpoint
https://api.linkharbor.ai/anthropic/v1/messagesSend messages to Anthropic-compatible models using the standard /v1/messages endpoint and request schema.
Headers
All Anthropic-compatible requests must include the following headers.
Request Example
Standard Anthropic Messages format with model, max_tokens, and a messages array.
Examples
Use the official Anthropic SDK directly — no modification required. The same call shown in three languages.
Best Practices
Three habits that keep your integration secure and resilient over time.
Use environment variables
Avoid committing API keys to source code, examples, terminal history, or public repositories.
Use compatible tools
Claude Code, OpenClaw, Cline, OpenCode, and similar Anthropic-compatible clients can use this endpoint.
Use stable API keys
Long-lived keys reduce unexpected tool failures caused by frequent key rotation.
FAQ
Quick answers to the questions developers ask most.
Claude Code cannot connect. What should I check?
Why am I getting 401 Unauthorized?
Is the official Anthropic SDK supported?
What's next
OpenAI-Compatible API
Use LinkHarbor with OpenAI-compatible SDKs and tools.
View setupList Models
Find model IDs available through the LinkHarbor catalog.
View modelsOpenClaw
Configure agent tools for Anthropic-compatible workflows.
Set up tools