> ## 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.

# Integración con ChatGPT

> Conectar el MCP de Manglai a ChatGPT

## ChatGPT + Manglai

Existen dos formas de integrar Manglai con ChatGPT:

### Opción 1: Custom GPT con Actions (API REST)

ChatGPT soporta **Custom GPTs** con acciones definidas en OpenAPI. Puedes crear un GPT que llame directamente a la API REST de Manglai.

1. Crea un **Custom GPT** en [chat.openai.com](https://chat.openai.com)
2. En **Configure → Actions**, importa el schema:
   * URL: `https://www.manglai.io/api/v1/docs`
3. Configura la autenticación **Bearer token** con tu token de Manglai
4. Define instrucciones para que el GPT sepa cuándo llamar a Manglai

### Opción 2: Cursor con modelos OpenAI

Si usas **Cursor** con modelos de OpenAI (GPT-4o, etc.), configura el MCP de Manglai en Cursor:

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

## Comandos de ejemplo en Custom GPT

* "¿Cuáles son las emisiones de mi empresa en 2024?"
* "Lista las facturas de electricidad del último mes"
* "¿Qué edificio genera más CO₂?"

<Card title="Generar token" icon="key" href="https://www.manglai.io/saas/settings/api-tokens/docs#models">
  Crea tu token de acceso
</Card>
