All API requests require an API key. OpenAI-compatible requests use a Bearer token, while Anthropic-compatible requests use the x-api-key header.
API keys are created in the LinkHarbor workspace under API Keys. The exact key prefix may vary by environment, so treat the full value as a secret password.
Use the header format that matches the interface you are calling. Do not mix OpenAI-compatible and Anthropic-compatible authentication headers.
Authorization: Bearer YOUR_API_KEYStore your API key and the matching endpoint in environment variables to keep them out of source code.
export OPENAI_API_KEY="YOUR_API_KEY"
export OPENAI_BASE_URL="https://api.linkharbor.ai/v1"When using official SDKs, pass both the LinkHarbor base URL and the environment variable expected by that SDK or tool.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.linkharbor.ai/v1",
api_key=os.environ["OPENAI_API_KEY"],
)Use OPENAI_API_KEY with the OpenAI-compatible endpoint and ANTHROPIC_API_KEY with the Anthropic-compatible endpoint. LINKHARBOR_API_KEY is not used in these standard SDK examples.