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.

DocsOpenAI-Compatible API
Advanced

OpenAI-Compatible API

Use LinkHarbor with the official OpenAI SDK, Cursor, Cline, OpenWebUI, and other OpenAI-compatible tools without modifying the 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 endpoint.

Install OpenAI SDK

Install the official OpenAI SDK for your runtime. Make sure Python or Node.js is already available on your system.

pip install openai

Configure API Key

Your API key authenticates requests to the OpenAI-compatible API. Store it in an environment variable instead of hardcoding it in source code.

export OPENAI_API_KEY="YOUR_API_KEY"

Configure OpenAI-Compatible Endpoint

Set the base URL so the SDK sends requests to LinkHarbor instead of the default OpenAI endpoint.

export OPENAI_BASE_URL="https://api.linkharbor.ai/v1"

Start Using

Once configured, start sending OpenAI-compatible requests.

API Reference

The platform supports the standard OpenAI-compatible API format. All requests should include an Authorization header and a JSON content type.

Base URL

https://api.linkharbor.ai/v1

Send chat completion requests through the standard OpenAI-compatible endpoint.

Chat Completions Endpoint

https://api.linkharbor.ai/v1/chat/completions

Send chat completion requests through the standard OpenAI-compatible endpoint.

Headers

All OpenAI-compatible requests must include the following headers.

Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Example

All requests follow the standard OpenAI Chat Completions format.

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

Examples

Use the official OpenAI SDK directly — no modification required. The same call shown in three languages.

curl https://api.linkharbor.ai/v1/chat/completions \
  --header "Authorization: Bearer $OPENAI_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "your-model-name",
    "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

Cursor, Cline, OpenWebUI, the OpenAI SDK, and similar OpenAI-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.

Why am I getting 401 Unauthorized?
Check that the API key is valid, not expired or revoked, and sent as Authorization: Bearer YOUR_API_KEY.
Why is the API not responding?
Check your network connection, model name, and that OPENAI_BASE_URL points to the LinkHarbor OpenAI-compatible endpoint.
Is the official OpenAI SDK supported?
Yes. You can integrate directly with the official OpenAI SDK by changing the base URL and API key.

What's next

Chat Completions

Learn the request and response fields for OpenAI-compatible chat requests.

Read docs

List Models

Browse the model IDs you can pass to Chat Completions.

View models

OpenClaw

Configure agent tools against LinkHarbor-compatible endpoints.

Set up tools
Need help?Contact support →