Quickstart
Three steps: create an API key, pick a protocol, make your first call. Every standard protocol shares the same key and the same gateway origin.

1. Create an API key
Sign in to the console → API keys → Create key. The secret is shown in full only once; store it somewhere safe right away, for example the LINK42_API_KEY environment variable, and never put it in frontend code or commit it.
When you create it you can limit the models, source IPs and spending of that key; the defaults are fine to start with. See "Advanced settings" at the end of this page.
2. Gateway origin and authentication
The data-plane origin is https://www.link42.ai. Clients that support a custom Base URL use the matching protocol address below and append their own operation path. Standard protocols use the Authorization: Bearer header; the Anthropic SDK's x-api-key and the Gemini SDK's x-goog-api-key are accepted as well.
| Protocol | Base URL / endpoint | Auth header |
|---|---|---|
| OpenAI compatible | https://www.link42.ai/v1 | Authorization: Bearer sk-… |
| Anthropic compatible | https://www.link42.ai/anthropic | x-api-key: sk-… or Authorization: Bearer |
| Gemini compatible | https://www.link42.ai/gemini | x-goog-api-key: sk-… |
| Video tasks | https://www.link42.ai/v1/videos | Authorization: Bearer sk-… |
3. Your first call
POST/v1/chat/completions
The examples below use glm-5-3-flash, a text model available in the catalogue now. To use another one, call GET https://www.link42.ai/v1/models with the same key and put a different id in model.
curl https://www.link42.ai/v1/chat/completions \
-H "Authorization: Bearer $LINK42_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5-3-flash",
"messages": [{"role": "user", "content": "Introduce yourself in one sentence"}]
}'import os
from openai import OpenAI
client = OpenAI(base_url="https://www.link42.ai/v1", api_key=os.environ["LINK42_API_KEY"])
response = client.chat.completions.create(
model="glm-5-3-flash",
messages=[{"role": "user", "content": "Introduce yourself in one sentence"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://www.link42.ai/v1", apiKey: process.env.LINK42_API_KEY });
const response = await client.chat.completions.create({
model: "glm-5-3-flash",
messages: [{ role: "user", content: "Introduce yourself in one sentence" }],
});
console.log(response.choices[0].message.content);- Start from the official provider price. Use the first configured rate in this order: account-model specific, account default, model default, then list price. Zero is free and ten is full price; rates do not stack with group or service-tier factors. Submission freezes the price and rate; past bills are not repriced.
- The X-Request-Id response header is your troubleshooting handle; include it when contacting support.
Next steps
For text chat see OpenAI Chat Completions or Anthropic Messages; for image generation see Images; video generation is an async task, see "Video tasks"; to use Claude Code, Codex, Cursor and similar tools, see "Connect your coding agent".
Advanced settings
Each key independently supports a model allowlist (allowed_models), model-category permissions (allowed_model_groups), an IP allowlist, total/daily/monthly spending caps, RPM/TPM/concurrency limits, expiry and enable/disable status. These caps belong to that key, not the entire platform. The routing group (group_id) is a separate routing constraint, not the only way to restrict models; it does not change the sale price of new requests.
New keys start with sk- and use the standard_v1 compatibility profile; ak- keys migrated from the legacy system keep the legacy_v1 profile, which behaves byte-for-byte like the old API. The older /v1/messages and /v1beta/models/... paths remain compatible; custom endpoint support in Gemini SDKs varies by version and mode. Migrating from the legacy system, see "Private protocol compatibility layer".
| Protocol | Base URL / endpoint | Auth header |
|---|---|---|
| Private protocol (legacy) | https://www.link42.ai/server | apiKey field in the request body |