# Connect OpenAI API to Tesselith

> Give your own OpenAI-powered agent Tesselith's tools with the Responses API's hosted MCP tool.

Canonical: https://tesselith.com/ai-agents/openai-api

**Before you start:** You need an OpenAI API key, a Tesselith API key and a Tesselith workspace on Pro, Team or Agency (every new workspace starts with a 14-day Pro trial) with at least one channel connected. OpenAI calls Tesselith's MCP server for you, so there's nothing extra to host.

## Quick setup

```python
import os
from openai import OpenAI

client = OpenAI()
resp = client.responses.create(
    model="gpt-5",  # any model that supports remote MCP
    input="List my Tesselith channels",
    tools=[{
        "type": "mcp",
        "server_label": "tesselith",
        "server_url": "https://api.tesselith.com/mcp",
        "authorization": os.environ["TESSELITH_API_KEY"],
        "require_approval": "always",
    }],
)
print(resp.output_text)
```

authorization is sent as the bearer token on every request; OpenAI doesn't store it.

## Step by step

### 1. Create a Tesselith API key

In Tesselith, open Settings → Developers, create an API key and tick only the scopes the agent needs. Keys start with tsl_live_ and are shown once, so store it in your password manager or a secret store. Give an agent the smallest set of scopes that does the job, for example read posts and create drafts.

### 2. Add the mcp tool to your request

Pass the server URL and your key as authorization. Use allowed_tools to expose only the tools your agent needs, which also keeps token use down.

```python
{
    "type": "mcp",
    "server_label": "tesselith",
    "server_url": "https://api.tesselith.com/mcp",
    "authorization": os.environ["TESSELITH_API_KEY"],
    "allowed_tools": ["list_channels", "create_draft", "add_to_queue"],
    "require_approval": {"never": {"tool_names": ["list_channels"]}},
}
```

### 3. Handle approvals

Approval is required by default. When the response contains an mcp_approval_request, show it to a person and reply with an mcp_approval_response. Skip approval only for read-only tools.

### 4. Test with a read-only call

Ask for your channels first. A list of your accounts means the key, scopes and URL are right.

## Troubleshooting

- **424 or "tool list failed":** OpenAI couldn't reach Tesselith or got a 401. Check the key is sent as authorization on every request.
- **The model calls tools you didn't want:** Set allowed_tools to the tools the agent needs.
- **Responses stall waiting for approval:** Answer the mcp_approval_request items, or use require_approval never for read-only tools.

## Questions people ask

### Can I use OAuth instead of an API key?

The hosted MCP tool takes a bearer token as authorization. A Tesselith API key with limited scopes is the simplest choice for your own agent.

### Does this work with the OpenAI Agents SDK?

Yes. The Agents SDK's hosted MCP tool takes the same configuration as the Responses API mcp tool.

### How much does it cost to call Tesselith tools?

Tesselith doesn't charge per tool call. Your OpenAI usage is billed by OpenAI, and posts count toward your Tesselith plan like any other.

Docs: https://developers.openai.com/api/docs/guides/tools-connectors-mcp

---
Tesselith · https://tesselith.com · Full site index: https://tesselith.com/llms.txt
