# Connect LFG Alarm to the OpenAI API

AI agents · https://lfg.gm/agents/openai-api · Updated 2026-10-18

To connect LFG Alarm to an agent you build on the OpenAI API, make a personal key in LFG Alarm under Settings > Connected AI apps, then add LFG Alarm as a remote MCP server at https://mcp.lfg.gm and send the key with it: the authorization field of the Responses API MCP tool, a headers object in the Agents SDK, or the transport in the Agents API. Your agent can then set real alarms on your phone, for a time or for a moment it is watching. LFG Alarm is a social alarm clock for iPhone and Android: alarms for times and moments, shared by link so every phone that joined rings together.

## Before you start

- **Get the LFG Alarm app on your phone** from Google Play or the App Store, and sign in. Your agent makes the alarms; the app is what rings them.
- **A personal key**, since a program has no one there to sign in. Make one below.
- **Using ChatGPT itself?** You do not need a key. ChatGPT signs in with your LFG Alarm account; see [Connect LFG Alarm to ChatGPT](https://lfg.gm/agents/chatgpt).

A key acts as you. Every alarm your agent makes with it lands in your account and rings your phone, whoever is talking to the agent. That fits your own assistant, a script, or a small team's internal agent where you are the one to wake. It does not fit an app open to the public: every user would be setting alarms on your phone.

## Make a key

1. In LFG Alarm, open **Settings** > **Connected AI apps**, on [lfg.gm](https://lfg.gm) or in the app.
2. Tap **Make a key**, name it after the agent (for example "Deploy watcher"), and tap **Make the key**.
3. The key is shown once, with **Copy** and **Done**: "Copy it now. It won't be shown again." Put it in an environment variable, here `LFG_KEY`, then tap **Done**.
4. It now shows in the list as **Personal key**, with when it was last used.

The screen says it plainly: "For an AI app that asks for a key instead of a sign-in, like Manus, a coding agent or your own script. A key acts as you, so keep it out of any agent other people use."

Keys start with `lfg_pat_`, work only at the LFG Alarm MCP server, and you can have up to 20. A key has the same plan limits as signing in.

## Connect it

The server speaks Streamable HTTP at `https://mcp.lfg.gm`, with no `/mcp` on the end. The key goes in the `Authorization` header as `Bearer lfg_pat_...`. Each OpenAI surface has its own field for it.

### Responses API

The remote MCP tool takes the key in `authorization`. OpenAI does not store it, so send it with every request.

```python
import os
from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-5",
    tools=[{
        "type": "mcp",
        "server_label": "lfg_alarm",
        "server_url": "https://mcp.lfg.gm",
        "authorization": os.environ["LFG_KEY"],
        "allowed_tools": ["set_time_alarm", "list_my_alarms"],
        "require_approval": "never",
    }],
    input="Use LFG Alarm to set a one-off alarm for 6:30 tomorrow called Gym.",
)
print(response.output_text)
```

`allowed_tools` keeps the tool list short, which saves tokens on every call. With `require_approval` left on, the response stops with an approval request for you to answer before the tool runs; that is the safer choice for anything that adds people or deletes alarms.

### Agents SDK

Connect with the Streamable HTTP server class and pass the header yourself:

```python
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async def main():
    async with MCPServerStreamableHttp(
        name="LFG Alarm",
        params={
            "url": "https://mcp.lfg.gm",
            "headers": {"Authorization": f"Bearer {os.environ['LFG_KEY']}"},
        },
    ) as lfg:
        agent = Agent(
            name="Assistant",
            instructions="When the user wants waking or reminding, set an LFG Alarm.",
            mcp_servers=[lfg],
        )
        result = await Runner.run(agent, "Wake me at 7:00 every weekday, call it Get up.")
        print(result.final_output)

asyncio.run(main())
```

The SDK also has a hosted MCP tool that hands the connection to the Responses API; it takes the same `authorization` field as above.

### Agents API (beta)

OpenAI's Agents API, in public beta since 10 September 2026, runs long agents on OpenAI's side and connects to MCP servers. Add LFG Alarm to the agent's tools like this:

```json
{
  "type": "mcp",
  "server_label": "lfg_alarm",
  "transport": {
    "type": "http",
    "server_url": "https://mcp.lfg.gm",
    "authorization": "Bearer lfg_pat_..."
  },
  "connection_origin": "service"
}
```

In a real setup, keep the key out of your code: the Agents API can read it from a stored credential instead. Where that object goes, and how stored credentials work, is in OpenAI's MCP connections guide below. It is a beta, so field names may still change.

### Agent Builder

Not covered here. OpenAI is shutting Agent Builder down on 30 November 2026 and points people to the Agents SDK instead.

## What fits

- **A watcher that wakes you.** A long-running agent that checks a deploy, a queue or a data job, and when it goes wrong sets a one-off alarm two minutes from now on your phone. Time alarms are real alarms on both iPhone and Android and ring through silent mode.
- **Your own assistant.** A small chat or voice front end of your own, where "wake me at 6 on Saturday and add Priya and Tom" becomes a friends alarm with the right people, after you confirm who.
- **A planning agent.** It reads a schedule or a Luma or Partiful link and sets the alarms, so the plan ends with something that rings.

For a fixed "ring me when this finishes" with no model involved, skip the agent: make an [anything alarm](https://lfg.gm/wiki/anything-alarms) and POST to its private link from your code. See [How to make any app, script or feed ring your phone](https://lfg.gm/webhook-alarm).

## Try it

Once it is connected, send your agent:

**Try this.** Paste it into ChatGPT, Claude, Grok or another AI agent that has the LFG Alarm connector (https://mcp.lfg.gm), not into the LFG Alarm app. The person needs the LFG Alarm app on their phone.

> Use LFG Alarm to set a one-off alarm for 6:30 tomorrow called "Gym", with GYM on the wallpaper. Then tell me when it goes off.

Why it works: A one-off time alarm and the time read back, so one request proves the key, the server and the tool call all work.

More ideas: "Make a friends alarm for Saturday at 9am called Golf and add my friends [username] and [username]", "Set a price alarm for when SOL moves 10%", or "List my alarms". Through a key, LFG Alarm can set time, price, post, event and anything alarms, pick a sound or a look from the library, and add your friends or a whole group once you confirm. Each alarm comes back with its link, a share picture with a QR code and a message ready to send. Wallet and trader alarms are made in the app. See [Using LFG Alarm from your AI agent](https://lfg.gm/wiki/ai-agents).

## If it does not work

- **401 or "unauthorized".** In the Responses API pass the key in `authorization`; in the SDK and Agents API the value is `Bearer ` then the key. Check you copied the whole key; if not sure, make a new one.
- **No tools listed.** Check the URL is `https://mcp.lfg.gm` exactly, with no `/mcp`.
- **The model never calls the tool.** Say "use LFG Alarm" in the request, or tell the agent when to use it in its instructions.
- **It refuses an alarm.** A key has the same plan limits as signing in. For plans and pricing, go to lfg.gm.
- **Still stuck?** Write to us from the [support page](https://lfg.gm/support).

## Disconnect

In LFG Alarm, open **Settings** > **Connected AI apps** and tap **Disconnect** beside the key. It stops working at once. Your alarms stay in your account and keep ringing.

## Questions

### Can every user of my app have their own alarms?
Not with one key. A key is one LFG Alarm account. Each person would need their own account and their own key, which suits a tool for you and a few people you trust, not a public app.

### Should I use the Responses API or the Agents SDK?
The Responses API if you want OpenAI to make the MCP calls for you; the Agents SDK if you want the connection in your own process, with your own logging and retries. Both take the same key.

### What about Agent Builder workflows I already have?
Agent Builder shuts down on 30 November 2026. Move the workflow to the Agents SDK and connect LFG Alarm as shown above.

### Does LFG Alarm see my prompts?
No. LFG Alarm only receives what your agent sends when it calls LFG Alarm's tools.

## Learn more

- [Using LFG Alarm from your AI agent](https://lfg.gm/wiki/ai-agents)
- [Time alarms](https://lfg.gm/wiki/time-alarms), [Price alarms](https://lfg.gm/wiki/price-alarms) and [Anything alarms](https://lfg.gm/wiki/anything-alarms)
- [Connect LFG Alarm to ChatGPT](https://lfg.gm/agents/chatgpt)
- [Connect LFG Alarm to Claude Code and Copilot in CI](https://lfg.gm/agents/claude-code-ci)
- [Connect LFG Alarm to another AI app](https://lfg.gm/agents)

## Sources and further reading

- [OpenAI docs: connectors and MCP servers](https://developers.openai.com/api/docs/guides/tools-connectors-mcp)
- [OpenAI cookbook: guide to the MCP tool](https://developers.openai.com/cookbook/examples/mcp/mcp_tool_guide)
- [OpenAI docs: Agents API MCP connections](https://developers.openai.com/api/docs/guides/agents-api/tools/mcp)
- [OpenAI: Introducing the Agents API](https://openai.com/index/introducing-the-agents-api/)
- [OpenAI Agents SDK (Python): MCP](https://openai.github.io/openai-agents-python/mcp/) and [the JavaScript version](https://openai.github.io/openai-agents-js/guides/mcp/)
- [OpenAI docs: deprecations](https://developers.openai.com/api/docs/deprecations)

LFG Alarm is not affiliated with OpenAI.

## Keep exploring

- [Connect LFG Alarm to your AI app](https://lfg.gm/agents.md): The LFG Alarm MCP server: set alarms from ChatGPT, Claude, Grok, Gemini, OpenClaw and more, and they ring on your phone.
- [Connect LFG Alarm to ChatGPT](https://lfg.gm/agents/chatgpt.md): Add LFG Alarm to ChatGPT with the address mcp.lfg.gm, sign in once, and ask ChatGPT to set alarms that ring on your phone.
- [Connect LFG Alarm to Claude](https://lfg.gm/agents/claude.md): Add LFG Alarm to Claude as a custom connector, sign in once, and ask Claude to set alarms that ring on your phone. Claude Code too.
- [Connect LFG Alarm to Grok](https://lfg.gm/agents/grok.md): Add LFG Alarm to Grok as a custom connector, sign in once, and ask Grok to set alarms that ring on your phone.
- [Connect LFG Alarm to Gemini](https://lfg.gm/agents/gemini.md): Add LFG Alarm to Gemini as a custom app, sign in once, and ask Gemini to set alarms that ring on your phone.
- [Connect LFG Alarm to Perplexity](https://lfg.gm/agents/perplexity.md): Add LFG Alarm to Perplexity as a custom remote connector, sign in once, and ask Perplexity to set alarms.

## About LFG Alarm

LFG Alarm is a social alarm clock for iPhone, iPad and Android. It rings for times and for moments (a post on X, a stream going live, a token price, a wallet buying, an event starting), and one shared link makes every phone that joined ring together. Rocco, the cat inside the app, does the watching and the waking.

- Get it on Google Play: https://play.google.com/store/apps/details?id=gm.lfg.app
- Download on the App Store: https://apps.apple.com/app/id6821089085
- Use it from an AI agent: add the MCP server https://mcp.lfg.gm as a connector, then ask in plain words.
- Every page for agents: https://lfg.gm/llms.txt
