马老师现在是“入朝不拜、赞拜不名、剑履上殿“了,也同时为我们带来了grok的免费试用api
注册可以用X或者谷歌账号登录,邮箱也行
https://console.x.ai
同意协议,创建并复制 API
xai-r3iT0DGhd4oxD1TNcXxcLn5TvgCZZSEPUYMPRRsIEKrKLs6ZW77dkb4fF4PB06dtmn805j9yLOXaZIBP
请求格式
curl https://api.x.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $XAI_API_KEY" \
-d '{
"messages": [
{
"role": "system",
"content": "You are Grok, a chatbot inspired by the Hitchhikers Guide to the Galaxy."
},
{
"role": "user",
"content": "What is the meaning of life, the universe, and everything?"
}
],
"model": "grok-beta",
"stream": false,
"temperature": 0
}'
api地址就是上面的
https://api.x.ai
打开你的gpt平台,填入API,模型如果是自定义就写grok-beta
,检测通过就可以使用了
转自:来源