---
title: "Connect via OpenAI API"
description: "Use the UptimeMonitoring MCP server in your OpenAI Responses API requests."
doc_version: "1"
last_updated: "2026-06-02"
---

## Prerequisites

- An OpenAI API account with Responses API access
- An `umk_live_` API key from [app.uptimemonitoring.com](https://app.uptimemonitoring.com) — see [Authentication](/docs/authentication/)

## Connect

Use the `mcp` tool type in a Responses API request. This example restricts `allowed_tools` to the read-only `list_monitors` for safe verification — remove the restriction to enable write tools in production:

```bash
curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "tools": [
      {
        "type": "mcp",
        "server_label": "uptimemonitoring",
        "server_url": "https://api.uptimemonitoring.com/mcp",
        "headers": {
          "Authorization": "Bearer umk_live_..."
        },
        "allowed_tools": ["list_monitors"]
      }
    ],
    "input": "List my UptimeMonitoring monitors."
  }'
```

Replace `umk_live_...` with your UptimeMonitoring API key. Keep the two keys separate: `OPENAI_API_KEY` (`sk-...`) is your OpenAI credential; `umk_live_...` is your UptimeMonitoring credential.

### Auth modes

| Use case | Method |
|----------|--------|
| Backend-to-backend / server agent | Pass `Authorization: Bearer umk_live_...` in the `headers` field (shown above) |
| User-facing agent with OAuth | Pass the user's OAuth access token via the `authorization` field of the MCP tool config instead of `headers.Authorization` |

To enable write tools (`create_monitor`, `update_monitor`, `delete_monitor`) in production, remove `allowed_tools` and handle the `mcp_approval_request` events in the response stream, or set `require_approval: "never"` only after confirming user intent in your application layer.

## Verify

Run the curl call above. The response should include a tool call to `list_monitors` and a follow-up assistant message summarising your monitors.

## Common errors

| Symptom | Cause | Fix |
|---------|-------|-----|
| `401` from UptimeMonitoring | Wrong key in `headers.Authorization` | Confirm the key starts with `umk_live_` — do not use your OpenAI key here |
| MCP tool ignored by model | Older model version without `mcp` tool support | Switch to `gpt-4o` or a later model |
| Server not found | URL typo | The endpoint is `https://api.uptimemonitoring.com/mcp`, not `mcp.uptimemonitoring.com` |

## See also

- [MCP reference and host compatibility matrix](/docs/mcp/)
- [Connect Claude Code](/docs/connect-claude-code/)
- [Connect ChatGPT](/docs/connect-chatgpt/)
- [Connect Cursor](/docs/connect-cursor/)
- [Connect via REST API](/docs/connect-rest-api/)