Run Chatwoot Captain on a custom OpenAI-compatible endpoint.

Updated 2026-07-16

Self-hosted Chatwoot configures Captain through Super Admin app configs: CAPTAIN_OPEN_AI_ENDPOINT, CAPTAIN_OPEN_AI_API_KEY, and CAPTAIN_OPEN_AI_MODEL. Point the endpoint at https://api.apisrouter.com (Chatwoot appends /v1 itself) and your support AI answers on any catalog model through one key.

Quick answer: three Captain configs in Super Admin.

On current self-hosted Chatwoot, Captain's LLM settings are installation configs, not .env variables; the shipped .env.example says so explicitly and points you at Super Admin, App Configs, Captain. Three values matter: CAPTAIN_OPEN_AI_API_KEY takes the gateway key, CAPTAIN_OPEN_AI_MODEL takes the model id, and CAPTAIN_OPEN_AI_ENDPOINT takes the endpoint host. The endpoint value has one sharp edge: give it without the /v1 suffix. Chatwoot's initializer builds the API base itself by trimming a trailing slash and appending /v1, and the config's own description shows the default as https://api.openai.com/ in exactly that shape. For APIsRouter, enter https://api.apisrouter.com and let Chatwoot derive https://api.apisrouter.com/v1. These configs are read when the app boots, so restart Chatwoot after changing them.

CAPTAIN_OPEN_AI_API_KEY:  sk-YOUR-APISROUTER-KEY
CAPTAIN_OPEN_AI_MODEL:    claude-haiku-4-5-20251001
CAPTAIN_OPEN_AI_ENDPOINT: https://api.apisrouter.com
                          (no /v1 -- Chatwoot appends it)

then restart the Chatwoot processes

What Captain does with the configured model.

Chatwoot (roughly 34K stars on GitHub) is the leading open-source customer support platform, and Captain is its AI layer: an AI agent that answers customer conversations from your help-center articles and FAQs, a copilot that drafts replies and summarizes threads for human agents, and document-grounded knowledge features behind both. On self-hosted installations where Captain is available, all of it runs through the model configured above. Under the hood, Chatwoot configures its agents SDK once at boot: the key, the derived API base, and the default model. Every Captain feature then speaks standard chat completions to that base URL, and the model id travels as a plain string. Chatwoot does keep a map of model-name prefixes (claude-, gemini-, deepseek-) but uses it for telemetry labeling, not routing, so a Claude or DeepSeek id set as CAPTAIN_OPEN_AI_MODEL still goes to your configured endpoint like any other string. Support traffic has a distinctive cost profile: many conversations, short turns, and grounded answers assembled from retrieved articles. That makes per-conversation cost the number that matters, and it is dominated by input tokens from the retrieved context. A fast id handles the assistant tier well, with escalation to a stronger id being a one-config change when you want the copilot writing better drafts.

Full setup and the boot-time detail.

Open the Super Admin console on your installation, go to App Configs and select Captain, then fill the three values. If your Chatwoot predates the endpoint config (it landed in the v4.4 era in mid-2025), upgrade first; on older versions only the key and model existed and the endpoint was hardcoded. Because the initializer reads these configs during application boot, changes take effect after a restart of the web and worker processes. That also means a wrong value does not fail at save time; it fails on the first Captain request after restart, which is worth knowing before you debug in the wrong place. Captain also has an embedding side: CAPTAIN_EMBEDDING_MODEL (default text-embedding-3-small) powers document search over your help-center content, and it resolves against the same configured endpoint. If you repoint the endpoint at a gateway, confirm the embedding id you configure there is one the endpoint actually serves; otherwise leave document features on their existing setup and validate them separately after the switch.

# Chatwoot will call <endpoint>/v1/chat/completions
curl -s https://api.apisrouter.com/v1/chat/completions \
  -H "Authorization: Bearer $APISROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-haiku-4-5-20251001",
       "messages":[{"role":"user","content":"ping"}]}'

Choosing a model for support automation.

The evaluation loop that works: run a week on a fast id, export the usage numbers, then run the copilot-heavy teams on a stronger id and compare draft acceptance rather than vibes. Both candidates bill through the same key, so the comparison arrives priced.

  • The AI agent tier is volume work: grounded answers over retrieved articles, thousands of conversations a month. claude-haiku-4-5-20251001, gpt-5.4-mini, and gemini-3.5-flash keep per-conversation cost flat without losing grounding discipline.
  • The copilot tier reads whole threads and drafts replies for humans, where tone and judgment show. claude-sonnet-4-6 is the natural step up when draft quality drives agent productivity.
  • Multilingual support desks should test deepseek-v4-pro and gemini-3.5-flash on their real language mix; grounded answering quality varies more across languages than English benchmarks suggest.
  • Per-conversation cost is measurable, not theoretical: tokens per conversation times conversations per month, straight off the usage log.
  • One model serves all Captain features per installation, so pick for your dominant workload and revisit after reading a week of real usage.

Pay-as-you-go · transparent per-model pricing

Selected models are priced below official list prices. Exact input, output, cache, and per-request prices are shown for each model.

ModelOfficial PriceOur Price
Claude Haiku 4.5 20251001$1.00 / $5.00 per M$0.80 / $4.00 per M
Claude Sonnet 4.6$3.00 / $15.00 per M$2.40 / $12.00 per M
GPT-5.4 Mini$0.75 / $4.50 per M$0.60 / $3.60 per M
DeepSeek V4 Pro$0.43 / $0.87 per M$0.39 / $0.78 per M
Gemini 3.5 Flash$1.50 / $9.00 per M$1.20 / $7.20 per M

Failure modes specific to Chatwoot Captain.

The /v1 double-suffix is the classic. Because Chatwoot appends /v1 to whatever you enter, pasting https://api.apisrouter.com/v1 produces requests against /v1/v1/chat/completions, which 404 at the gateway. Enter the host without /v1. Config changes that seem ignored are the restart rule. The agents SDK is configured once at boot from the installation configs; editing them in Super Admin without restarting leaves the old values live in every running process. Old guides point at the wrong surface. Tutorials from earlier Chatwoot versions configure OPENAI_API_KEY through environment variables or the legacy OpenAI integration; on current versions the Captain configs in Super Admin are the surface, and the .env.example says so in as many words. Model-not-found on Captain's first reply after a switch is an id typo in CAPTAIN_OPEN_AI_MODEL; the gateway's /v1/models listing is the authoritative spelling. Authentication errors mean the key and endpoint configs do not belong together. And if article search or document grounding degrades while chat answers fine, look at the embedding config, which is a separate model resolving against the same endpoint.

Who routes Chatwoot Captain through a gateway.

  • Self-hosted support teams who want Claude-quality drafting in the copilot without a separate vendor account and billing relationship.
  • High-volume desks where the AI agent answers most conversations, and per-conversation cost decides whether automation pays; fast catalog ids keep that number honest.
  • Teams running one Chatwoot per brand or region, metering each installation with its own key so support AI cost reports itself per brand.
  • Operators comparing support models on real traffic: each candidate is one config value and a restart, not a migration.
  • Developers without access to a given vendor's billing. Top-up based access with no card requirement removes the per-provider sign-up dependency.

Verify the endpoint and debug the first conversation.

Verify outside Chatwoot first: list models with your key and run one chat completion against the exact id you set in CAPTAIN_OPEN_AI_MODEL. If those pass, the gateway half is proven and everything else is Chatwoot-side. Then restart and watch the first Captain interaction. Authentication failures point at the key config; model-not-found points at the model config; 404-shaped errors point at a /v1 pasted into the endpoint config. If Captain features simply do not appear, that is availability and licensing on your installation tier, not endpoint configuration. Once conversations flow, the APIsRouter console shows per-request model, token counts, and spend. Support AI is a budget line that compounds monthly, and one key per installation turns the usage log into the per-desk cost report your finance team keeps asking for.

curl -s https://api.apisrouter.com/v1/models \
  -H "Authorization: Bearer $APISROUTER_API_KEY" | head -50

FAQ

Which Chatwoot config points Captain at a custom OpenAI-compatible endpoint?

CAPTAIN_OPEN_AI_ENDPOINT, set in the Super Admin console under App Configs, Captain, alongside CAPTAIN_OPEN_AI_API_KEY and CAPTAIN_OPEN_AI_MODEL. On current versions these are installation configs, not .env variables.

Should the endpoint include /v1?

No. Chatwoot trims a trailing slash and appends /v1 itself when building the API base. Enter https://api.apisrouter.com and Chatwoot derives https://api.apisrouter.com/v1; pasting the /v1 yourself produces a doubled path that 404s.

Can Captain run on Claude or DeepSeek models?

Yes. CAPTAIN_OPEN_AI_MODEL travels to the configured endpoint as a plain string; Chatwoot's provider-prefix map only labels telemetry. Any id the gateway serves works, claude-haiku-4-5-20251001 and deepseek-v4-pro included.

Why did my config change not take effect?

Captain's LLM settings are read at application boot. Restart the Chatwoot web and worker processes after editing the configs in Super Admin; running processes keep the old values until then.

Does the endpoint config affect Captain's document search?

The embedding model (CAPTAIN_EMBEDDING_MODEL, default text-embedding-3-small) resolves against the same endpoint. Confirm the endpoint serves the embedding id you configure, or validate document features separately after switching.

Which Chatwoot version do I need?

The endpoint config landed in the v4.4 era in mid-2025. Earlier versions expose only the key and model with a hardcoded OpenAI endpoint, so upgrade before pointing Captain at a gateway.