Connect OpenAI to Claude Code
Call models, embeddings, files, and vector stores. Add Toolspoke to Claude Code once and it can use 10 OpenAI actions. Your OpenAI credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install OpenAI and connect it
Add OpenAI to a project in your Toolspoke workspace.
API key. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- API key
- platform.openai.com → API keys
Choose what Claude Code may do
All 10 actions start on. Switch off any of the 2 actions that change something in OpenAI, and Claude Code gets a refusal if it tries.
What you can ask Claude Code for
A few of the OpenAI actions that only read, so they are safe to try first.
- List the models this API key can call
- Create embedding vectors for one or more strings, for similarity search or clustering
- Classify text (and image URLs) against OpenAI's safety categories before you publish or forward it
- List files uploaded to this OpenAI account, newest first
What Claude Code can do in OpenAI
8 actions read and 2 write.
Reads
List models
List the models this API key can call. Use before `responses` or `embeddings` when you are unsure a model id exists for this account. Optionally filter by substring; returns at most `limit` entries.
Embeddings
Create embedding vectors for one or more strings, for similarity search or clustering. Defaults to 256 dimensions to keep the response readable, raise `dimensions` when you are storing the vectors.
Moderate
Classify text (and image URLs) against OpenAI's safety categories before you publish or forward it. Returns per-input `flagged`, category booleans, and confidence scores.
List files
List files uploaded to this OpenAI account, newest first. Use it to find the file id for retrieve_file or to check what a vector store was built from.
Retrieve file
Fetch one file's metadata: name, bytes, purpose, and status. Call download_file to read its contents.
Download file
Download a file's contents as text, truncated to 10000 characters. Only useful for text formats such as .txt, .md, .json, or .jsonl, call retrieve_file first for its name, size, and purpose.
List vector stores
List the vector stores on this account with their file counts and sizes. Use it to find the vector_store_id that search_vector_store needs.
Search vector store
Semantic search over the files in one vector store. Returns the matching chunks with their scores and source filenames, use this to ground an answer in the account's own documents.
Writes
Responses
Generate a model response with the Responses API. Use for text generation, structured JSON output, reasoning, and built-in tools like web_search. Returns the full response object plus a flattened output_text field. Streaming is not supported here.
Generate image
Generate images from a text prompt. The default dall-e-3 returns a temporary URL, which is cheap to pass around; gpt-image-* models return base64 bytes, which are omitted unless you set return_base64.
OpenAI in Claude Code: questions
Does Claude Code see my OpenAI credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Can I stop Claude Code from changing things in OpenAI?
Yes. Each of the 10 actions can be switched off for a project. Turn off the 2 that change something and Claude Code can only read.
Will 10 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the OpenAI action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a OpenAI call does not run in a sandbox, so it bills nothing.
OpenAI in your other apps
More ai toolkits for Claude Code
Try OpenAI in Claude Code
Free to start, and tool calls cost nothing on any plan.