ModelSiteAPI

Install an SDK

Connect to ModelSite with the OpenAI / Anthropic SDK you already know

ModelSite offers OpenAI-format and Anthropic-format endpoints. Use the matching official SDK; no dedicated client is needed.

pip install openai
npm install openai

Anthropic format

If you already use the Anthropic SDK:

pip install anthropic
npm install @anthropic-ai/sdk

After installing, see SDKs and Tools for the base_url, authentication (the Anthropic SDK must use auth_token) and full examples.

curl only

Don't want an SDK? Send plain HTTP + JSON:

curl https://api.modelsite.ai/v1/chat/completions \
  -H "Authorization: Bearer $MODELSITE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.3-flash","messages":[{"role":"user","content":"Hi"}]}'

Set your environment variable

Check that the environment variable is set (this prints only the prefix, so the full key stays out of your terminal history):

echo ${MODELSITE_API_KEY:0:6}

→ Next: Your first request.

On this page