Skip to content

Configure NextChat

Configure the model endpoint on the instance through a private file. Browser API-key overrides and configuration links are disabled in this image.

Configure a provider

A Session Manager shell can start as ssm-user. Switch to ubuntu first:

sudo -iu ubuntu

Use an interactive terminal that is not being recorded. The following command prompts for the provider root URL, model ID and hidden key. It refuses to overwrite an existing file and creates the new file with mode 0600.

python3 -c '
import getpass
import json
import os
from pathlib import Path

p = Path.home() / ".config/nextchat/provider.json"
value = {
    "base_url": input("Provider root URL: ").strip(),
    "model": input("Model ID: ").strip(),
    "api_key": getpass.getpass("Provider key: "),
}
fd = os.open(p, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)
with os.fdopen(fd, "w") as stream:
    os.fchmod(stream.fileno(), 0o600)
    json.dump(value, stream)
print("Saved credential file with mode 0600.")
'

Apply it:

sudo /opt/sushi/bin/sushi-nextchat configure \
  --provider-file /home/ubuntu/.config/nextchat/provider.json

The helper validates the configuration and restarts the service. Reload the browser, create a new chat and select the configured model. Confirm the service:

sudo /opt/sushi/bin/sushi-nextchat status

Use a root URL such as https://api.openai.com, without a trailing /v1. Remote endpoints require HTTPS with valid TLS. HTTP is accepted only for numeric loopback addresses, such as a separately configured service at 127.0.0.1. The endpoint must support /v1/chat/completions, streaming replies and your exact model ID. The image does not install or configure that separate local service. One key is accepted, up to 8,192 characters, without commas or whitespace.

Change credentials

Keep a secure copy if needed, move the existing provider.json within your private Ubuntu configuration directory, and rerun the prompts to create a new file. Do not weaken permissions or put a key in arguments, URLs, shell history, source code or screenshots. Protect or securely remove retained old key copies according to your own retention policy.

Persistent settings

Path Purpose
/etc/nextchat/instance.json Root-owned persistent access code and provider settings; mode 0600.
/home/ubuntu/.config/nextchat/access-code Ubuntu-owned private copy of the instance access code.
/home/ubuntu/.config/nextchat/provider.json Your private provider-input file.
/home/ubuntu/nextchat-demo/ Saved CLI walkthrough runs.

Leave the managed application and service configuration intact. A provider key is available to the running application; this is not isolation from untrusted code inside that application. Limit administrative and Session Manager access.

Last updated November 16, 2026 · Suggest an improvement