Protocols and tool integration
Select a supported wire protocol and distinguish format compatibility from model capabilities.
Updated
Protocol matrix
| Tool / client | Base URL | Protocol | Verification boundary |
|---|---|---|---|
| OpenAI SDK | https://www.link42.ai/v1 | Chat Completions / Responses / JSON Images / Embeddings | Streaming/tools/JSON depend on the model; not all OpenAI cloud APIs are implemented. |
| Anthropic SDK / Claude Code | https://www.link42.ai/anthropic | Messages / count_tokens | Use an API model ID; tools/reasoning/cache depend on route and model. |
| Codex | https://www.link42.ai/v1 | Responses | Custom provider uses wire_api=responses and env_key=LINK42_API_KEY, not Chat wire format. |
| Gemini REST / configurable JS SDK | https://www.link42.ai/gemini | v1beta/models/...:generateContent (REST) | Requires a Gemini-capable route. Custom Base URL support in Google GenAI SDKs varies by version and mode; the REST URL is not a universal SDK setting. |
| OpenClaw / other agents | https://www.link42.ai/v1 | Select the tool's documented OpenAI format; the skill calls media separately. | Back up config; do not overwrite global tools, security or authentication. |
Minimal profiles
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ['LINK42_API_KEY'], base_url='https://www.link42.ai/v1')
models = client.models.list()
# Select an authorized model before creating a billable request.import os
from anthropic import Anthropic
client = Anthropic(api_key=os.environ['LINK42_API_KEY'], base_url='https://www.link42.ai/anthropic')
# messages.create(model='AUTHORIZED_MODEL', max_tokens=1024, messages=[...])import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({
apiKey: process.env.LINK42_API_KEY,
httpOptions: { baseUrl: "https://www.link42.ai/gemini", apiVersion: "v1beta" },
});
// ai.models.generateContent({ model: "AUTHORIZED_MODEL", contents: "Hello" })model_provider = "link42"
model = "AUTHORIZED_MODEL"
[model_providers.link42]
name = "LINK42"
base_url = "https://www.link42.ai/v1"
env_key = "LINK42_API_KEY"
wire_api = "responses"export ANTHROPIC_BASE_URL="https://www.link42.ai/anthropic"
export ANTHROPIC_AUTH_TOKEN="$LINK42_API_KEY"
export ANTHROPIC_MODEL="AUTHORIZED_MODEL"
claudeAcceptance and troubleshooting
Read the authorized catalogue
Verify the key, IP allowlist, model scope and balance. Website visibility is not proof of callability.
Check the actual protocol
Test replies, SSE events, tool calls and usage separately. A model list is not generation success.
Retain error evidence
401: auth; 403: scope; 402: balance/budget; 429: rate limits; no_account_available: routes/entitlements. Save sanitized request IDs and do not automatically replay paid POSTs.
- Protocol error shapes and recovery markers are preserved with credential filtering, not byte-for-byte upstream errors. Cross-protocol conversion does not make every vendor-specific feature portable.