Chat Nio (CoAI)
Point Chat Nio's web search at SpecStream with one setting, the search endpoint. Chat Nio (now CoAI) keeps its own SearXNG code, and every chat with web search on runs on SpecStream's Search API at $1 per 1,000 searches, with no SearXNG server to run.
SpecStream for Chat Nio (CoAI)AI assistantsWhat you need
- A self-hosted Chat Nio (CoAI) install and its admin account. This guide follows the source of the
mainbranch of coaidev/coai. - A SpecStream key. Get your key on the Search API screen of your SpecStream workspace. New accounts start with $10 of credit, no card.
- 1
1. Set the search endpoint
Sign in as an admin, open System in the admin menu, and find Web Search. In Search Endpoint, put SpecStream's SearXNG address with your key in it, in place of
YOUR_SPECSTREAM_KEY. Leave Search Engine Settings empty and select Save.Search Endpoint - 2
2. Or set it in config.yaml
The same setting lives in
config/config.yaml, undersystem,search,endpoint. With the Docker installs it is the file in the folder mounted as/config(~/configin Chat Nio's README).config/config.yaml - 3
3. Restart Chat Nio
Chat Nio loads the search settings when it starts, and Save writes them to
config/config.yaml. Restart the service so searches use the new endpoint:docker-compose restartfor the Docker Compose install, ordocker restart chatniofor thedocker runinstall. - 4
4. Test the search
Back in System, under Web Search, open Search Quizzes, type a query and select Confirm. The box fills with one line per result: the title, the URL in brackets and the text.
- 5
5. Ask with web search on
In a chat, turn on Web search in the message box. Chat Nio shows "Web search is enabled". Then ask about something recent:
In a Chat Nio chat
What Chat Nio sends, and what comes back
- Chat Nio sends
GETto the endpoint withq(the user's last message),format=json,safesearch(0, 1 or 2, from SafeSearch Mode), andenginesandimage_proxywhen those settings are on. - SpecStream answers in SearXNG's JSON:
results[]withurl,title,content,scoreandpublishedDate, withanswers,suggestionsandunresponsive_enginesbeside them. - Chat Nio keeps each result that has a title, a URL and text, writes it as
title (url): content, and adds the lines to the chat's system message with the current time. - Each search returns 10 results. To cap the text the model reads, turn on Turn on results truncation and set Maximum Result Characters.
- SpecStream picks the engines for each query, so the Search Engine Settings list and Turn on image proxy change nothing here.
Why the key goes in the address
Chat Nio's search setting has no key field: it calls the endpoint as written, with no header. SpecStream reads the key from the address. Anyone who can read the admin settings or config.yaml can read it, so give Chat Nio a key of its own with a spending limit, made in Agents & API.
What each search costs
Each chat message with web search on is one search on the Search API's fast tier: $1 per 1,000 searches of up to 10 results. It comes out of your SpecStream balance, with no quote and no approval. A search that returns nothing costs nothing, and every call, charged or not, is in your account's request log.
What your users pay stays as you set it in Chat Nio. Its own tip says web search may consume more tokens, since the results go to the model as input.
The Search API scores 97.9 F-score on all 1,000 SimpleQA Verified questions; scores and method are on the benchmarks page.
Limits and errors
- Chat Nio sends the whole last message as the query. A message over 2,000 characters is refused with
422, and Chat Nio sends the chat with "search failed" in place of results. 401means the key in the address was refused. Check the endpoint, save, and restart.- When the account has used its calls for the minute or search is busy, the route answers
429withRetry-After, and nothing is charged. - Search Quizzes works but chats get no results: check that Web search is on in that chat.
The same address in other apps
Any app that takes a SearXNG instance takes this address. See SearXNG on SpecStream for the parameters and fields, and the Search API docs for the API itself, at $5 per 1,000 searches with an answer, or $1 per 1,000 on the fast tier.
Go back
Set Search Endpoint back to your SearXNG instance, or to https://duckduckgo-api.vercel.app, the value in Chat Nio's config.example.yaml, then save and restart. Questions: [email protected].
More
SpecStream for Chat Nio (CoAI) covers what it does in Chat Nio (CoAI) on one page. Every other tool has its guide in Connect your tools. You see the most a request can cost before it starts, and the matches are paid from your balance. Billing has the details. For help, email [email protected].