
Deploy Evolution API OpenAI
WhatsApp AI assistant using Evolution API's OpenAI bot
evolution-api
Just deployed
/evolution/instances
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
Deploy and Host self hosted Evolution API OpenAI (Open-Source WhatsApp AI Assistant API) on Railway
Railway template for Evolution API v2.3.7 with Postgres and Redis: self-host the WhatsApp API and answer chats with OpenAI. The integration ships disabled, so set OPENAI_ENABLED=true. For developers running their own support bots.
About Hosting Evolution API OpenAI open-source software on Railway (self hosted Evolution API OpenAI bot template)
Your data stays in your project: the pinned v2.3.7 image, its Postgres instance, the Redis cache and the WhatsApp session files on the /evolution/instances volume. The API key is generated in your environment, not a vendor dashboard.
Railway wires DATABASE_CONNECTION_URI and CACHE_REDIS_URI, sets SERVER_URL and turns telemetry off, so /manager works right after deploy. You add OPENAI_ENABLED=true yourself; the template leaves the OpenAI bot off.
Why Deploy Evolution API OpenAI, the WhatsApp Business Platform alternative on Railway (Railway Free Trial)
The official platform bills per conversation and gates sends behind approved templates. Here you own the number, keys and trigger rules, and Evolution API is free software. Railway's 5 USD trial covers the first deploy.
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Evolution API OpenAI on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for Evolution API OpenAI self hosting
Railway ships the API, Postgres and Redis as one project; elsewhere you assemble the stack.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | Postgres and Redis wired by variables, TLS domain, one place to set OPENAI_ENABLED=true. | A Droplet you patch, Docker install, separate managed database, own TLS proxy. |
| AWS | Provisioned services and a volume for session files, billed by usage. | ECS or EC2 plus RDS, IAM and security groups to run. |
| Hetzner | No server admin, deploy from Git, /manager over HTTPS. | Cheap compute, but you own backups and QR rescans after a lost volume. |
Common Use Cases for hosted Evolution API OpenAI
- FAQ bot for a small business number: a chatCompletion bot with systemMessages for hours, prices and return policy answers the same number staff use, even at 2am.
- Voice note transcription: set speechToText in /openai/settings/INSTANCE and audio messages get a text reply instead of silence.
- Keyword-triggered bots: triggerType keyword with operator contains and triggerValue "support" so family chats stay untouched.
- Human takeover: listeningFromMe and stopBotFromMe let staff reply from the phone and pause the bot, then /openai/changeStatus reopens it.
- Assistants API with files: botType assistant with assistantId and a functionUrl reads your PDF menu and calls your endpoint.
Dependencies for Evolution API OpenAI Docker hosted on Railway
The OpenAI bot is off as deployed: evolution-api ships without OPENAI_ENABLED, so /openai routes return 404 until you add that variable and redeploy. Bring an OpenAI key with credit.
Deployment Dependencies for Managed Evolution API OpenAI Service (WhatsApp Chatbot)
Port 8080, public, health check on /, session files on the volume at /evolution/instances. Postgres saves instances, messages, contacts and chats with DATABASE_SAVE_* true; Redis caches. Register the OpenAI key per instance on /openai/creds.
Implementation Details for Evolution API OpenAI (Using Evolution API official docker image)
The integration is inside v2.3.7, nothing to install. Sessions persist on the volume, so redeploys skip the QR scan.
How does Evolution API OpenAI compare against other ways to put an AI assistant on WhatsApp
Evolution API vs WhatsApp Business Platform (Meta Cloud API Alternative)
- Setup: add OPENAI_ENABLED=true, POST the key and a bot, and it answers. Meta needs verification and templates first.
- Where Meta wins: it is official. Baileys is unofficial and can get numbers banned; the Cloud API is the sanctioned path.
- Cost shape: Evolution API is free software; you pay hosting and OpenAI tokens. Meta bills per message on its own terms.
Evolution API vs Twilio (Twilio WhatsApp API Alternative)
- What Twilio gives you: an official WhatsApp reseller with support and SDKs, and no QR codes.
- What you trade: a per-message fee on top of Meta's, and no built-in OpenAI endpoints; you wire the model yourself.
- Where Evolution API wins: trigger rules, debounce and speechToText are config fields, and data stays in your own Postgres.
Evolution API vs WAHA (WAHA WhatsApp HTTP API Alternative)
- Overlap: both are self-hosted WhatsApp HTTP APIs you run in Docker and call over REST.
- Where Evolution API wins: the OpenAI bot layer ships in the product; no separate queue or prompt service.
- Where WAHA wins: smaller surface. If you only send and receive text, its core edition is simpler.
Evolution API vs Chatwoot (Chatwoot Alternative)
- Different layers: Chatwoot is a support inbox with agents and channels; Evolution API is WhatsApp transport with the bot attached.
- Where Chatwoot wins: human handoff. Routing, assignment and canned replies are native; Evolution API leans on stopBotFromMe.
- Practical pairing: run Evolution API for the bot, then point its webhook at Chatwoot when a person takes over.
How to use Evolution API OpenAI (the OSS WhatsApp API)?
- Add OPENAI_ENABLED=true to the evolution-api service variables and redeploy.
- Open /manager, create an instance, scan the QR code with your phone.
- Register your OpenAI key and create a keyword bot (replace the domain, INSTANCE, KEY and ID):
curl -X POST https://YOUR-DOMAIN/openai/creds/INSTANCE -H "apikey: KEY" -H "Content-Type: application/json" -d '{"name":"main","apiKey":"sk-..."}'
curl -X POST https://YOUR-DOMAIN/openai/create/INSTANCE -H "apikey: KEY" -H "Content-Type: application/json" -d '{"enabled":true,"openaiCredsId":"ID","botType":"chatCompletion","model":"gpt-4o","triggerType":"keyword","triggerValue":"support"}'
- Text the keyword from another phone, then tune triggerOperator, debounceTime and expire.
How to self host Evolution API OpenAI on other VPS Services (Evolution API self hosting guide)
Same three moving parts as Railway: the Evolution API container, Postgres and Redis. You supply the OpenAI key at runtime through the API, not the environment file.
Clone the Repository
git clone https://github.com/EvolutionAPI/evolution-api
cd evolution-api
Install Dependencies
Install Docker and the Compose plugin, then copy the env sample. Node.js is only needed if you build from source instead of the image.
cp .env.example .env
Configure Environment Variables
Set the API key, Postgres and Redis URIs, and turn the OpenAI integration on. Without that flag the openai routes return 404.
AUTHENTICATION_API_KEY=your-long-random-key
DATABASE_PROVIDER=postgresql
DATABASE_CONNECTION_URI=postgresql://user:pass@host:5432/evolution
CACHE_REDIS_URI=redis://host:6379
OPENAI_ENABLED=true
Start the Evolution API OpenAI Application
docker compose up -d
Open your-domain/manager, log in with the API key, create an instance and scan the QR code. Then register the OpenAI credential and create the bot. Railway handles the image, Postgres, Redis, the public domain and restarts for you.
Official Pricing of Evolution API OpenAI (Evolution API pricing)
Evolution API is free and open source under an Apache-2.0 based license, and the built-in OpenAI endpoints ship in the core image, so there is no license fee to pay. You pay for OpenAI usage, billed to the key you register with /openai/creds, and for hosting.
Evolution API OpenAI cloud vs self hosted comparison (Pricing, features, costs, and more)
Hosted WhatsApp API providers bill per instance and per message. Self hosting keeps the OpenAI bot in your own Railway project, so you pay for compute plus your own OpenAI usage.
Monthly cost of self hosting Evolution API OpenAI on Railway
Evolution API is free. OpenAI usage bills to the key you register at /openai/creds, so speechToText transcription adds cost there, not on Railway.
System Requirements for Hosting Evolution API OpenAI on a VPS
1 vCPU and 1-2 GB RAM handles a handful of instances. You need Docker or Node.js 20+, reachable Postgres and Redis, a persistent volume for /evolution/instances so session files survive restarts, and a public HTTPS domain.
Frequently Asked Questions (FAQs)
Why do the /openai endpoints return 404?
The template doesn't enable the integration. Add OPENAI_ENABLED=true to the evolution-api service and redeploy; until then the routes aren't registered.
assistant or chatCompletion?
Use assistant with an assistantId when your OpenAI assistant already holds the instructions and files. Use chatCompletion with model, systemMessages and maxTokens when the prompt lives in the bot payload.
Does it understand voice notes?
Only with speechToText enabled in /openai/settings/INSTANCE, which transcribes audio through OpenAI before the bot replies.
How do I stop the bot for one chat?
POST /openai/changeStatus/INSTANCE with the remoteJid and status paused, then opened to resume.
Who pays for OpenAI usage?
You do. Tokens bill to the key registered via /openai/creds/INSTANCE, separate from Railway hosting.
Is this allowed by WhatsApp?
Baileys is unofficial, so spam-like use can get a number banned; use a dedicated number. The official Cloud API is also supported.
Template Content
evolution-api
evoapicloud/evolution-api:v2.3.7Redis
redis:8.2