Connector guide5-minute read12 MCP tools7 languages

OpenAI API to MCP: Use OpenAI Models from any AI Agent

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.

HCBy HelpCode teamUpdated 5 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

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.

tools

12

Region

INTL

Category

Public Data

Authentication

Bearer Token

Required env vars

OPENAI_API_KEY
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the OpenAI API in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

Summary

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.

Try asking

Example prompts for OpenAI API

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

OpenAI API · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → OpenAI API, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

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.

Setup

  1. Sign in at https://platform.openai.com and add credit under Settings, Billing. The API is prepaid: a ChatGPT subscription does not include API access.
  2. Open https://platform.openai.com/api-keys, click Create new secret key, pick the project and copy the key. It starts with sk- and is shown only once.
  3. Paste the key into OPENAI_API_KEY as OpenAI shows it (without the word Bearer) and install the connector. The key is sent only to OpenAI.
  4. Optional: set OPENAI_ORGANIZATION (the Organization ID under Settings, Organization, General, starting with org-) only when the key's user belongs to several organizations, and OPENAI_PROJECT (the Project ID under Settings, Project, General, starting with proj_) only to count usage on a specific project. Leave both empty otherwise: a value that does not match the key is refused with 401.
  5. For the image tools, verify your organization under Settings, Organization, General, Verify Organization. Without it, the GPT image models answer 403.
  6. Run openai_list_models. It costs nothing and shows which models your key can use.

Billing: every model call is billed to the OpenAI account of your key. Moderation and the model, file and batch lists are free. The connector uses cheap defaults unless you ask for more: gpt-6-luna for text (about $0.10 per million input tokens and $0.50 per million output tokens) and gpt-image-1-mini at medium quality for pictures (about $0.01 each). Stronger text models cost 20 to 100 times as much, and web search is billed per search.

What it does: it asks OpenAI models through the Responses API (text, pictures by link, web search, structured output), generates and edits images that appear in the chat, creates embeddings for up to 20 texts at a time, checks text and pictures with moderation, and reads your models, files and Batch API jobs started elsewhere.

Confirm first: every picture costs money, so the AI confirms with you before each openai_generate_image or openai_edit_image call and makes one picture unless you ask for more. openai_delete_file is switched off at install; once enabled, it also confirms first, and a deleted file cannot be restored.

Common errors: 401 means the key is wrong or revoked, or the organization or project ID does not match it. 403: the organization is not verified (image models), or the model or region is not available to it. 404 model_not_found: check openai_list_models. 429 insufficient_quota: no credit left or the spending limit is reached, so add credit. 429 rate_limit_exceeded: wait and retry once. 400 moderation_blocked or content_policy_violation: OpenAI's safety system refused the prompt.

The connector does not cover chat completions (the Responses API covers the same ground), audio (speech and transcription), realtime, video, file upload and download, creating batches, fine-tuning, vector stores, assistants or the admin API.

Prerequisites: OPENAI_API_KEY

Install the connector locally

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

Open http://localhost:3000/connectors/store, pick OpenAI API and paste in the env vars listed under Prerequisites.

Available tools

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…

Example prompts

  • "Look at the product photo at this link and write a short, friendly description for our online shop."
  • "Generate one image of a ceramic coffee mug on a wooden table for a social post, but show me the model and estimated cost before you create it."
  • "Check these five customer comments with moderation and tell me which ones are flagged and for what."
  • "Which OpenAI models can our key use, and do any of them have an announced shutdown date?"

Next steps

Was this guide helpful?

Your OpenAI API agent is one click away.

Install the connector, paste the key, prompt your AI client. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect OpenAI API to ChatGPT via MCP

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.

Connectors

How to Connect OpenAI API to Claude via MCP

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.

Connectors

How to Connect OpenAI API to Cursor via MCP

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.

Connectors

How to Connect OpenAI API to Gemini via MCP

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.

Connectors

How to Connect OpenAI API to Meta Muse via MCP

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.

Connectors

Avito to MCP: Manage Avito Ads, Prices and Statistics from any AI Agent

Let your AI work with your Avito business account: list your ads and change their prices, read views, contacts and calls statistics, check autoload uploads and their errors, the feed format and your wallet, and read Avito Messenger chats. Sending messages and changing autoload settings are optional and off by default.