评论列表
🎊
阳刚的木瓜 2024-11-05 17:02:19 回复
自定义 API 基础地址 怎么填? 我这边可以这样调用api:

response = requests.post(
url="https://openrouter.ai/api/v1/chat/completions",
headers={
"Authorization": f"Bearer {OPENROUTER_API_KEY}",
"HTTP-Referer": f"{YOUR_SITE_URL}",
"X-Title": f"{YOUR_APP_NAME}",
},
data=json.dumps({
"model": "openai/gpt-3.5-turbo", # Optional
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]

})
)

---
我填 https://openrouter.ai/api/, 禅道会报错: 连接失败:JSON decode error:Syntax error
回复
方便描述下目前需要通过接口获取什么数据吗?