cURL
直接使用 curl 调用:
bash
# 非流式请求
curl https://api.ogmiao.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"model": "glm-4.7-flash",
"messages": [{"role": "user", "content": "Hello!"}]
}'
# 流式请求
curl https://api.ogmiao.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"model": "glm-4.7-flash",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}'