Platform
Chatbot Builder Bulk Messaging Team Inbox Mini CRM API & Webhooks AI Integration WhatsApp Flows
Industries
E-commerce & D2C Real Estate Education Healthcare Finance & BFSI Logistics Hospitality Retail
Integrations 📚 Learn 📝 Blog 🗂 Codex Pricing Start Free Trial →
Connect  ›  Connect OpenRouter to WhatsApp
AI connection guide

Connect OpenRouter to WhatsApp: one key, 200+ models

OpenRouter gives your WhatsApp chatbot access to every major AI model through one endpoint and one API key. Swap models by changing one word in the request body, with no re-configuration and no new keys.

 Published 21 June 2026  7 min read  Live-researched  Bring your own key

The other guides in this series each cover a single provider with its own key and its own auth pattern. OpenRouter flips that: one key, one endpoint, one billing account, and you choose the model inside the request body. That makes it the most flexible starting point if you are not sure which AI provider suits your use case, or if you want to run the same WhatsApp flow with different models to compare results.

OpenRouter is also the easiest path to models that do not have their own direct API set up in the External API Request step, like Meta's Llama models, Mistral's less-common variants, or Perplexity's Sonar. As long as OpenRouter carries the model, you can reach it from WA.Expert.

New to the External API Request step? Read the foundation guide first.

Step 1: Get your OpenRouter API key

1

Sign in to OpenRouter

Go to openrouter.ai and create or log into your account.
2

Create an API key

Under Settings, open Keys and create a new key. It starts with sk-or-. Label it clearly, for example wa-expert-chatbot.
3

Add credits

Under Credits, add billing. Each model request is charged at (approximately) the provider's per-token rate plus a small OpenRouter fee on some models. Credits never expire.
4

Browse models and pick one

Go to openrouter.ai/models to see every available model with its price per million tokens. Note the ID in the format provider/model-name; you will put this in the request body.

 Start with a small, fast model

For a WhatsApp chatbot that needs quick replies, start with a fast and inexpensive model like openai/gpt-4o-mini or mistralai/mistral-small. Once you are happy with the flow, you can upgrade to a larger model by changing one word in the body.

Step 2: Fill in the External API Request step

The endpoint is the same regardless of which model you use. Only the model field in the body changes.

External API Request
Method
POST
Request URL
https://openrouter.ai/api/v1/chat/completions
Auth Type
Bearer token
Header Parameters
Authorization
Bearer YOUR_OPENROUTER_KEY
Content-Type
application/json
Body Type
JSON (raw)
Response Type
Default Response
SaveRun and Save

Request URL

Request URL
https://openrouter.ai/api/v1/chat/completions

Headers

HeaderValue
AuthorizationBearer YOUR_SK_OR_KEY
Content-Typeapplication/json

Same Bearer auth pattern as OpenAI and Mistral.

Body

The model field uses the provider/model-name format. Swap this one value to change providers.

JSON body: three model options shown
{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful support assistant. Answer briefly."
    },
    {
      "role": "user",
      "content": "{{customer_message}}"
    }
  ]
}

/* To switch to Claude, change the model line to: */
/* "model": "anthropic/claude-sonnet-4-6" */

/* To switch to Gemini: */
/* "model": "google/gemini-3.5-flash" */
To usemodel value in body
OpenAI GPT-4o miniopenai/gpt-4o-mini
OpenAI GPT-4oopenai/gpt-4o
Anthropic Claude Sonnetanthropic/claude-sonnet-4-6
Google Gemini Flashgoogle/gemini-3.5-flash
Mistral Smallmistralai/mistral-small-latest
Perplexity Sonarperplexity/sonar
Meta Llama 3meta-llama/llama-3.3-70b-instruct

Model IDs change as providers release new versions. Check openrouter.ai/models for the current ID before building.

Step 3: Map the reply

OpenRouter always returns the same structure regardless of the underlying model. The response path is identical to OpenAI.

Response
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "...the model's reply is here..."
      }
    }
  ]
}

Map choices[0].message.content into your WhatsApp message. This path works regardless of whether the underlying model is GPT, Claude, or Gemini. OpenRouter normalises the response format.

 Why the same response path for every model matters

If you build your WA.Expert flow to read from choices[0].message.content, you can switch the AI provider by changing only the model name in the request body. Your flow's mapping step never needs to change. That is the practical value of OpenRouter's standardisation.

Troubleshooting

SymptomLikely causeFix
401 UnauthorizedWrong key or missing Bearer prefixCheck the key starts with sk-or- and the header value begins with Bearer
402 Payment RequiredNo creditsAdd credits at openrouter.ai
404 or model not foundModel ID wrong or model no longer offeredCheck openrouter.ai/models for the correct current ID
Slow responseSome models have higher latency through OpenRouterTry a faster model or go direct to that provider for production
Different response structureRare with some modelsVerify against OpenRouter's docs for the specific model; most follow the standard format

Common questions

Where do I get an OpenRouter API key?
+
Sign in or create an account at openrouter.ai. Under Settings, open Keys and create a new key. It starts with sk-or-. Add credits to your account before making requests; requests are charged per token at the provider's rate plus a small OpenRouter fee on some models.
What models can I use through OpenRouter?
+
OpenRouter gives access to over 200 models from OpenAI, Anthropic, Google, Mistral, Meta, and many others, all through one endpoint and one key. You specify the model using a provider/model-name format in the body, for example openai/gpt-4o, anthropic/claude-sonnet-4-6, or google/gemini-3.5-flash.
Why use OpenRouter instead of going directly to each provider?
+
One key, one endpoint, one billing account. If you want to test several models or switch providers without changing your flow's configuration, OpenRouter is the fastest way to do it. You also get automatic fallback to another provider if one is down, and a unified usage dashboard.
Is OpenRouter more expensive than direct provider access?
+
On most models it is the same price or very slightly higher, since OpenRouter adds a small routing fee on some models. On others, it passes through at the exact provider rate. Check the pricing page at openrouter.ai for the model you plan to use.
Can I use OpenRouter for Claude or Gemini too?
+
Yes. Instead of using separate keys for Anthropic and Google, you can access both through your OpenRouter key using anthropic/claude-sonnet-4-6 or google/gemini-3.5-flash as the model value. The request format stays the same regardless of provider.
Does this cost anything on WA.Expert?
+
WA.Expert does not mark up OpenRouter's charges. The WhatsApp reply is free inside the 24-hour service window.
Related

Keep building

Connect OpenAI directly

Direct access if you only need GPT models.

Read guide →

Connect Claude directly

Direct Anthropic access with x-api-key auth.

Read guide →

Connect Gemini directly

Direct Google access with x-goog-api-key.

Read guide →

Connect hub

All connection guides.

Browse all →

The External API Request step

Foundation guide.

Read guide →

WhatsApp API glossary

API, endpoint, token, bearer defined.

Open glossary →

One key. Every model. Your WhatsApp chatbot.

Free trial, no credit card required. And if you ever get stuck, we are the only platform in India that answers you live on WhatsApp.

Start Free →Book Demo
1