Files
python----/大模型/demo.ipynb
T
admin 2d8c1ea8f9 chore: 批量新增各类工具脚本与配置文件
1. 新增音频录制、下载、上传相关脚本
2. 新增数据库操作、API调用工具
3. 新增Excel数据处理脚本
4. 新增弱密码检测脚本
2026-06-14 17:47:15 +08:00

3.9 KiB

In [1]:
import requests

base_url = "https://console.pivotbak.cfd/v1"
api_key = "sk-e5246cf15eed1c8c1b94f172c95115de3ae5413eaa5b0366810fa7842de6ada1"

resp = requests.get(
    f"{base_url}/models",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    timeout=30,
)

print(resp.status_code)
print(resp.json())
401
{'code': 'INVALID_API_KEY', 'message': 'Invalid API key'}
In [11]:
import os
from curl_cffi import requests

BASE_URL = "https://console.pivotbak.cfd/v1"
API_KEY = "sk-e5246cf15eed1c8c1b94f172c95115de3ae5413eaa5b0366810fa7842de6ada1"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "x-api-key": API_KEY,
    "Accept": "*/*",
    "Content-Type": "application/json",
    "sec-ch-ua-platform": '"Windows"',
    "sec-ch-ua": '"Not-A.Brand";v="24", "Chromium";v="146"',
    "sec-ch-ua-mobile": "?0",
    "x-title": "Cherry Studio",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) CherryStudio/1.9.9 Chrome/146.0.7680.188 Electron/41.2.1 Safari/537.36",
    "HTTP-Referer": "https://cherry-ai.com",
    "Sec-Fetch-Site": "cross-site",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Dest": "empty",
    "Accept-Encoding": "gzip, deflate, br, zstd",
    "Accept-Language": "zh-CN",
    "Priority": "u=1, i",
}

resp = requests.get(
    f"{BASE_URL}/models",
    headers=headers,
    impersonate="chrome136",
    timeout=30,
)

print("status:", resp.status_code)
print(resp.text)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[11], line 2
      1 import os
----> 2 from curl_cffi import requests
      4 BASE_URL = "https://console.pivotbak.cfd/v1"
      5 API_KEY = "sk-e5246cf15eed1c8c1b94f172c95115de3ae5413eaa5b0366810fa7842de6ada1"

ModuleNotFoundError: No module named 'curl_cffi'