Run Perplexica's answer engine on a custom OpenAI base URL.
Updated 2026-07-16
Perplexica, renamed Vane upstream, configures its OpenAI provider with an API Key and a Base URL field. Set the Base URL to https://api.apisrouter.com/v1, add the model ids you want, and every search answer synthesizes through the gateway with Claude, GPT, DeepSeek, or Gemini behind one key.
Quick answer: one Base URL field, two config generations.
On current releases, Perplexica's OpenAI provider exposes exactly two required fields: API Key and Base URL, editable in the setup screen and settings UI, with documented environment mappings OPENAI_API_KEY and OPENAI_BASE_URL. Set the Base URL to https://api.apisrouter.com/v1, paste a gateway key, then add the chat models you want by their exact catalog ids. The provider forwards the model id as a plain string over /v1/chat/completions, so Claude and DeepSeek ids work through the "OpenAI" provider slot. On older Perplexica releases (the config.toml generation, through the v1.10 and v1.11 line), the same capability is the CUSTOM_OPENAI provider: a [MODELS.CUSTOM_OPENAI] block with API_KEY, API_URL, and MODEL_NAME keys. Both generations are shown below, so match the setup to the version you are actually running.
# the settings UI fields map to these documented env vars
export OPENAI_API_KEY=sk-APIsRouter-...
export OPENAI_BASE_URL=https://api.apisrouter.com/v1
# then add chat models by id in Settings, e.g. claude-sonnet-4-6How Perplexica answers a question, and where the LLM sits.
Perplexica (ItzCrazyKns on GitHub, roughly 36K stars) is the best-known open-source answering engine in the Perplexity style: it takes a question, runs real web searches through a bundled SearxNG instance, reads the results, and has an LLM synthesize a cited answer. Search modes (speed, balanced, quality) trade retrieval depth against latency, and focus modes narrow sources to the web, discussions, or academic papers. In 2026 the project was renamed Vane upstream, with the Docker image following suit; the architecture and the provider system carried over, so everything here applies under either name. The LLM slot is where synthesis quality and cost live. Every answer is one or more chat-completions calls carrying the retrieved sources as context, which makes an answering engine a high-input-token workload: the model reads far more than it writes. The provider system treats OpenAI as one of several backends (Ollama, Anthropic, Gemini, Groq, and others), and the OpenAI provider is the one with a freely editable Base URL, which is what makes it the gateway hook. One behavior to know up front: when the Base URL is anything other than the stock OpenAI endpoint, Perplexica intentionally shows an empty default model list and uses the model entries you add to the provider yourself. That is by design, since it cannot know what a custom endpoint serves. Adding claude-sonnet-4-6 or deepseek-v4-flash as a model entry is the second half of the setup, not a workaround.
Full setup: current releases and the legacy config.toml.
Current releases configure everything in the app. On first boot the setup screen asks for providers; afterwards the same fields live in Settings. Select the OpenAI provider, set API Key and Base URL, then add chat model entries with the ids you plan to use. The ids must match the gateway catalog exactly, and each entry you add appears in the model picker next to the search box. The legacy generation is file-based. If your installation still has a config.toml, you are on the CUSTOM_OPENAI generation: fill the block below and restart the container. MODEL_NAME takes one model id, which the UI then offers as the custom OpenAI option.
[MODELS.CUSTOM_OPENAI]
API_KEY = "sk-YOUR-APISROUTER-KEY"
API_URL = "https://api.apisrouter.com/v1"
MODEL_NAME = "claude-sonnet-4-6"Choosing a synthesis model for an answering engine.
Because the model picker reads whatever entries you added against one Base URL, A/B testing synthesis models is trivial: ask the same question in two tabs with two entries and compare citations. The per-key usage log prices each model's answers, which is the honest way to decide whether frontier synthesis earns its tokens on your query mix.
- Input tokens dominate. A quality-mode answer can push large retrieved contexts into the prompt, so the per-input-token price of your id sets the cost of a search, not the short answer it writes back.
- claude-sonnet-4-6 is the strong default for cited synthesis: it follows the source-grounding instructions well and stays coherent when many snippets disagree.
- High-volume personal or team instances do well on claude-haiku-4-5-20251001, gemini-3.5-flash, or deepseek-v4-flash: answers stay grounded and the per-search cost drops enough to leave quality mode on.
- Keep a frontier id as a second entry. Model entries sit side by side in the picker, so escalating one hard question to gpt-5.5 is a dropdown change, not a config edit.
- Academic focus mode rewards long-context models, since paper abstracts and excerpts are bulkier than web snippets.
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.
| Model | Official Price | Our Price |
|---|---|---|
| Claude Sonnet 4.6 | $3.00 / $15.00 per M | $2.40 / $12.00 per M |
| Claude Haiku 4.5 20251001 | $1.00 / $5.00 per M | $0.80 / $4.00 per M |
| GPT-5.5 | $5.00 / $30.00 per M | $4.00 / $24.00 per M |
| Gemini 3.5 Flash | $1.50 / $9.00 per M | $1.20 / $7.20 per M |
| DeepSeek V4 Flash | $0.14 / $0.28 per M | $0.13 / $0.25 per M |
Failure modes specific to Perplexica.
The empty model list is the classic one. You set the Base URL, the picker goes blank, and it looks broken. It is not: with a non-default Base URL, Perplexica lists only the model entries you add to the provider. Add your ids and they appear. Embeddings are a separate slot. Perplexica uses embedding models for result reranking, and the OpenAI provider serves embeddings from the same Base URL and key. If your gateway does not serve the embedding id you configure there, reranking breaks while chat answers keep working. The clean split is to keep embeddings on the local Transformers provider, which runs on the machine with no API at all, and route only chat synthesis through the gateway. The rename trips up guides. Perplexica and Vane are the same project; old tutorials reference the perplexica Docker image and config.toml, current builds ship as vane with in-app settings and a persistent data volume. If your installation has no config.toml, do not create one, it is not read; configure through the UI or the documented env vars instead. SearxNG is independent. If answers degrade or searches return nothing, that is the SearxNG container or its JSON-format setting, not the LLM endpoint. The Base URL only moves chat and embedding calls.
Who routes Perplexica through a gateway.
- Self-hosters replacing a Perplexity subscription who want frontier-quality synthesis per search at token prices, with one key instead of a vendor account per model family.
- Teams running a shared answering engine, where the per-key usage log turns "what does search cost us" into a number per model.
- Privacy-focused setups that keep retrieval fully local (SearxNG plus local embeddings) and route only the final synthesis call outward through one auditable endpoint.
- Tinkerers comparing synthesis models on identical questions: every candidate is one model entry against the same Base URL.
- 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 search.
Confirm the gateway serves the ids you added before blaming the app; the entries in the provider must match /v1/models output exactly. First-run failures follow a pattern. "No chat model providers configured" means the provider fields did not save or the model list is still empty; add at least one chat model entry. A 401 in the server logs means the key does not match the endpoint in the Base URL field. A model-not-found error is an id typo in a model entry. Reranking errors with working answers point at the embedding slot, which is where the local Transformers provider saves you. And if nothing changed after editing environment variables, remember the config persists in the data volume; fields already saved in the UI win over a later env change, so edit them in Settings. Once searches flow, the APIsRouter console shows per-request model, token counts, and spend. Answering engines are input-heavy, and seeing the real tokens-per-search number for your query mix beats any estimate.
curl -s https://api.apisrouter.com/v1/models \
-H "Authorization: Bearer $APISROUTER_API_KEY" | head -50FAQ
Is Perplexica the same project as Vane?
Yes. The upstream repository was renamed Vane in 2026, and the Docker image followed. The provider system, SearxNG integration, and the Base URL field described here are the same under both names; only legacy releases still use the Perplexica name and config.toml.
Can Perplexica use Claude or DeepSeek models for answers?
Yes. The OpenAI provider forwards model ids as plain strings to whatever Base URL you set. Add claude-sonnet-4-6 or deepseek-v4-flash as model entries against the gateway Base URL and they appear in the model picker like any other option.
Why is the model list empty after I changed the Base URL?
By design. With a non-default Base URL, Perplexica cannot assume which models the endpoint serves, so it lists only the entries you add to the provider yourself. Add your ids in Settings and they show up immediately.
What are the legacy CUSTOM_OPENAI config keys?
On the config.toml generation (through the v1.10 and v1.11 line), the [MODELS.CUSTOM_OPENAI] block takes API_KEY, API_URL, and MODEL_NAME. Set API_URL to the gateway endpoint including /v1 and MODEL_NAME to one catalog id, then restart.
Do embeddings route through the custom Base URL too?
If you configure embedding models on the OpenAI provider, yes, they use the same Base URL and key. Most gateway setups keep embeddings on the local Transformers provider instead, which needs no API and leaves reranking independent of the chat endpoint.
Do OPENAI_API_KEY and OPENAI_BASE_URL environment variables still work?
Yes, they are the documented env mappings for the OpenAI provider's two fields on current releases. Note that values already saved through the settings UI persist in the data volume, so edit there if the app was configured once already.