Skip to content

Instantly share code, notes, and snippets.

@GrayXu
Last active November 13, 2025 08:29
Show Gist options
  • Select an option

  • Save GrayXu/f1b72353b4b0493d51d47f0f7498b67b to your computer and use it in GitHub Desktop.

Select an option

Save GrayXu/f1b72353b4b0493d51d47f0f7498b67b to your computer and use it in GitHub Desktop.
OpenAI GPT API for Zotero-PDF-Translate

This gist is for zotero-pdf-translate.
Please ask your question at repo issues for faster responses
请在仓库issue进行提问以获得更快的回复


  1. Register an account on the OpenAI website.
  2. After successful registration, go to API keys and create an key, which looks like sk-XXXXXX.
  3. Fill in the url with the complete URL, such as https://api.openai.com/v1/chat/completions.
  4. For the model, enter a model name such as gpt-4o.
  5. When using the official OpenAI API, ensure your network environment allows direct connection to OpenAI .
  6. When using a 3-party OpenAI compatible API, follow the same format as above.

  1. OpenAI网站注册账号。
  2. 注册成功后,打开API keys,创建密钥(API Secret Key),如sk-XXXXXX
  3. 接口填写如https://api.openai.com/v1/chat/completions的完整调用URL。
  4. 模型填写如gpt-4o的模型名。
  5. 使用官方接口需要确保你的网络环境可以直连OpenAI。
  6. 使用第三方OpenAI兼容接口时,填写规范与上述对齐即可。
@UpsilonYHZ
Copy link

UpsilonYHZ commented Jul 20, 2025

@AoweiLi zotero7吗

感谢插件
同求禁止思考选项,zotero7

@gptfortest00
Copy link

可以使用非语言模型吗?阿里千问出了qwen-mt-turbo翻译模型,感觉翻译效果很好,2元/百万token,但是不是大语言模型
1753452830894
在配置里自定义了参数,不论选中什么内容输出结果都是“中文”两个字
Uploading 1753452863256.png…

@gptfortest00
Copy link

1753452863256 补个图,我是这样设置的,不能正确翻译

@nvzi2
Copy link

nvzi2 commented Jul 27, 2025

接千问mtplus的有成功的吗,我咋怎么试都翻译不了,总显示这个Error: HTTP POST https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions failed with status code 400:

@tomchangg
Copy link

tomchangg commented Aug 18, 2025

屏幕截图 2025-08-18 171950 自定义配置后,无法保存(即使点了保存,也只会保存接口与模型)?

已解决,温度设为0或者1的整数即可

@bonjour-cell
Copy link

您好,请问一下后续会考虑一下自定义的本地部署模型想deepseek、Qwen 3这样的可以思考的模型添加一个禁止思考的选项吗,就是直接可以输出翻译的文本而不是先思考一串才回复,现在ollama官方已经添加了接口中的选项,可以控制是否呈现思考的过程,参考原文(在2025.5.30新出的功能):https://ollama.com/blog/thinking

提示词后面加上 /no_think

@Exlog42
Copy link

Exlog42 commented Sep 2, 2025

图片 我的配置,可以正常使用

@phyrevue
Copy link

image image 自定义GPT使用newapi中转gemini的api,好像请求中没有英文原文?

@phyrevue
Copy link

image image 自定义GPT使用newapi中转gemini的api,好像请求中没有英文原文?

改用自带的gemini请求,修改api地址后可以了

@lbybingyu-wq
Copy link

你好解决了吗?我也是这种问题

@congwangsuda
Copy link

你好解决了吗?我也是这种问题

要在提示词中提供几个占位符,
${langFrom} :源语言(即原文的语言)
${langTo} :目标语言(即希望翻译成的语言)
${sourceText} :输入文本(需要翻译的原始文本内容)

可以参考上面一个兄弟的提示词:
As an academic expert with specialized knowledge in iron and steel making, please provide a proficient and precise translation from ${langFrom} to ${langTo}.
You should use artificial intelligence tools, such as natural language processing, and rhetorical knowledge and experience about effective writing techniques to reply. Make the reply looks like a native speaker.
Some specific terms such as name do not need to be translated.
The text is as follows: ${sourceText}
Please provide the translated result without any additional explanation.

@0LeePriest
Copy link

屏幕截图 2024-12-19 104244 不翻译也不报错是为什么

好兄弟解决了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment