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.
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.
Configure OpenAI-Compatible Endpoint
Set the base URL so the SDK sends requests to LinkHarbor instead of the default OpenAI endpoint.
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/v1Send chat completion requests through the standard OpenAI-compatible endpoint.
Chat Completions Endpoint
https://api.linkharbor.ai/v1/chat/completionsSend chat completion requests through the standard OpenAI-compatible endpoint.
Headers
All OpenAI-compatible requests must include the following headers.
Request Example
All requests follow the standard OpenAI Chat Completions format.
Examples
Use the official OpenAI 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
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?
Why is the API not responding?
Is the official OpenAI SDK supported?
What's next
Chat Completions
Learn the request and response fields for OpenAI-compatible chat requests.
Read docsList Models
Browse the model IDs you can pass to Chat Completions.
View modelsOpenClaw
Configure agent tools against LinkHarbor-compatible endpoints.
Set up tools