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

# ChatGPT Integration

> Connect the Manglai MCP to ChatGPT

## ChatGPT + Manglai

There are two ways to integrate Manglai with ChatGPT:

### Option 1: Custom GPT with Actions (REST API)

ChatGPT supports **Custom GPTs** with OpenAPI-defined actions. You can create a GPT that calls the Manglai REST API directly.

1. Create a **Custom GPT** at [chat.openai.com](https://chat.openai.com)
2. In **Configure → Actions**, import the schema:
   * URL: `https://www.manglai.io/api/v1/docs`
3. Set up **Bearer token** authentication with your Manglai token
4. Define instructions so the GPT knows when to call Manglai

### Option 2: Cursor with OpenAI models

If you use **Cursor** with OpenAI models (GPT-4o, etc.), configure the Manglai MCP in Cursor:

```json theme={null}
{
  "mcpServers": {
    "manglai": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.manglai.io/sse",
        "--header",
        "Authorization:Bearer ${MANGLAI_TOKEN}"
      ],
      "env": {
        "MANGLAI_TOKEN": "your_token_here"
      }
    }
  }
}
```

## Example Custom GPT Prompts

* "What are my company's emissions in 2024?"
* "List electricity invoices from last month"
* "Which building generates the most CO₂?"

<Card title="Generate token" icon="key" href="https://www.manglai.io/saas/settings/api-tokens/docs#models">
  Create your access token
</Card>
