Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
通过 OpenAI 兼容接口调用智谱 GLM-5 对话模型,��大的新一代 GLM 模型。
curl https://www.anyfast.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5", "messages": [ { "role": "user", "content": "用简单的语言解释量子纠缠。" } ] }'
from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) response = client.chat.completions.create( model="glm-5", messages=[ {"role": "user", "content": "用简单的语言解释量子纠缠。"} ] ) print(response.choices[0].message.content)
from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://www.anyfast.ai/v1" ) stream = client.chat.completions.create( model="glm-5", messages=[ {"role": "user", "content": "写一首关于大海的短诗。"} ], stream=True ) for chunk in stream: print(chunk.choices[0].delta.content or "", end="")
model
glm-5
messages
{ role, content }
max_tokens
temperature
0
2
1
stream
false
top_p
stop
此页面对您有帮助吗?