Docs

Test your endpoint in the browser

Once tokmine is online it prints a link to a web chat. Open it to talk to your local model straight from the browser, without writing any code.

Open the chat

The link appears in the terminal when the tunnel comes up:

text
✓ Ollama  :11434  openai, ollama  1 model
✓ Tunnel connected

Public URL  https://tunnel.tokmine.ai/t/k7x2-m9qa
Token       tm_anon_...   (shown once)
Expires     in 30:00
Chat        https://app.tokmine.ai/chat#url=https%3A%2F%2F...&token=...
            (contains your token, do not share)

Open it in a browser. The chat connects to your endpoint and lists your models. Pick one and type a message.

How the token is handled

For an anonymous session the link contains the public URL and the access token after a #, URL-encoded. A URL fragment is never sent to any server. The page hands the values to its backend, which first checks the token with a real request for your models and only then stores it in an httpOnly, Secure, SameSite=Strict cookie that page scripts cannot read. The fragment is cleared from the address bar immediately. The cookie lasts 30 minutes by default, shorter if the link says the session expires sooner, and never more than 12 hours. Disconnect in the page clears it.

Do not share this link. Anyone who has it can use your endpoint until the session expires. To let others in, give them their own token from an account instead (see Using an account).

The link is printed when tokmine starts and when it resumes a saved session, not on every silent reconnect. With --json the online event carries it as chatUrl.

Logged in

If you are signed in to the portal and have an agent token configured, the link is just https://app.tokmine.ai/chat, with no token in it. You are identified by your session and chat through your workspace endpoint automatically.

Any endpoint

Otherwise the page asks for an endpoint URL and a token. Paste the public URL and the token that tokmine printed. They are stored server-side in the same kind of cookie.

Features

  • A model selector with the models your machines serve.
  • Streaming replies, token by token, with stop and regenerate.
  • A system prompt, temperature and max tokens.
  • Copy a reply and clear the conversation.
  • Clear error messages per HTTP status (for example an invalid token or an offline machine).

Using another portal address

The link points to https://app.tokmine.ai. Override it with --app-url, the TOKMINE_APP_URL environment variable or appUrl in the config file. See the CLI reference.

Troubleshooting

  • The chat says my machine is offline.
    The tunnel is not connected. Check that tokmine is still running in your terminal (anonymous sessions end after 30 minutes) and that your runner is up. Run tokmine status, then reload the chat.
  • The token is in the link. Is that safe?
    It is in the fragment, which browsers do not send to servers, and the page removes it from the address bar right after storing it in an httpOnly cookie. Still, treat the link like a password and do not paste it into chats, tickets or screenshots.
  • My session expired after 30 minutes.
    Anonymous sessions last 30 minutes. Restart tokmine for a new link, or log in to keep a persistent machine.
  • The model list is empty.
    Your runner has no models, or it is not discovered. Run tokmine models. If you have none, see Install a local model.
  • The chat keeps asking for an endpoint and token.
    The cookie expired (30 minutes by default) or your browser blocks cookies for the site. Open the link printed by tokmine again, or paste the endpoint and token.

More in Troubleshooting and API compatibility for calling the same endpoint from code.