Connect via OpenAI API
Prerequisites
Section titled “Prerequisites”- An OpenAI API account with Responses API access
- An
mk_live_API key from my.monitive.com — see API keys
Connect
Section titled “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:
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": "monitive", "server_url": "https://api.monitive.com/mcp", "headers": { "Authorization": "Bearer mk_live_..." }, "allowed_tools": ["list_monitors"] } ], "input": "List my Monitive monitors." }'Replace mk_live_... with your Monitive API key. Keep the two keys separate: OPENAI_API_KEY (sk-...) is your OpenAI credential; mk_live_... is your Monitive credential.
Auth modes
Section titled “Auth modes”| Use case | Method |
|---|---|
| Backend-to-backend / server agent | Pass Authorization: Bearer mk_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
Section titled “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
Section titled “Common errors”| Symptom | Cause | Fix |
|---|---|---|
401 from Monitive |
Wrong key in headers.Authorization |
Confirm the key starts with mk_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.monitive.com/mcp, not api.monitive.com |
See also
Section titled “See also”Your first monitor takes 30 seconds.
Sign in with GitHub, Google, Microsoft, or email, and your first check runs right away. 50 monitors, free, no card.