Skip to main content

n8n Integration

n8n is a workflow automation platform that lets you connect AI models with hundreds of apps and services. The AnyAPI community node gives you direct access to 300+ AI models inside n8n — no code required.

Overview

The AnyAPI node for n8n supports:

Chat Completions

Send messages to GPT-4o, Claude, Gemini, Llama, and more

Web Search

Ground model responses with real-time web search

Image Generation

Create images with DALL-E, Stable Diffusion, and others

Embeddings

Generate text embeddings for semantic search and RAG

Advanced Capabilities

  • Function Calling — Let models call external tools and APIs
  • Reasoning — Extended thinking for complex tasks (o1, Claude with thinking)
  • Prompt Caching — Reduce latency and cost on repeated prompts
  • Streaming — Stream responses for real-time output
  • Assistant Prefill — Guide model output by prefilling the response
  • URL Context — Fetch and include web page content as context

Installation

  1. Open any workflow in n8n
  2. Click + to open the nodes panel
  3. Search for AnyAPI
  4. Click Install on the community node
For self-hosted n8n, you can also install via Settings > Community Nodes and enter n8n-nodes-anyapi.ai.

Setup

Create Credentials

  1. Add an AnyAPI node to your workflow
  2. Click Credential to connect with > Create New Credential
  3. Enter your API key from the AnyAPI Dashboard
  4. Base URL defaults to https://api.anyapi.ai/v1
  5. Click Test to verify the connection

Quick Start

Chat Completion

The simplest workflow — send a message and get a response:
  1. Add a Manual Trigger node
  2. Add an AnyAPI node and connect it
  3. Set Resource to Chat, Operation to Complete
  4. Choose a model (e.g. openai/gpt-4o)
  5. Add a message with Role User and your prompt
  6. Click Test workflow

Example: Scheduled Summary

Generate a daily summary of your data on a schedule:
[Schedule Trigger] → [HTTP Request: fetch data] → [AnyAPI: summarize] → [Slack: post message]

Example: Webhook AI Endpoint

Expose an AI-powered API endpoint:
[Webhook] → [AnyAPI: process request] → [Respond to Webhook]

Resources

Chat Completions

ParameterDescription
ModelModel ID (e.g. openai/gpt-4o, anthropic/claude-sonnet-4-20250514, google/gemini-2.0-flash)
MessagesList of messages with role (System, User, Assistant) and content
Simplified OutputReturn only the message content instead of the full API response

Chat Options

Sampling temperature from 0 to 2. Lower values make output more focused and deterministic, higher values make it more creative.
Maximum number of tokens to generate in the response.
Provide a URL to fetch and include as context. Useful for summarizing web pages or using web content as reference.
Pass a JSON array of tool definitions. The model can decide to call these tools based on the conversation.
[
  {
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "Get current weather for a location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": { "type": "string" }
        },
        "required": ["location"]
      }
    }
  }
]
Control how the model uses tools: Auto (model decides), None (no tool use), Required (must use a tool).
Allow the model to call multiple functions in a single turn. Enabled by default.
Enable extended thinking for complex tasks. Supported by models like openai/o1, anthropic/claude-sonnet-4-20250514 with thinking. Set Reasoning Budget to control max tokens for thinking steps.
Cache repeated prompts to reduce latency and cost. Especially useful for system prompts and few-shot examples that don’t change between requests.
Stream the response. n8n will collect the full streamed response and return it as a single output.
Start the assistant’s response with specific text. The model will continue from where you left off. Supported by Anthropic models.
Force the model to output valid JSON. Useful when you need structured data for downstream nodes.
Custom trace ID for tracking requests in the AnyAPI Dashboard. Useful for debugging workflows.

Embeddings

ParameterDescription
ModelEmbedding model ID (e.g. openai/text-embedding-3-small)
Input TextText to generate embeddings for

Image Generation

ParameterDescription
ModelImage model ID (e.g. google/gemini-2.5-flash-image)
PromptText description of the image
SizeImage dimensions (256x256 to 1792x1024)
QualityStandard or HD
Number of ImagesHow many images to generate (1-10)

Model Listing

Returns all available models on AnyAPI. Useful for dynamic model selection in workflows.

Workflow Examples

AI Content Pipeline

Automate content creation with multiple AI steps:
[Schedule Trigger]
    → [HTTP Request: fetch topics from CMS]
    → [AnyAPI: generate outline (Claude)]
    → [AnyAPI: write draft (GPT-4o)]
    → [AnyAPI: review and edit (Claude)]
    → [Google Sheets: save results]
    → [Slack: notify team]
Answer questions using both your data and the web:
[Webhook: receive question]
    → [Pinecone: search knowledge base]
    → [AnyAPI: answer with context + web search enabled]
    → [Respond to Webhook]

Image Generation Bot

Generate images on demand via Slack:
[Slack Trigger: new message in #ai-images]
    → [AnyAPI: generate image from message text]
    → [Slack: upload image to channel]

Multi-Model Comparison

Compare responses from different models:
[Manual Trigger]
    → [Split In Batches]
        → [AnyAPI: GPT-4o]
        → [AnyAPI: Claude Sonnet]
        → [AnyAPI: Gemini Flash]
    → [Merge]
    → [Google Sheets: save comparison]

Troubleshooting

Credential Test Fails

  • Verify your API key is correct at dash.anyapi.ai
  • Check the Base URL is https://api.anyapi.ai/v1
  • Ensure your account has available credits

Model Not Found

  • Use the full model ID with provider prefix: openai/gpt-4o, not just gpt-4o
  • Use the Model > List operation to see all available models

Unsupported Feature Error

Not all models support all features. If you get an error like “unsupported tool type”, try a different model. For example, web search works with OpenAI and Anthropic models but may not work with all providers.

Next Steps

Hermes Agent

Autonomous coding agent with 21 messaging adapters

OpenClaw

AI coding agent with multi-model fallbacks

Web Search

Learn more about web search grounding

Tool Calling

Deep dive into function calling