OpenAI MCP server for AI agents

Generate text, embeddings and images, and moderate content with the OpenAI API.

Auth
Access token
Tools
6
Triggers
0
Category
AI

Tools and triggers

  • Generate a response

    OPENAI_CREATE_RESPONSE

    Runs a model on a prompt and returns its answer text in `output_text`, plus the full response object. Costs tokens.

  • Create a chat completion

    OPENAI_CREATE_CHAT_COMPLETION

    Sends a list of chat messages to a model and returns its reply in choices[0].message.content. Costs tokens.

  • List models

    OPENAI_LIST_MODELS

    Lists the models the API key can use, with their ids.read-only

  • Create embeddings

    OPENAI_CREATE_EMBEDDING

    Turns text into embedding vectors for search and similarity. Input is one string or an array of strings.

  • Generate an image

    OPENAI_CREATE_IMAGE

    Generates an image from a text prompt. The result is base64-encoded image data in data[0].b64_json, which is large.

  • Check text for policy violations

    OPENAI_CREATE_MODERATION

    Classifies text for harassment, hate, self-harm, sexual content, violence and similar categories. Free to use.read-only

Connect via MCP

Create an MCP server for OpenAI in the dashboard, then add its URL to your client. This is the Claude Code command; the client guide has the others.

terminal
claude mcp add --transport http openai \
  "https://www.prompt-tm.com/mcp/<server id>?user_id=<your user>" \
  --header "x-api-key: ptm_…"

Connect via REST

Run a tool with one request. The response is { data, error, successful, log_id } for every tool.

terminal
curl -X POST https://www.prompt-tm.com/api/v3/tools/execute/OPENAI_CREATE_RESPONSE \
  -H "x-api-key: $PROMPT_TM_KEY" -H "content-type: application/json" \
  -d '{ "user_id": "alice", "arguments": {} }'

OpenAI questions