智谱AI
GLM-4.6
智谱AI最新旗舰模型,代码能力对齐 Claude Sonnet 4,支持 200K 超长上下文,具备深度推理和工具调用能力
上下文长度200K tokens
模型类型大语言模型 (LLM)
特色能力代码生成、深度推理、工具调用
定价与规格
💰 定价
输入$2.25 / M tokens
输出$2.75 / M tokens
⚙️ 规格
上下文长度200K tokens
模型类型大语言模型 (LLM)
特色能力代码生成、深度推理、工具调用
语言优化中文
API 调用示例
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.xairouter.com/v1",
api_key="your-api-key"
)
response = client.chat.completions.create(
model="zai-glm-4.6",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)cURL
curl https://api.xairouter.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "zai-glm-4.6",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'