Skip to content

AI explanations ​

When a channel keeps failing or a node looks odd, Bitstream can ask an AI model to explain the problem in plain language, in your own language. You bring your own OpenAI or Anthropic API key. The AI assistant is off until you add one.

What leaves your server ​

Bitstream builds the context itself and cleans it before it sends anything:

  • Source URLs keep only the scheme and the host. Provider usernames and passwords are removed.
  • Client IPs are masked to /24 (IPv4) or /48 (IPv6).
  • Line passwords, tokens and keys are never read.
  • Values after header, cookie, key, password, proxy and auth flags in custom ffmpeg arguments are masked.

The answer lists what kinds of data were removed. Your API key is stored encrypted and never shown again.

1. Add your key ​

In the panel, open Settings > AI assistant.

  1. Turn on Turn on the assistant.
  2. Pick the Provider: Anthropic or OpenAI.
  3. Type the Model name from your provider.
  4. Paste your API key.
  5. Leave Custom address empty, unless you use a gateway that speaks the same API.

Bitstream sends a tiny test request before it saves the key, so a wrong key, model or address fails right away. Afterwards the panel shows only the end of the key.

Changing the provider or address

If you change the provider or the custom address, you must type the API key again. This way a saved key is never sent to a new place.

Automate it
bash
curl -s -X PATCH $PANEL/ai/settings \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"enabled": true, "provider": "anthropic", "model": "<model name>", "api_key": "<your key>"}'
  • provider is anthropic or openai.
  • base_url is optional. Private addresses are refused unless the control runs with BS_FETCH_ALLOW_PRIVATE=1. Loopback and link-local addresses are always refused.

GET /ai/settings shows whether a key is set and a short hint of it.

2. Ask for an explanation ​

With the assistant on, the panel shows Explain with AI buttons. You find them on a channel and on a server in Nodes (Ask AI). Click one, add a question if you want, and click Explain. The answer can take up to a minute.

Automate it
bash
curl -s -X POST $PANEL/ai/explain \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"subject_type": "stream", "subject_id": "101", "question": "Why does it keep switching to the backup?"}' | jq
subject_typesubject_id
streamstream id
nodenode id
connectionsession id of a live connection
logstream id (explains its recent logs)

For stream and log you can add node_id to look at one node only. question is optional.

The call can take up to 60 seconds. If the provider is slower, you get 504 ai_timeout. Each user can make 10 calls per minute. Without a key you get 409 ai_not_configured. Only admins can call it, and an API key needs the ai:use scope.

Without AI ​

You do not need AI to get help. Tuning suggestions are simple rules that run on your own server, with no outside service. Channels also show the reason they are down or on a backup source.

Bitstream documentation