Skip to content
AI & MLClaude Desktop Guide

OpenAI API Claude Desktop Integration

This guide explains how to configure Claude Desktop (Mac and Windows) to use the OpenAI API API through the Model Context Protocol (MCP). The integration exposes 10 API endpointsas callable tools inside Claude's chat interface, including Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions). , Transcribes audio into the input language., Translates audio into into English., and more. No API keys or credentials are needed — setup takes approximately 30 seconds. The server runs locally via npx and communicates over STDIO transport. Paste the JSON configuration below into your claude_desktop_config.json file to get started.

Integration Specs

ClientClaude Desktop
Runtimenpx
AuthenticationNone
Setup Time~30 sec

Setup Instructions

1

Open Claude Settings

Launch Claude Desktop, open Settings (click your profile) → Developer → click 'Edit Config'.

2

Locate configuration file

This opens your local 'claude_desktop_config.json' file in your system editor.

3

Insert Server Config JSON

Paste the JSON configuration schema block (provided below) into the 'mcpServers' object.

4

Add authentication credentials

No credentials needed; leave the 'env' mapping empty.

5

Restart Claude app

Save the config file and restart Claude Desktop to load your new tools.

Configuration JSON

claude_desktop_config.json

Copy and paste this config snippet inside your local configuration file.

{
  "mcpServers": {
    "openai-com": {
      "command": "npx",
      "args": [
        "-y",
        "@mcp/openai-com"
      ],
      "env": {
        "OPENAI_API_API_KEY": "your_openai_api_api_key"
      }
    }
  }
}

Required Environment Keys

Provide these variable keys in your local environment section:

OPENAI_API_API_KEY

Replace your_openai_api_api_key with your secret key credentials.

Available Tools (10)

These endpoints are parsed from the OpenAPI schema and converted to Claude-compatible tools:

POST/answers
Answers the specified question using the provided documents and examples. The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions).
POST/audio/transcriptions
Transcribes audio into the input language.
POST/audio/translations
Translates audio into into English.
POST/chat/completions
Creates a completion for the chat message
POST/classifications
Classifies the specified `query` using provided examples. The endpoint first [searches](/docs/api-reference/searches) over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the [completions](/docs/api-reference/completions) endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
POST/completions
Creates a completion for the provided prompt and parameters
POST/edits
Creates a new edit for the provided input, instruction, and parameters.
POST/embeddings
Creates an embedding vector representing the input text.
GET/engines
Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
GET/engines/{engine_id}
Retrieves a model instance, providing basic information about it such as the owner and availability.