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

# OpenAI

> Configure OpenAI to power blog content creation and email generation in Notifuse.

![OpenAI](https://www.notifuse.com/docs/assets/integrations/openai.png)

The OpenAI integration enables AI-powered features across Notifuse using GPT models. This integration powers the [AI assistant](https://www.notifuse.com/docs/features/ai-assistant.md) for blog content creation, email design and web analytics.

## Configuration

Navigate to **Settings** → **Integrations**, click **Add integration**, then choose **OpenAI** under **AI assistant**.

### Form Fields

| Field                | Description                                                                                | Example                        |
| -------------------- | ------------------------------------------------------------------------------------------ | ------------------------------ |
| **API Key**          | Your OpenAI API key                                                                        | `sk-proj-...`                  |
| **Model**            | The model ID to use — free text, so any current or future model works                      | `gpt-4.1`                      |
| **Base URL**         | Optional. The API endpoint, for OpenAI-compatible providers. Leave empty for OpenAI itself | `https://openrouter.ai/api/v1` |
| **Reasoning effort** | Optional. How much reasoning models think: None, Minimal, Low, Medium, High or Extra high  | `Default`                      |

### Choosing a model

The Model field is free text rather than a fixed list, so you are never blocked from a model that shipped after your Notifuse version — type the ID exactly as your provider spells it.

| Model       | Good for                                                     |
| ----------- | ------------------------------------------------------------ |
| **GPT-4.1** | The default. Reliable for MJML templates and long-form posts |
| **GPT-5.4** | Complex reasoning and the most demanding generations         |
| **o4-mini** | Cheaper reasoning for shorter, simpler tasks                 |

See [OpenAI's pricing page](https://platform.openai.com/docs/pricing) for current rates.

> [!NOTE]
>
> Leave **Reasoning effort** on Default for non-reasoning models such as GPT-4.1. Providers that do not support the setting ignore it. If generations come back cut off, lowering the effort gives the visible answer more of the output budget.

> [!NOTE]
>
> The assistant panel shows a running cost for Anthropic and Gemini conversations, but not for OpenAI: with any model ID accepted — including every model on OpenRouter and any self-hosted runtime — Notifuse has no price list to compute it from. Track spend in your provider's dashboard.

## Features Enabled

Once configured, the OpenAI integration enables the following AI-powered features:

### Blog AI Agent

The AI agent can assist with blog content creation:

| Feature              | Description                                                                 |
| -------------------- | --------------------------------------------------------------------------- |
| **Write blog posts** | Generate complete blog articles based on topics or brief descriptions       |
| **SEO optimization** | Automatically generate SEO-friendly meta titles, descriptions, and keywords |
| **Content editing**  | Improve, expand, or summarize existing content                              |

### Email Editor AI

Generate emails automatically using AI:

| Feature                | Description                                             |
| ---------------------- | ------------------------------------------------------- |
| **Email generation**   | Create email content from prompts or descriptions       |
| **Subject lines**      | Generate compelling subject lines for better open rates |
| **Content variations** | Create multiple versions for A/B testing                |

### Web Analytics Assistant

Answer questions about your website traffic with the [Web Analytics assistant](https://www.notifuse.com/docs/web-analytics/ai-assistant.md):

| Feature                 | Description                                                     |
| ----------------------- | --------------------------------------------------------------- |
| **Ask about traffic**   | Query sessions, pages, sources and goals in plain language      |
| **Period summaries**    | A written analysis of what moved, against the comparison period |
| **Drive the dashboard** | Change the period, apply filters, or open an Explore report     |

## Enhanced with Firecrawl

The OpenAI AI agent can be enhanced by adding the [Firecrawl integration](https://www.notifuse.com/docs/integrations/firecrawl.md). This gives the AI agent web access capabilities:

| Capability               | Description                                           |
| ------------------------ | ----------------------------------------------------- |
| **Web research**         | Search the web for current information and trends     |
| **URL scraping**         | Extract content from specific web pages for reference |
| **Competitive analysis** | Research competitor content and strategies            |
| **Fact verification**    | Verify claims against current web sources             |

When Firecrawl is configured, the following tools become available to the AI agent:

| Tool         | Description                                       |
| ------------ | ------------------------------------------------- |
| `scrape_url` | Scrapes a URL and returns its content as markdown |
| `search_web` | Searches the web and returns relevant URLs        |

## Using OpenRouter

[OpenRouter](https://openrouter.ai) is a unified API gateway that gives you access to hundreds of AI models (Google Gemini, Meta Llama, Mistral, DeepSeek, and more) through a single OpenAI-compatible endpoint.

Since Notifuse's OpenAI integration uses the standard OpenAI SDK, you can point it to OpenRouter by setting the **Base URL** field:

### Form Fields for OpenRouter

| Field        | Description                       | Value                          |
| ------------ | --------------------------------- | ------------------------------ |
| **API Key**  | Your OpenRouter API key           | `sk-or-v1-...`                 |
| **Model**    | Any model available on OpenRouter | `google/gemini-3-pro-preview`  |
| **Base URL** | OpenRouter API base URL           | `https://openrouter.ai/api/v1` |

This allows you to use any model supported by OpenRouter — including Google Gemini, Meta Llama, Mistral, DeepSeek, Qwen, and many others — directly from Notifuse's AI features.

The same field covers any other OpenAI-compatible endpoint: Azure OpenAI, or a self-hosted runtime such as Ollama, vLLM or LiteLLM.

> [!TIP]
>
> Browse available models at [openrouter.ai/models](https://openrouter.ai/models) to find the best fit for your use case and budget.

> [!WARNING]
>
> The AI agent generates structured MJML email templates and full blog posts with HTML formatting. Only models with strong coding capabilities (e.g. GPT-4.1, Claude Sonnet, Gemini Pro) are smart enough to produce correct output. Smaller or weaker models may generate broken templates or malformed content.

## Prerequisites

Before configuring OpenAI:

1. **OpenAI Account**: Create an account at [platform.openai.com](https://platform.openai.com)
2. **API Key**: Generate an API key from the OpenAI dashboard
3. **Credits**: Ensure your account has sufficient API credits

## Usage Notes

> [!NOTE]
>
> API calls to GPT models count toward your OpenAI account usage. Monitor your usage in the OpenAI dashboard to manage costs.

> [!TIP]
>
> For most use cases, **GPT-4.1** offers a good balance of capability and cost. Step up to a reasoning model for complex creative work, and down to a mini or nano variant for simple, high-volume operations.
