连接器指南阅读约 3 分钟12 个 MCP 工具7 种语言

OpenAI API 接入 MCP:从任意 AI 代理使用 OpenAI 模型

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

HC作者:HelpCode 团队更新于 3 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

OpenAI API

OpenAI API

Let your AI use the OpenAI API with your own key: ask GPT models through the Responses API, analyse pictures from a link, generate and edit images that appear right in the chat, create embeddings, check content with moderation, and read models, files and batch jobs.

个工具

12

区域

INTL

类别

公共数据

身份验证

Bearer Token

所需环境变量

OPENAI_API_KEY
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

跳过安装。2 分钟内即可运行。

在 cloud.anythingmcp.com 开始免费试用,一键添加 OpenAI API,然后将你的 AI 客户端(Claude、ChatGPT、Copilot 或 Cursor)指向生成的 MCP 端点。无需 Docker,无需 git clone,无需任何工程经验。

开始免费试用

摘要

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

试试这样问

OpenAI API 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

OpenAI API · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → OpenAI API、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

OpenAI API

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

设置

  1. 登录 https://platform.openai.com,在 Settings、Billing 中充值。API 采用预付费:ChatGPT 订阅不包含 API 访问权限。
  2. 打开 https://platform.openai.com/api-keys,点击 Create new secret key,选择项目并复制密钥。密钥以 sk- 开头,只显示一次。
  3. 按 OpenAI 显示的原样(不加 Bearer 一词)将密钥粘贴到 OPENAI_API_KEY,然后安装连接器。密钥只会发送给 OpenAI。
  4. 可选:只有当密钥所属用户加入了多个组织时,才设置 OPENAI_ORGANIZATION(位于 Settings、Organization、General 的 Organization ID,以 org- 开头);只有需要把用量计入某个特定项目时,才设置 OPENAI_PROJECT(位于 Settings、Project、General 的 Project ID,以 proj_ 开头)。其他情况下两者都留空:与密钥不匹配的值会被拒绝并返回 401。
  5. 要使用图片工具,请在 Settings、Organization、General、Verify Organization 中验证你的组织。未验证时,GPT 图片模型会返回 403。
  6. 运行 openai_list_models。它不收费,会显示你的密钥可以使用哪些模型。

计费:每次模型调用都计入该密钥所属的 OpenAI 账户。审核以及模型、文件和批处理列表均免费。除非你要求更高规格,连接器会使用低价默认值:文本用 gpt-6-luna(每百万输入 token 约 0.10 美元,每百万输出 token 约 0.50 美元),图片用中等质量的 gpt-image-1-mini(每张约 0.01 美元)。更强的文本模型价格是其 20 到 100 倍,网页搜索按次计费。

功能:通过 Responses API 向 OpenAI 模型提问(文本、链接图片、网页搜索、结构化输出),生成和编辑显示在聊天中的图片,一次为最多 20 段文本创建嵌入向量,用审核功能检查文本和图片,并读取你的模型、文件以及在其他地方启动的 Batch API 任务。

先确认:每张图片都要花钱,因此 AI 在每次调用 openai_generate_image 或 openai_edit_image 之前都会先征得你的确认,并且除非你要更多,只生成一张。openai_delete_file 在安装时处于关闭状态;启用后它同样会先确认,且删除的文件无法恢复。

常见错误:401 表示密钥错误或已被撤销,或者组织 ID 或项目 ID 与密钥不匹配。403:组织未验证(图片模型),或者该组织无法使用此模型或区域。404 model_not_found:用 openai_list_models 检查。429 insufficient_quota:余额用完或已达到支出上限,请充值。429 rate_limit_exceeded:稍等后重试一次。400 moderation_blocked 或 content_policy_violation:OpenAI 的安全系统拒绝了该提示。

该连接器不涵盖 chat completions(Responses API 已覆盖相同功能)、音频(语音合成和转录)、realtime、视频、文件上传和下载、创建批处理、微调、vector stores、assistants 以及 admin API。

前提条件: OPENAI_API_KEY

本地安装连接器

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

打开 http://localhost:3000/connectors/store,选择 OpenAI API 并填入前提条件中列出的环境变量。

可用工具

ToolWhat it does
openai_list_modelsList the OpenAI models this API key can use (chat and reasoning, image, embedding, moderation, audio), with owner, creation time and…
openai_get_modelRead one OpenAI model: id, owner, creation time and shutdown date when one is announced
openai_create_responseAsk an OpenAI model and get its answer (Responses API). input is either a plain prompt string or a list of items, e.g. [{"role": "user"…
openai_generate_imageCreate pictures from a text description with an OpenAI GPT image model and return them as images the user can see
openai_edit_imageChange existing pictures with an OpenAI GPT image model, or combine several into a new one: describe the edit and pass the pictures by…
openai_create_embeddingsTurn one text, or a list of up to 20 texts, into embedding vectors for semantic search, clustering or similarity
openai_moderateCheck text, or text with images, against OpenAI's content policy categories (harassment, hate, self-harm, sexual, violence, illicit and…
openai_list_filesList the files stored in the OpenAI account (for batches, fine-tuning, assistants, vision or user data), newest first, with id, name, size…
openai_get_fileRead the details of one file in the OpenAI account: name, size in bytes, purpose, creation time and expiry
openai_delete_fileDelete a file from the OpenAI account
openai_list_batchesList the Batch API jobs of the account, newest first: endpoint, model, status (validating, in_progress, finalizing, completed, failed…
openai_get_batchRead one Batch API job: status, timestamps of each stage, request counts (total, completed, failed), token usage, errors and the…

示例提示

  • “看看这个链接里的商品照片,为我们的网店写一段简短、亲切的介绍。”
  • “为一条社交媒体帖子生成一张木桌上陶瓷咖啡杯的图片,但在生成之前先告诉我使用的模型和预估费用。”
  • “用审核功能检查这五条客户评论,告诉我哪些被标记了,以及原因。”
  • “我们的密钥可以使用哪些 OpenAI 模型?其中有没有已公布停用日期的?”

下一步

这份指南对你有帮助吗?

你的 OpenAI API 智能体只差一次点击。

安装连接器,粘贴密钥,向你的 AI 客户端提问。免费试用 7 天,无需信用卡。

相关指南

连接器

如何通过 MCP 将 OpenAI API 连接到 ChatGPT

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

连接器

如何通过 MCP 将 OpenAI API 连接到 Claude

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

连接器

如何通过 MCP 将 OpenAI API 连接到 Cursor

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

连接器

如何通过 MCP 将 OpenAI API 连接到 Gemini

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

连接器

如何通过 MCP 将 OpenAI API 连接到 Meta Muse

让你的 AI 用你自己的密钥使用 OpenAI API:通过 Responses API 向 GPT 模型提问,分析链接中的图片,生成和编辑直接显示在聊天中的图片,创建嵌入向量,用审核功能检查内容,并读取模型、文件和批处理任务。

连接器

Avito 接入 MCP:在任意 AI 智能体中管理 Avito 广告、价格和数据

让你的 AI 使用你的 Avito 企业账户:列出广告并修改价格,读取浏览、联系和来电统计,检查自动上传 (autoload) 的上传记录及其错误、Feed 格式和钱包,并读取 Avito Messenger 聊天。发送消息和修改自动上传设置为可选功能,默认关闭。