AnimationFunnel

OpenRouter integration

Send form answers to any LLM — Claude, GPT, Llama, Gemini, Mistral — through a single OpenRouter key. Score leads, classify intent, summarize long responses, or enrich submissions with AI-generated fields.

Overview

OpenRouter is a unified gateway to 100+ LLMs with one API key and one billing account. The AnimationFunnel integration lets you call any model on every submission and store the result on the same record — without writing a server.

  • Pick any OpenRouter-supported model per form
  • Use submission answers as prompt variables via recall tokens
  • Write the model's response back to a hidden field, tag, or webhook
  • Built-in JSON mode for structured output (score, label, reason)
  • Automatic retries, cost caps, and timeout handling

Setup

  1. Sign in at openrouter.ai and create an API key from Keys → Create.
  2. In AnimationFunnel, open your form and go to Integrations → OpenRouter → Connect.
  3. Paste the key. Workspace-level keys can be shared across all forms; form-level keys stay scoped to one form.
  4. Pick a default model — e.g. anthropic/claude-opus-4-7, openai/gpt-4o, or meta-llama/llama-3.1-70b.
  5. Write your prompt template (see below) and hit Save.
OpenRouter bills you directly based on the model's per-token price. AnimationFunnel adds no markup — the integration only routes the request.

Common use cases

AI lead scoring

Send the full submission to a model and ask it to return a 0–100 quality score with reasoning. Write the score back as a hidden field so it flows into Pipedrive or your CRM. See the dedicated Lead scoring guide for the full setup including rules, AI, and hybrid modes.

Intent classification

Classify free-text "What brings you here?" answers into a fixed set of buckets (pricing, demo, support, job inquiry) so you can route to the right team.

Long-answer summarization

Collapse a 500-word "Tell us about your project" paragraph into a two-sentence summary for the sales rep's dashboard.

Personalized ending screens

Generate a tailored thank-you message or next-step recommendation and show it on the ending screen using a recall token.

Writing prompts

Prompts use the same {{field:<key>}} recall syntax as the rest of the builder. Every answer is available by its field key.

text
System:
You are a B2B lead-qualification analyst. Return strict JSON.

User:
Company: {{field:company}}
Role: {{field:role}}
Team size: {{field:team_size}}
Budget: {{field:budget}}
Goal: {{field:goal}}

Return JSON:
{
  "score": number (0-100),
  "tier": "enterprise" | "midmarket" | "smb" | "unqualified",
  "reason": string
}

Enable JSON mode in the integration settings to force valid JSON output. AnimationFunnel parses the response and exposes each key as a separate writeable target.

Writing results back

Map each key from the model's JSON response to a destination:

  • Hidden field — store on the submission record, visible in the dashboard and exports.
  • Tag — apply a tag to the submission for filtering.
  • Webhook payload — include in the signed webhook to your backend.
  • Recall token — reference on an ending screen or in a downstream email integration.

Cost & rate limits

Set a per-submission cost cap (e.g. $0.02) to protect against runaway bills — requests above the cap are rejected before hitting OpenRouter. A monthly cap pauses the integration and alerts workspace admins when reached.

AnimationFunnel parallelizes at most 10 requests per second per workspace to OpenRouter; the rest are queued and processed within seconds.

Troubleshooting

Model returned invalid JSON

Turn on JSON modein integration settings and ensure your prompt explicitly asks for JSON. Models that don't support native JSON mode fall back to best-effort parsing; prefer anthropic/claude-opus-4-7, openai/gpt-4o, or any model tagged "JSON" on OpenRouter.

Model timeouts

The default per-request timeout is 30 seconds. For long generations raise it under Advanced → Timeout, or switch to a faster model tier.

Was this page helpful?