复制 redteam-deepseek - a Hugging Face Space by mikeee 。测试,例如:
curl -sS "https://mikeee-redteam-deepseek.hf.space/hf/v1/models" | jq ".data[].id"
输出
"deepseek-chat" "deepseek-coder"
然后就是用 token 发请求给 /hf/v1/chat/completions。例如:
curl -XPOST https://mikeee-redteam-deepseek.hf.space/hf/v1/chat/completions -H "Authorization: Bearer %TOKEN%" -H "Content-Type: application/json" --data "{\"model\": \"deepseek-chat\", \"messages\": [{\"role\": \"user\", \"content\": \"Say this is a test!\"}]}"
输出:
{"id":"","model":"deepseek_chat","object":"chat.completion", "choices":[{"index":0,"message":{"role":"assistant", "content":"好的,这是一次测试!让我们开始 吧。"},"finish_reason":"stop"}],"usage": {"prompt_tokens":1,"completion_tokens":1,"total_tokens":2},"created":1718946537}
%TOKEN% 部分填访问 https://chat.deepseek.com/ F12 取到的 userToken。
或整合成 oneapi/newapi 渠道。例如,代理: https://mikeee-redteam-deepseek.hf.space/hf, 密钥:%TOKEN%
抱抱脸空间需提子才能访问。但可以在小鸡上跑 newapi/oneapi 加渠道。多倒一次但节省了小鸡跑代理的资源。 |