请求示例
OpenAIAnthropicPython
curl https://www.mcdmadmin.cn/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-你的API Key" \
-d '{
"model": "Qwen3.5-2B",
"messages": [{"role": "user", "content": "你好"}]
}'
curl https://www.mcdmadmin.cn/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-你的API Key" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "Qwen3.5-2B",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "你好"}]
}'
from openai import OpenAI
client = OpenAI(
base_url = "https://www.mcdmadmin.cn/v1",
api_key = "sk-你的API Key",
)
resp = client.chat.completions.create(
model = "Qwen3.5-2B",
messages = [{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content)