代码示例

各种编程语言的API使用示例,帮助您快速上手和集成。

1import requests
2 
3url = "https://aiberm.com/v1/chat/completions"
4headers = {
5 "Authorization": "Bearer YOUR_API_KEY",
6 "Content-Type": "application/json"
7}
8data = {
9 "model": "google/gemini-2.5-flash",
10 "messages": [{"role": "user", "content": "Hello!"}]
11}
12 
13response = requests.post(url, headers=headers, json=data)
14print(response.json())