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兼容接口时,填写规范与上述对齐即可。
@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