Core Concepts
Authentication
One bearer token. Created, rotated, and revoked from the dashboard.
Authenticate with a single API key sent as a bearer token. OpenLink accepts both Authorization: Bearer sk_... and the shorter x-api-key: sk_... header.
Sending the key
import { OpenLink } from "@openlink/sdk";
const client = new OpenLink({ apiKey: process.env.OPENLINK_API_KEY });curl https://openlink-1.onrender.com/v1/chat \
-H "Authorization: Bearer $OPENLINK_API_KEY" \
-d '{"messages":[{"role":"user","content":"hello"}]}'Key lifecycle
- Create — dashboard → API Keys → Create key. The full key is shown once.
- Rotate — create a new key, deploy it, revoke the old one. There is no key update endpoint.
- Revoke — instant, takes effect on the next request, logged in the audit feed.
Where keys must never go
Server-side only
Never ship a key in browser or mobile code. Because a key is worth money across all three providers, treat it like a database credential.
Security notes
Keys are stored hashed at rest, are shown in full once at creation, and every authenticated call records the key ID in the request log. A leaked key is revoked and the traffic history stays yours to audit.