Getting Started
Your first request
Send your first chat request to ModelSite with the OpenAI SDK
Swap your existing OpenAI client's base_url to ModelSite and you can call Claude, GPT, DeepSeek, GLM, Qwen, MiniMax and every other model.
Basics
| Field | Value |
|---|---|
| Base URL | https://api.modelsite.ai/v1 |
| Auth | Authorization: Bearer $MODELSITE_API_KEY |
| Formats | OpenAI-compatible (/chat/completions), Anthropic-compatible (/messages) |
Make the request
POST
/v1/chat/completionsfrom openai import OpenAI
client = OpenAI(
api_key="ms_live_sk_xxxxxxxx", # or env var MODELSITE_API_KEY
base_url="https://api.modelsite.ai/v1",
)
resp = client.chat.completions.create(
model="claude-sonnet-4.6",
messages=[{"role": "user", "content": "Hello, tell me about yourself"}],
)
print(resp.choices[0].message.content)The model name claude-sonnet-4.6 is illustrative. For the full, up-to-date model ID list, query GET /v1/models — see Models.
Response example
{
"id": "chatcmpl-xxxxx",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hi! I'm a large language model running on ModelSite…" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 12, "completion_tokens": 28, "total_tokens": 40 }
}Next steps
- Using the Anthropic SDK? See Messages (Anthropic-compatible)
- Want streaming? See the streaming section of Chat Completions
- Want to understand billing and failover? See Billing and Failover