LinkexLinkex Docs
Integrations

OpenAI SDK (any language)

The generic recipe — swap the base URL, keep everything else.

Any OpenAI-compatible client works with Linkex by changing two values: the base URL and the API key. This covers the official OpenAI SDKs, LangChain, LlamaIndex, Vercel AI SDK, and most agent frameworks.

The recipe

SettingValue
Base URLhttps://linkex.ai/v1
API keyyour Linkex sk-... key
Modelany id from linkex.ai/pricing
from openai import OpenAI

client = OpenAI(base_url="https://linkex.ai/v1", api_key="sk-YOUR_KEY")

# streaming works as usual
stream = client.chat.completions.create(
    model="claude-sonnet-4-5",
    messages=[{"role": "user", "content": "Stream me a haiku"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Other request formats

Beyond the OpenAI format, the same key also authenticates:

  • Anthropic MessagesPOST https://linkex.ai/v1/messages (see Claude Code)
  • Geminihttps://linkex.ai/v1beta/models/...

Common errors

HTTPCauseFix
401Bad or disabled keyRecreate the key in Console → Keys; check the Bearer prefix
403Model not enabled for your token/groupCheck the key's model restrictions in the console
429Rate limitBack off and retry; per-key limits protect the shared account
Insufficient balance errorBalance exhaustedTop up
404 on modelWrong model idCopy the exact id from GET /v1/models or the pricing page

On this page