Developer API

Getting started

Create a token and receive your first event in a few minutes.

The Gleem Developer API lets your own tools react to what happens on your Gleem page and in the Twitch extension. Alerts, text-to-speech, OBS scene changes and chat replies can all fire on Gem messages, Treat redemptions, memberships and more.

Everything your tool needs comes from one personal access token. The tool connects to a WebSocket and receives each event a moment after it happens. It needs no public address, so it works from a streaming PC behind a home router.

1. Create a token

In your dashboard, open Developer and create a token. Give it a name you will recognise later, such as "Streamer.bot on my streaming PC". Tick only the scopes the tool needs; to receive events, that is events:read.

The token is shown once. Copy it straight into your tool. It looks like this:

gleem_pat_k3j9x0q2m1ab_Zx8…

Treat it like a password. Anyone who has it can read your events. If it leaks, revoke it on the same page; it stops working on the very next request.

2. Check the token

curl https://gleem.gg/api/v1/me \
  -H "Authorization: Bearer gleem_pat_…"

The answer names your creator account, the token's scopes, and where your event stream is:

{
    "creator": {
        "id": 12,
        "slug": "ghostzero",
        "display_name": "GhostZero",
        "twitch_id": "123456",
        "is_live": false,
        "url": "https://gleem.gg/ghostzero"
    },
    "token": {
        "name": "Streamer.bot",
        "scopes": ["events:read"],
        "expires_at": null
    },
    "websocket": {
        "url": "wss://gleem.gg/ws/app/<key>?protocol=7&client=gleem-api&version=1.0",
        "channel": "private-creator.12.events",
        "auth_url": "https://gleem.gg/api/v1/socket/auth"
    }
}

3. Connect and listen

Open the WebSocket at websocket.url, have the channel authorised at auth_url, and subscribe. Real-time events walks through the handful of messages involved, with code.

4. Send yourself a test event

You do not have to wait for a real tip. On the Developer page in your dashboard, pick an event type and press Send test event. Your tool receives it like any other, with "test": true in the envelope. The page also shows a live log of the last 50 events, test or not, so you can compare what Gleem sent with what your tool did.

Before you read messages aloud

Gem messages and Treat inputs are written by viewers. If your tool reads them out with text-to-speech, set up the message filter on the Developer page first: blocked words and, optionally, links are masked or left out before any tool sees them. Filtered text is marked with message_filtered or input_filtered.

Using the API means accepting the Developer Terms.

What next