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.
The recommended setup uses environment variables for both the API key and the endpoint.
Install the official OpenAI SDK for your runtime. Make sure Python or Node.js is already available on your system.
pip install openaiYour 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"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"Once configured, start sending OpenAI-compatible requests.
The platform supports the standard OpenAI-compatible API format. All requests should include an Authorization header and a JSON content type.
https://api.linkharbor.ai/v1Send chat completion requests through the standard OpenAI-compatible endpoint.
https://api.linkharbor.ai/v1/chat/completionsSend chat completion requests through the standard OpenAI-compatible endpoint.
All OpenAI-compatible requests must include the following headers.
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonAll requests follow the standard OpenAI Chat Completions format.
{
"model": "your-model-name",
"messages": [
{
"role": "user",
"content": "Hello"
}
]
}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"
}
]
}'Three habits that keep your integration secure and resilient over time.
Avoid committing API keys to source code, examples, terminal history, or public repositories.
Cursor, Cline, OpenWebUI, the OpenAI SDK, and similar OpenAI-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.
Learn the request and response fields for OpenAI-compatible chat requests.
Read docsBrowse the model IDs you can pass to Chat Completions.
View modelsConfigure agent tools against LinkHarbor-compatible endpoints.
Set up tools