SDKs, Frameworks and Clients
Call ModelSite from official SDKs, common frameworks, coding assistants and chat clients: settings, the endpoint each uses, and a verification status for every entry
ModelSite exposes two entry points. Use the matching official SDK; no dedicated client is needed.
| Format | SDK | base_url | Actual request path | Auth header |
|---|---|---|---|---|
| OpenAI | openai | https://api.modelsite.ai/v1 | /v1/chat/completions, /v1/responses, /v1/embeddings | Authorization: Bearer |
| Anthropic | anthropic / @anthropic-ai/sdk | https://api.modelsite.ai (no /v1) | /v1/messages | Authorization: Bearer |
On the text-model entrances the platform reads the key only from Authorization: Bearer, never from x-api-key. Clients that speak the Anthropic protocol must therefore send Bearer (auth_token, ANTHROPIC_AUTH_TOKEN), as shown below. The video and image entrances (paths starting with /api/v1, /api/v3 and /v2) also accept X-API-KEY, which ComfyUI's built-in API nodes send; if both headers are present, Authorization: Bearer wins. See Use ModelSite in ComfyUI.
Verification status
Every entry below carries exactly one of three statuses:
| Status | Meaning |
|---|---|
| Checked against official docs | The tool's official documentation describes a custom base URL or an OpenAI-compatible provider, and the entry links to it. We did not run the tool. |
| Request captured against a stub server | We installed the tool in an isolated environment, pointed it at a local stub server (not ModelSite, no cost), and recorded the path, auth header and body fields it actually sends. The entry gives the tested version. |
| Not verified | Only indirect evidence exists, or we cannot tell from the code whether the platform meets the tool's protocol requirements. The entry says why. |
A stub server only shows what the client sends. It does not show that every upstream model behind ModelSite handles those requests. The "Limitations" lines record differences we found by reading code or official docs. Tools with no evidence are not listed; see Tools not listed.
API key
A new key is sk-ms- followed by 64 hex characters (70 characters in total). Older keys starting with sk-relay- still work. Every example below reads the key from the MODELSITE_API_KEY environment variable; do not hard-code a real key:
export MODELSITE_API_KEY="sk-ms-xxxxxxxx" # replace with the full key from the consoleThe OpenAI SDK reads only OPENAI_API_KEY; the Anthropic SDK reads ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN. None of them reads MODELSITE_API_KEY, so the examples below pass it to the SDK or tool explicitly.
Official SDKs
OpenAI SDK
- What it does: calls Chat Completions, Responses and Embeddings through the official OpenAI SDK.
- What to set:
base_url=https://api.modelsite.ai/v1; key sent asAuthorization: Bearer; model = a platform model ID such asglm-5.3-flash. - Endpoints:
/v1/chat/completions,/v1/responses,/v1/embeddings. - Status: request captured against a stub server (OpenAI Python 2.54.0, Node 6.49.0).
- Limitations: when a model's upstream has no native Responses support,
/v1/responsesgoes through a conversion path that differs from the official API; see the limitations in the Codex CLI entry.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.modelsite.ai/v1",
api_key=os.environ["MODELSITE_API_KEY"],
)
# Non-streaming
resp = client.chat.completions.create(
model="glm-5.3-flash",
messages=[{"role": "user", "content": "Hello"}],
)
print(resp.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="glm-5.3-flash",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")The same client can also call client.responses.create(...) (/v1/responses) and client.embeddings.create(...) (/v1/embeddings). See Responses and Embeddings for parameters.
Anthropic SDK
- What it does: calls Messages through the official Anthropic SDK.
- What to set:
base_url=https://api.modelsite.ai(no/v1); pass the key asauth_token/authToken, notapi_key; model = a platform model ID. - Endpoints:
/v1/messages. - Status: request captured against a stub server (Anthropic Python 1.15.0, Node 0.135.0). With
api_keythe key appears only in thex-api-keyheader and the platform returns401.
import os
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.modelsite.ai", # no /v1; the SDK appends /v1/messages
auth_token=os.environ["MODELSITE_API_KEY"], # sends Authorization: Bearer
)
# Non-streaming
msg = client.messages.create(
model="glm-5.3-flash",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content[0].text)
# Streaming
with client.messages.stream(
model="glm-5.3-flash",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
) as stream:
for text in stream.text_stream:
print(text, end="")The SDK sends anthropic-version: 2023-06-01 automatically. If you set anthropic-beta yourself, the platform forwards it upstream.
Frameworks
LangChain (Python)
- What it does: calls Chat Completions through
ChatOpenAIfromlangchain-openai. - What to set:
base_url=https://api.modelsite.ai/v1;api_key= the key;model= a platform model ID. - Endpoints:
/v1/chat/completions(non-streaming and streaming). - Status: request captured against a stub server (langchain-openai 1.7.2). The
base_urlandapi_keyparameters are described in the LangChain docs; withoutbase_urlit readsOPENAI_API_BASE, thenOPENAI_BASE_URL. - Limitations: the official docs say
ChatOpenAItargets the official OpenAI specification only; non-standard fields returned by third-party models (for examplereasoning_content) are not extracted or preserved. To read reasoning content, use the OpenAI SDK directly or a provider-specific integration package.
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://api.modelsite.ai/v1",
api_key=os.environ["MODELSITE_API_KEY"],
model="glm-5.3-flash",
)
print(llm.invoke("Hello").content)LlamaIndex (Python)
- What it does: calls any OpenAI-compatible Chat Completions service through
OpenAILikefromllama-index-llms-openai-like. - What to set:
api_base=https://api.modelsite.ai/v1;api_key= the key;model= a platform model ID;is_chat_model=True. - Endpoints:
/v1/chat/completions(chatandstream_chat). - Status: request captured against a stub server (llama-index-llms-openai-like 0.8.1).
- Limitations: we only tested
chatandstream_chat; embeddings and tool calling were not tested.
import os
from llama_index.llms.openai_like import OpenAILike
from llama_index.core.llms import ChatMessage
llm = OpenAILike(
model="glm-5.3-flash",
api_base="https://api.modelsite.ai/v1",
api_key=os.environ["MODELSITE_API_KEY"],
is_chat_model=True,
)
print(llm.chat([ChatMessage(role="user", content="Hello")]).message.content)Vercel AI SDK (TypeScript)
- What it does: calls models with
aiplus@ai-sdk/openai-compatible(or@ai-sdk/anthropic). - What to set:
baseURL=https://api.modelsite.ai/v1;apiKey(OpenAI-compatible) orauthToken(Anthropic) = the key; model = a platform model ID. - Endpoints:
createOpenAICompatible(...).chatModel()andcreateOpenAI(...).chat()use/v1/chat/completions;@ai-sdk/anthropicuses/v1/messages. - Status: request captured against a stub server (ai 6.0.309,
@ai-sdk/openai-compatible2.0.85,@ai-sdk/openai3.0.130,@ai-sdk/anthropic3.0.133). - Limitations:
createOpenAI(...)(model)requests/v1/responsesby default, not Chat Completions. Use.chat(model)for Chat Completions.- The
baseURLfor@ai-sdk/anthropicmust include/v1(the opposite of the official Anthropic SDK; we observed it appending/messagesdirectly). - With
apiKey,@ai-sdk/anthropicputs the key inx-api-key, which the platform does not read. PassauthToken.
import { generateText } from 'ai'
import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
const modelsite = createOpenAICompatible({
name: 'modelsite',
baseURL: 'https://api.modelsite.ai/v1',
apiKey: process.env.MODELSITE_API_KEY,
})
const { text } = await generateText({
model: modelsite.chatModel('glm-5.3-flash'),
prompt: 'Hello',
})Coding assistants
Claude Code
- What it does: Anthropic's terminal coding assistant, speaking the Anthropic Messages protocol.
- What to set:
ANTHROPIC_BASE_URL=https://api.modelsite.ai;ANTHROPIC_AUTH_TOKEN= the key;ANTHROPIC_MODEL= a platform model ID. - Endpoints:
/v1/messages(streaming). - Status: request captured against a stub server (Claude Code 2.1.303). The settings come from the Claude Code gateway docs.
export ANTHROPIC_BASE_URL="https://api.modelsite.ai"
export ANTHROPIC_AUTH_TOKEN="$MODELSITE_API_KEY"
export ANTHROPIC_MODEL="glm-5.3-flash"
claudeWhat we captured it sending:
POST /v1/messages?beta=truewithAuthorization: Bearer,stream: trueand 20 tool definitions. The gateway forwards by path only, so?beta=trueis ignored.- The body contains
thinking(observed value{"type":"adaptive","display":"omitted"}),context_management(clear_thinking_20251015) andoutput_config(effort). The headers carry severalanthropic-betavalues. - This run made a single
/v1/messagesrequest and nocount_tokensrequest.
Limitations:
- Use
ANTHROPIC_AUTH_TOKEN. The official docs sayANTHROPIC_API_KEYis sent asx-api-key, which the platform does not read, so it returns401.apiKeyHelpersends both headers and also works. - GLM models and
mediumeffort.glm-5.3andglm-5.3-flashsupport the effort levelslow,highandmax; when the effort level is set tomedium, the request runs athigh. Other chat models accept every level as sent. Details and a verified run: Claude Code. - For a model ID it does not recognize, Claude Code prints a notice and assumes a 200k context window; see the official model-config page for how to correct it.
- The official docs say the
opus/sonnet/haikualiases resolve to Anthropic model IDs by default. Point them at platform model IDs withANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODELandANTHROPIC_DEFAULT_HAIKU_MODEL. - When parsing the request the platform does not reject unrecognized top-level fields; it keeps them, and for models that do not use the native Anthropic endpoint they are carried through to the upstream. We have not checked, model by model, whether each upstream accepts
context_managementand similar fields. If you get a400such asExtra inputs are not permitted, setCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1as the official troubleshooting table says. - Tool calls and multi-turn conversations were not tested end to end (the stub returns text only).
Codex CLI
- What it does: OpenAI's terminal coding assistant, which speaks only the Responses protocol.
- What to set: a custom
model_providersentry in~/.codex/config.toml:base_url=https://api.modelsite.ai/v1,env_keynaming the environment variable that holds the key,wire_api = "responses";model= a platform model ID. - Endpoints:
/v1/responses(streaming). - Status: request captured against a stub server (codex-cli 0.142.2). The
model_providersfields are in the Codex configuration docs. The platform has known differences on this path; see the limitations below.
model = "glm-5.3-flash"
model_provider = "modelsite"
[model_providers.modelsite]
name = "ModelSite"
base_url = "https://api.modelsite.ai/v1"
env_key = "MODELSITE_API_KEY"
wire_api = "responses"What we captured it sending:
POST /v1/responseswithAuthorization: Bearer,stream: trueandstore: false.- Tool types
function,namespaceandweb_search; the body also hasinclude,prompt_cache_keyandclient_metadata. - If
MODELSITE_API_KEYis not set, Codex fails locally withMissing environment variableand sends nothing. - For a platform model ID Codex prints
Model metadata ... not foundand falls back to default metadata. OpenRouter's Codex guide records the same notice.
Limitations:
- Codex uses only
/v1/responses. When a model's upstream has no native Responses support, the platform uses a conversion path that differs from the official OpenAI API: the conversion path is now aligned with the official API: streamed events carrysequence_number,response.created/in_progress/completedecho the request fields, reasoning uses the officialsummarystructure (identical for streaming and non-streaming) and comes first inoutput, and streamed and non-streamed response IDs both start withresp_. Remaining differences: a function_call item'sidequals itscall_id; refusal content parts usetextinstead ofrefusal; the echoedstore,truncation,previous_response_idand similar are echoes only and the conversion path does not act on them. These alignments are covered by unit tests (official event sequences); we still have not verified end to end that Codex parses them correctly against the real platform. - On the conversion path, Responses-only request fields such as
store,includeandprevious_response_idhave no Chat Completions equivalent and are dropped. - Per the code, the conversion path turns
functionandcustomtools into Chat Completions function tools andweb_searchintoweb_search_options; there is no conversion branch for thenamespacetype. We have not verified whether upstreams acceptweb_search_options. In our capture, settingweb_search = "disabled"inconfig.toml(DeepSeek's Codex guide uses the same key) removed theweb_searchtool from the request.
OpenCode
- What it does: an open-source terminal coding assistant; connects to an OpenAI-compatible endpoint through a custom provider in
opencode.json. - What to set:
npm=@ai-sdk/openai-compatible;options.baseURL=https://api.modelsite.ai/v1;options.apiKey= the key; list the platform model IDs undermodels. - Endpoints:
/v1/chat/completions(streaming, withtools). - Status: request captured against a stub server (OpenCode 1.2.27). The settings are in the OpenCode provider docs.
- Limitations: the official docs say
@ai-sdk/openai-compatibleis for/v1/chat/completions; if a model uses/v1/responses, switch to@ai-sdk/openai, and the Responses limitations in the Codex entry apply.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"modelsite": {
"npm": "@ai-sdk/openai-compatible",
"name": "ModelSite",
"options": {
"baseURL": "https://api.modelsite.ai/v1",
"apiKey": "{env:MODELSITE_API_KEY}"
},
"models": {
"glm-5.3-flash": { "name": "GLM 5.3 Flash" }
}
}
}
}Run it with opencode run -m modelsite/glm-5.3-flash "Hello".
Aider
- What it does: a terminal pair-programming tool that works in a git repository.
- What to set:
OPENAI_API_BASE=https://api.modelsite.ai/v1;OPENAI_API_KEY= the key;--model openai/followed by a platform model ID. - Endpoints:
/v1/chat/completions(streaming). - Status: request captured against a stub server (Aider 0.86.2). The settings are in the Aider docs.
- Limitations: the model name must carry the
openai/prefix, and the official docs say Aider warns about models it does not recognize. Aider readsOPENAI_API_KEY, so export the key into that variable.
export OPENAI_API_BASE="https://api.modelsite.ai/v1"
export OPENAI_API_KEY="$MODELSITE_API_KEY"
aider --model openai/glm-5.3-flashCline
- What it does: a coding assistant inside VS Code; connects through the OpenAI Compatible provider.
- What to set: API Provider =
OpenAI Compatible; Base URL =https://api.modelsite.ai/v1; API Key = the key; Model ID = a platform model ID. - Endpoints: OpenAI-compatible Chat Completions, that is
/v1/chat/completions. - Status: checked against official docs: Cline OpenAI Compatible lists the Base URL, API Key and Model ID fields used above. We did not run Cline, so the exact path it requests is not captured.
- Limitations: the docs say the Base URL must not be
https://api.openai.com/v1and that model IDs differ between providers. Context window, max output and tool-calling support are optional "Model Configuration" fields; set them to match the platform model.
Continue
- What it does: a coding assistant and CLI for VS Code and JetBrains.
- What to set: one entry under
modelsinconfig.yaml:provider: openai,apiBase: https://api.modelsite.ai/v1,apiKey= the key,model= a platform model ID. - Endpoints:
provider: openaiuses Chat Completions by default, that is/v1/chat/completions. - Status: checked against official docs: Continue OpenAI provider shows the same
apiBaseoverride for OpenAI-compatible servers. We did not run Continue. - Limitations: the docs say Continue uses
/responsesby default for o-series and gpt-5 models and thatuseResponsesApi: falseturns it off. Platform model IDs are neither, and we have not verified how it picks a path for other model names.
models:
- name: glm-5.3-flash
provider: openai
model: glm-5.3-flash
apiBase: https://api.modelsite.ai/v1
apiKey: sk-ms-xxxxxxxxChat clients
Cherry Studio
- What it does: a desktop chat client; add an OpenAI-compatible endpoint under "custom provider".
- What to set: provider type =
OpenAI; API address =https://api.modelsite.ai(the client appends/v1/chat/completions) orhttps://api.modelsite.ai/v1/chat/completions#; API key = the key; models = add model IDs from the model list manually. - Endpoints:
/v1/chat/completions. - Status: checked against official docs: Cherry Studio provider settings. Two statements there match the setup above: entering a root address makes the client append
/v1/chat/completions, and an address ending in#is used exactly as entered. We did not click through it in the client.
Open WebUI
- What it does: a self-hosted web chat interface; add an OpenAI-compatible service under Connections.
- What to set: Settings > Admin > Connections > Add Connection: URL =
https://api.modelsite.ai/v1; API Key = the key; fill the model ID allowlist as needed. - Endpoints:
/v1/chat/completions; "Verify Connection" requestsGET /v1/models. - Status: checked against official docs: the Open WebUI OpenAI-compatible provider page lists the same fields. We did not run Open WebUI. The platform answers
GET /v1/modelsin the gateway itself (per the gateway routing code), and the request must carryAuthorization: Bearer. - Limitations: the docs say saving a connection does not test it, and a failed "Verify Connection" does not mean chat is broken; if the
/modelslist is not what you expect, fill the model ID allowlist by hand.
Workflow platforms
No entries yet: for Dify, n8n and similar tools we could not retrieve official documentation for a custom OpenAI-compatible endpoint, and we did not capture any requests.
Tools not listed
These tools are not listed because we have no evidence, not because they are known not to work:
- Cursor: we could not retrieve the official page for overriding the OpenAI base URL. The only sources are third-party gateway docs and forum posts, which mention that the override covers only the chat panel, needs a paid plan and interacts with Cursor's own models. We verified none of that.
- Chatbox, LobeChat, Roo Code, Kilo Code, GitHub Copilot, Gemini CLI, Qwen Code, Goose, Zed and similar: we found no official configuration page and captured no requests.
- Dify, n8n, Flowise and other workflow platforms: same.
Tools that offer an "OpenAI-compatible provider with a custom Base URL" can follow the fields in the Cline, Continue and OpenCode entries: Base URL https://api.modelsite.ai/v1 and a platform model ID. That is an analogy, not a verified result.
Common errors
| Symptom | Cause | Fix |
|---|---|---|
OpenAI SDK gets 404 page not found | base_url lacks /v1, so the SDK requests /chat/completions | Use https://api.modelsite.ai/v1 |
Anthropic SDK gets 404 | base_url has an extra /v1; the SDK builds /v1/v1/messages, which is not a platform route | Use https://api.modelsite.ai (@ai-sdk/anthropic is the exception: include /v1) |
401, missing or invalid authorization header | A client speaking the Anthropic protocol used api_key / apiKey / ANTHROPIC_API_KEY, so the key is in x-api-key, which the platform does not read | Use auth_token / authToken / ANTHROPIC_AUTH_TOKEN |
401, invalid key format | The key does not start with sk-ms- or sk-relay-, or is shorter than 20 characters | Copy the full key from the console |
401, invalid API key | The key is revoked, expired, or was copied incompletely | Check the key's status and expiry in the console |
| SDK complains the API key is missing | Assuming the SDK reads MODELSITE_API_KEY | Pass it to api_key / auth_token explicitly, or use the tool's own variable name |
Codex reports Missing environment variable | The variable named by env_key is not set | export MODELSITE_API_KEY=... before starting Codex |
| Model not found | Used an upstream vendor's own model name (for example DeepSeek's official deepseek-flash) | Use the platform model ID from the model list |
How we tested
"Request captured against a stub server" means: install the tool in an isolated directory with its own HOME and config directory, point it at a stub server on 127.0.0.1, and have the stub log the path, auth header and body fields before returning a fixed minimal response. No real key was used and no paid API was called. The 404 and 401 responses come from key-less requests to api.modelsite.ai.