> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up OpenAI in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/openai
Last updated: 2026-11-24

Share OpenAI with your team in Claude, ChatGPT and Cursor through Metorial: API key sign-in, 34 tools (22 read-only).

---

To give your team OpenAI in Claude, ChatGPT, Cursor and other AI clients, an admin shares the OpenAI integration in a Metorial portal, and each person connects with an API key. Agents can generate text, images, audio, and video using large language models and multimodal AI. The integration has 34 tools, 22 read-only, 6 write and 6 destructive, plus 1 trigger.

**What you will learn**

- How an admin shares OpenAI in a portal and how each person connects
- What OpenAI asks for when you connect, and where to find it
- How to keep the 22 read-only tools and reject the other 12

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An API key from OpenAI for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in method

| Method | Type | What a person provides |
| --- | --- | --- |
| **API Key** | API token | `token` |

### API Key

To connect, a person enters:

- `token`: Your OpenAI API key (starts with sk-)

### Setup settings

Setup also asks for:

- `organizationId` (optional): OpenAI Organization ID. Required if you belong to multiple organizations.
- `projectId` (optional): OpenAI Project ID. Used to route usage to a specific project.

## Admin: share OpenAI in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose OpenAI. For how members connect, choose **Each person connects** so everyone enters their own API key, or **Shared connection** to enter one API key for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from OpenAI.

4. **Choose who gets it**

   Add the access groups that should see OpenAI. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user OpenAI integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search openai
```

## Employee: connect OpenAI

### In the portal

1. **Open OpenAI in the catalog**

   Sign in to your portal and open OpenAI. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your API key (token).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search openai
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. 

### Add it to your AI client

`metorial install` adds your OpenAI connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list openai
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 22 read-only tools, such as `get_file` and `get_batch`, and lose the 6 write tools, such as `upload_file` or `create_batch`, and the 6 destructive tools, such as `delete_file` or `cancel_batch`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list openai
metorial tools <integration-id>
metorial call <integration-id> list_files -d '{}'
```

`metorial tools` lists the 34 tools, minus any you rejected. `list_files` takes no input. It lists files uploaded to OpenAI, optionally filtered by purpose (e.g. "fine-tune", "assistants").

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (22)

- `list_files`: List files uploaded to OpenAI, optionally filtered by purpose (e.g. "fine-tune", "assistants").
- `list_models`: List all available OpenAI models, or retrieve details about a specific model.
- `create_embeddings`: Generate vector embeddings for text input using OpenAI embedding models (text-embedding-3-small, text-embedding-3-large). Needs `input`.
- `generate_text`: Generate text using OpenAI chat completion models (GPT-5, GPT-4o, etc.). Needs `model` and `messages`.
- `create_response`: Generate a response using the OpenAI Responses API, the primary gateway for all model families. Needs `model` and `input`.
- `moderate_content`: Classify text against OpenAI's content policy categories. Needs `input`.
- `get_file`: Retrieve metadata for a specific file by its ID. Needs `fileId`.
- `get_fine_tuning_job`: Retrieve the status and details of a fine-tuning job, or list all fine-tuning jobs.
- `search_vector_store`: Search a vector store using natural language queries. Needs `vectorStoreId` and `query`.
- `list_vector_stores`: List all vector stores in your OpenAI project.
- `get_batch`: Retrieve the status and details of a batch processing job, or list all batches.
- `generate_image`: Generate images from text prompts using OpenAI's image generation models (e.g. Needs `prompt`.
- `list_response_input_items`: List the input items used to create a stored OpenAI response. Needs `responseId`.
- `translate_audio`: Translate speech from an uploaded audio file into English text. Needs `filename`.
- `get_vector_store_file_content`: Retrieve parsed content chunks for a file attached to a vector store. Needs `vectorStoreId` and `fileId`.
- `get_vector_store_file`: Retrieve status and metadata for one file attached to a vector store. Needs `vectorStoreId` and `fileId`.
- `get_file_content`: Retrieve the raw content of an uploaded OpenAI file, such as JSONL batch output, fine-tuning data, or uploaded text. Needs `fileId`.
- `list_vector_store_files`: List files attached to a vector store, optionally filtered by processing status. Needs `vectorStoreId`.
- `get_response`: Retrieve a stored OpenAI response by ID, including status, model output items, and token usage. Needs `responseId`.
- `get_vector_store`: Retrieve details for a specific OpenAI vector store, including processing status and file counts. Needs `vectorStoreId`.
- `synthesize_speech`: Generate spoken audio from text using OpenAI text-to-speech models. Needs `input`.
- `transcribe_audio`: Transcribe speech from an uploaded audio file into the source language text. Needs `filename`.

### Write tools (6)

- `create_batch`: Submit a batch of API requests for asynchronous processing at reduced cost. Needs `inputFileId` and `endpoint`.
- `create_vector_store`: Create a managed vector store for uploading, chunking, and searching files.
- `create_fine_tuning_job`: Create a new fine-tuning job to customize an OpenAI model on your training data. Needs `model` and `trainingFileId`.
- `add_vector_store_file`: Attach an uploaded OpenAI file to a vector store so it can be indexed for file search. Needs `vectorStoreId` and `fileId`.
- `upload_file`: Upload a file to OpenAI for use with batch processing, fine-tuning, vector stores, vision, or user data workflows. Needs `filename` and `purpose`.
- `update_vector_store`: Update a vector store name, expiration policy, or metadata. Needs `vectorStoreId`.

### Destructive tools (6)

- `delete_vector_store`: Delete a vector store by its ID. Needs `vectorStoreId`.
- `cancel_batch`: Cancel a batch processing job that is in progress. Needs `batchId`.
- `delete_file`: Delete a file from your OpenAI account by its ID. Needs `fileId`.
- `cancel_fine_tuning_job`: Cancel a running fine-tuning job. Needs `jobId`.
- `delete_response`: Delete a stored OpenAI response by ID. Needs `responseId`.
- `remove_vector_store_file`: Detach a file from a vector store. Needs `vectorStoreId` and `fileId`.

## Triggers

OpenAI has 1 trigger, which fire on events in OpenAI:

- `openai_events`: Receive webhook notifications for OpenAI events including background responses, batch jobs, fine-tuning jobs, evaluation runs, and realtime calls.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use OpenAI there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [OpenAI on metorial.com](https://metorial.com/integrations/openai): the integration overview