[Integrations](https://spiral.ai/integrations) › [n8n](https://spiral.ai/integrations/n8n) › [OpenAI](https://spiral.ai/integrations/n8n/openai)

# How to Use OpenAI in n8n

To use OpenAI in n8n, connect Spiral to n8n once, then ask for what you want in plain words. n8n can then reach all 51 OpenAI tools on Spiral, priced per run from one balance.

|  |  |
| --- | --- |
| Tools | 51 |
| Categories | LLM, Image, Audio |
| Served by | OpenAI |
| Pricing | Pay per run, no subscription |
| Setup | About 2 minutes, with a Spiral API key |

## Prompts to try with OpenAI in n8n

- Every Monday at 9am: generate a product photo with OpenAI: a matte black water bottle on wet slate, soft morning light, 1:1. Tell me the price first.
- Make four logo concepts for a coffee brand called "Northline" with OpenAI.
- Create a 16:9 hero image of a quiet mountain cabin at dusk with OpenAI.
- Generate a 9:16 poster with OpenAI for a jazz night called "Blue Hour", deep navy and brass tones.
- Generate a flat illustration of a team planning session with OpenAI for our blog header, 16:9.

## How to set up OpenAI in n8n

Pick the way that suits you. Each takes about two minutes.

### Use the Spiral skill

1. **Send n8n this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use Spiral's MCP server

1. **Create a key**: Create a key under API keys in the console.

2. **Add an MCP Client node**: In a workflow, add an MCP Client node (or, under an AI Agent node, an MCP Client Tool) and set:

```text
https://api.spiral.ai/mcp
```

3. **Pick a tool**: The node lists Spiral's tools. In an MCP Client node pick one, such as `run`, and give it its arguments:

```json
{
  "provider": "fal",
  "model": "fal-ai/flux/schnell",
  "input": { "prompt": "a lighthouse at dawn" },
  "wait": true
}
```

4. **Run OpenAI in a workflow step**: Give the step an instruction like the ones below and run it on your trigger or schedule. Spiral finds OpenAI, prices it and runs it each time the step fires.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run OpenAI**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openai",
    "model": "gpt-image-2",
    "input": {
      "prompt": "A cute baby sea otter"
    }
  }'
```

Then paste one of the prompts above: n8n finds OpenAI on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/n8n

## OpenAI tools and prices

- [GPT Image 2 · Text to Image](https://spiral.ai/tools/openai/gpt-image-2) (OpenAI): $0.274 per 1024×1024 image at high quality ($0.00775 low, $0.0686 medium). At high: $0.214 at 1536×1024 or 1024×1536, $0.198 at 1792×1024 or 1024×1792, $0.203 at 512×512, $0.186 at 256×256. Auto quality or size: the price of the one chosen for the request. Prompt: $6.50 per 1M tokens.
- [GPT-5.2](https://spiral.ai/tools/openai/openai/gpt-5.2) (OpenAI): Up to $0.074628 per run at the default inputs. $2.275 per 1M input tokens, $0.2275 per 1M cached input tokens, $18.20 per 1M output tokens.
- [GPT-5 Mini](https://spiral.ai/tools/openai/openai/gpt-5-mini) (OpenAI): Up to $0.010662 per run at the default inputs. $0.325 per 1M input tokens, $0.0325 per 1M cached input tokens, $2.60 per 1M output tokens.

## What can you do with OpenAI in n8n?

n8n can generate images with OpenAI while you're away, on a schedule or when something happens, and message you the result.

### Product and ad images

Shots, banners and social posts at the exact size each channel needs.

### Concepts and moodboards

Several directions in one prompt, priced before they run.

### Slides and newsletters

Pictures for a deck, a newsletter or a message, returned right in the chat.

### Blog and social headers

A header image for every post, in your brand's style.

### UI placeholders

Realistic images for mockups and prototypes.

### Localized creatives

The same ad in several languages and sizes.

## Overview

- [OpenAI](https://spiral.ai/providers/openai)
- [All n8n guides](https://spiral.ai/integrations/n8n)

## OpenAI in other agents

- [Amp](https://spiral.ai/integrations/amp/openai)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/openai)
- [Claude](https://spiral.ai/integrations/claude-desktop/openai)
- [Claude Code](https://spiral.ai/integrations/claude-code/openai)
- [Cline](https://spiral.ai/integrations/cline/openai)
- [Codex](https://spiral.ai/integrations/codex/openai)
- [Cursor](https://spiral.ai/integrations/cursor/openai)
- [Devin](https://spiral.ai/integrations/devin/openai)
- [dots](https://spiral.ai/integrations/dots/openai)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/openai)
- [Gemini](https://spiral.ai/integrations/gemini/openai)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/openai)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/openai)
- [goose](https://spiral.ai/integrations/goose/openai)
- [Grok](https://spiral.ai/integrations/grok/openai)
- [Grok Build](https://spiral.ai/integrations/grok-build/openai)
- [Hermes](https://spiral.ai/integrations/hermes/openai)
- [Instinct](https://spiral.ai/integrations/instinct/openai)
- [Manus](https://spiral.ai/integrations/manus/openai)
- [Muse](https://spiral.ai/integrations/muse/openai)
- [Muse Code](https://spiral.ai/integrations/muse-code/openai)
- [Notion](https://spiral.ai/integrations/notion/openai)
- [OpenClaw](https://spiral.ai/integrations/openclaw/openai)
- [opencode](https://spiral.ai/integrations/opencode/openai)
- [Perplexity](https://spiral.ai/integrations/perplexity/openai)
- [Raycast](https://spiral.ai/integrations/raycast/openai)
- [VS Code](https://spiral.ai/integrations/vscode/openai)
- [Windsurf](https://spiral.ai/integrations/windsurf/openai)
- [Zapier](https://spiral.ai/integrations/zapier/openai)

## More n8n guides

- [Mistral](https://spiral.ai/integrations/n8n/mistral)
- [Vizard](https://spiral.ai/integrations/n8n/vizard)
- [Hedra](https://spiral.ai/integrations/n8n/hedra)
- [xAI](https://spiral.ai/integrations/n8n/xai)
- [Google Vertex AI](https://spiral.ai/integrations/n8n/vertex)
- [ACE-Step Audio Inpaint](https://spiral.ai/integrations/n8n/ace-step-audio-inpaint)

## Questions about OpenAI in n8n

**Can n8n use OpenAI?**

Yes. Add Spiral to n8n as an MCP server, and n8n can find and run OpenAI like any built-in tool.

**How much does OpenAI cost in n8n?**

Each tool has its own price, for example GPT Image 2 Text to Image: $0.274 per 1024×1024 image at high quality ($0.00775 low, $0.0686 medium). At high: $0.214 at 1536×1024 or 1024×1536, $0.198 at 1792×1024 or 1024×1792, $0.203 at 512×512, $0.186 at 256×256. Auto quality or size: the price of the one chosen for the request. Prompt: $6.50 per 1M tokens; GPT-5.2: Up to $0.074628 per run at the default inputs. $2.275 per 1M input tokens, $0.2275 per 1M cached input tokens, $18.20 per 1M output tokens; GPT-5 Mini: Up to $0.010662 per run at the default inputs. $0.325 per 1M input tokens, $0.0325 per 1M cached input tokens, $2.60 per 1M output tokens. You pay per run from one Spiral balance, and failed runs are free.

**Do I need an OpenAI account to use OpenAI in n8n?**

You need no OpenAI account. n8n uses one Spiral API key for every tool, and Spiral runs OpenAI on its own OpenAI account.

**How long does it take to set up OpenAI in n8n?**

About two minutes: create a key, then add an MCP Client node, then pick a tool.

**Does n8n wait while OpenAI runs?**

OpenAI runs in the background. n8n starts the run, checks on it and gives you the image when it's ready.

**Which OpenAI tools can n8n use?**

n8n can reach all 51 OpenAI tools on Spiral, covering LLM, image, and audio. Popular ones include GPT Image 2 · Text to Image, GPT-5.2, and GPT-5 Mini. Ask for one by name, or describe the task and n8n picks a fitting tool.

**Can n8n compare OpenAI tools?**

Yes. Ask n8n to run the same request on two OpenAI tools and show both results with what each cost. Each run is priced and billed on its own.

**What happens if a OpenAI run fails in n8n?**

It is not charged. Spiral holds the estimated price when the run starts and returns it to your balance if the run fails on Spiral's side or the provider's. n8n gets the error and can retry or try another tool.

**Is there a OpenAI subscription or plan?**

No. Spiral is pay as you go from one prepaid balance, with no plans or minimums, and credits never expire. Auto top-up keeps n8n from stopping when the balance runs low.

