> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eventgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatGPT Actions

> Build a Custom GPT that queries live EventGraph prediction market data

## Overview

ChatGPT doesn't use MCP — it uses **GPT Actions**, which are powered by OpenAPI specs. The good news: EventGraph already has a complete OpenAPI spec, so you can create a Custom GPT in minutes with no code.

***

## Setup

### 1. Go to ChatGPT → Explore GPTs → Create

1. Open [chat.openai.com](https://chat.openai.com)
2. Click **Explore GPTs** in the left sidebar
3. Click **Create** (top right)

### 2. Configure the GPT

In the **Configure** tab:

**Name:** `EventGraph — Prediction Market Intelligence`

**Description:**

```text theme={null}
I have access to live prediction market data from Polymarket, Kalshi, Limitless, 
and OpinionTrade via the EventGraph API. Ask me about active markets, prices, 
volumes, arbitrage opportunities, and more.
```

**Instructions:**

```text theme={null}
You are a prediction market analyst with real-time access to EventGraph data.

When the user asks about prediction markets, events, or probabilities:
1. Use the search_markets or search_events action to find relevant markets
2. Use get_market for detailed data on a specific market
3. Use find_arbitrage to identify pricing discrepancies across platforms (Pro)
4. Always cite the platform, current price, and volume when discussing a market
5. Express prices as probabilities (e.g. "67% chance of Yes" not "0.67")

Be concise, data-driven, and helpful.
```

### 3. Add the EventGraph Action

In the **Configure** tab, scroll to **Actions** and click **Create new action**.

**Authentication:** Select **API Key**, header name: `X-API-Key`, value: `eg_live_your_key_here`

**OpenAPI schema:** Paste this:

```yaml theme={null}
openapi: 3.1.0
info:
  title: EventGraph API
  description: Live prediction market data from Polymarket, Kalshi, Limitless, and OpinionTrade
  version: 1.0.0
servers:
  - url: https://app.eventgraph.ai
paths:
  /api/v1/markets:
    get:
      operationId: search_markets
      summary: Search prediction markets
      parameters:
        - name: query
          in: query
          schema:
            type: string
          description: Keyword search query
        - name: platform
          in: query
          schema:
            type: string
            enum: [polymarket, kalshi, limitless, opiniontrade]
        - name: status
          in: query
          schema:
            type: string
            enum: [active, resolved, all]
            default: active
        - name: page_size
          in: query
          schema:
            type: integer
            default: 20
      responses:
        "200":
          description: List of markets
  /api/v1/markets/{market_id}:
    get:
      operationId: get_market
      summary: Get market details
      parameters:
        - name: market_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Market details
  /api/v1/events:
    get:
      operationId: search_events
      summary: Search events
      parameters:
        - name: query
          in: query
          schema:
            type: string
        - name: category
          in: query
          schema:
            type: string
        - name: page_size
          in: query
          schema:
            type: integer
            default: 20
      responses:
        "200":
          description: List of events
  /api/v1/arbitrage:
    get:
      operationId: find_arbitrage
      summary: Find cross-platform arbitrage opportunities (Pro)
      parameters:
        - name: min_spread
          in: query
          schema:
            type: number
        - name: page_size
          in: query
          schema:
            type: integer
            default: 20
      responses:
        "200":
          description: Arbitrage opportunities
  /api/v1/status:
    get:
      operationId: get_status
      summary: API health and data freshness
      responses:
        "200":
          description: Status
```

### 4. Save and test

Click **Save**, then test in the preview panel:

> *"What are the most traded prediction markets this week?"*

***

## What it looks like

Once live, your Custom GPT can answer questions like:

| Question                                                      | What it does                                                             |
| ------------------------------------------------------------- | ------------------------------------------------------------------------ |
| *"What's the current probability of a Fed rate cut in June?"* | Calls `search_markets` with query, returns live Polymarket/Kalshi prices |
| *"Are there any arbitrage opportunities right now?"*          | Calls `find_arbitrage`, lists spreads (Pro)                              |
| *"Compare all platforms on the 2026 election market"*         | Calls `search_events` then `get_market` for each result                  |

***

## Share your GPT

Once tested, you can publish your Custom GPT publicly so others can use it — no API key management needed on their end (your key is embedded in the Action config, not visible to users).

<Warning>
  If you publish publicly, your EventGraph API key is used for all queries. Monitor your usage at `GET /api/v1/usage` to avoid exceeding limits. Consider upgrading to Pro for higher rate limits before going public.
</Warning>

***

## OpenAI Assistant API (for developers)

If you're building programmatically, you can define EventGraph as a function tool in the Assistants API:

```python theme={null}
tools = [
    {
        "type": "function",
        "function": {
            "name": "search_markets",
            "description": "Search prediction markets across Polymarket, Kalshi, Limitless, and OpinionTrade",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {"type": "string", "description": "Keyword search"},
                    "platform": {"type": "string", "enum": ["polymarket", "kalshi", "limitless", "opiniontrade"]},
                    "page_size": {"type": "integer", "default": 20}
                }
            }
        }
    }
]
```

Then handle the tool call by proxying to `https://app.eventgraph.ai/api/v1/markets` with your `X-API-Key` header.
