关于 token
你可以自己试试 看看返回值里面 usage 信息
curl
https://api.openai.com/v1/chat/completions \
> -H 'Content-Type: application/json' \
> -H 'Authorization: Bearer sk-K46Nad7nlnJNGqSLdgajT3OlbkFJaEQJFZuDBFLaWLkhOWTB' \
> -d '{
> "model": "gpt-3.5-turbo-0301",
> "messages": [{"role": "user", "content": "Hello!你知道佳能 EOS R8 吗"}]
> }'
{"id":"chatcmpl-6pT9RtviJvUSMX5FbVPW64274nbXB","object":"chat.completion","created":1677724805,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":20,"completion_tokens":23,"total_tokens":43},"choices":[{"message":{"role":"assistant","content":"\n\n 抱歉,作为 AI 语言模型,我不知道这个信息。"},"finish_reason":"stop","index":0}]}
这一段话就用了 43 个 token 请求回复都算