LinkHarborLinkHarbor
ModelsPricingDocsContactStudioChat
Log inStart free
⌘K

Getting Started

  • Quick Start
  • Authentication

API Reference

  • List Models
  • Chat Completions
  • Error Codes

Advanced

  • OpenClaw
  • OpenAI-Compatible
  • Anthropic-Compatible
LinkHarborLinkHarbor

Unified AI model API gateway — access the world's leading LLMs in one place

Product

  • Models
  • Pricing

Resources

  • Docs
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Future Intelligence Pte. Ltd. All rights reserved.

DocsAnthropic-Compatible API
Advanced

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.

npm install -g @anthropic-ai/claude-code

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.

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.

Configure Anthropic-Compatible Endpoint

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"

Launch Claude Code

After configuring the API key and endpoint, start Claude Code from your terminal. You can also specify a model manually.

claude

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/anthropic

Send messages to Anthropic-compatible models using the standard /v1/messages endpoint and request schema.

Messages Endpoint

https://api.linkharbor.ai/anthropic/v1/messages

Send messages to Anthropic-compatible models using the standard /v1/messages endpoint and request schema.

Headers

All Anthropic-compatible requests must include the following headers.

Headers
x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
content-type: application/json

Request Example

Standard Anthropic Messages format with model, max_tokens, and a messages array.

JSON
{
  "model": "your-model-name",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}

Examples

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"
      }
    ]
  }'

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?
Verify that the API key is correct, ANTHROPIC_BASE_URL points to the LinkHarbor endpoint, and Node.js is version 18 or later.
Why am I getting 401 Unauthorized?
Check that the API key is valid, not expired or revoked, and sent as x-api-key: YOUR_API_KEY.
Is the official Anthropic SDK supported?
Yes. You can use the official Anthropic SDK by changing the base URL and API key.

What's next

OpenAI-Compatible API

Use LinkHarbor with OpenAI-compatible SDKs and tools.

View setup

List Models

Find model IDs available through the LinkHarbor catalog.

View models

OpenClaw

Configure agent tools for Anthropic-compatible workflows.

Set up tools
Need help?Contact support →