Skip to content

Documentation / 1.12.0

Connect another app through the API

Open API Access to copy the endpoint and run Test API. The default base URL is http://127.0.0.1:7331/v1. Use GET /v1/models to find a model ID, such as auto or a profile, then POST /v1/chat/completions. The API gets the same assistant as chat: Auto, web look-ups, connected services, answer checks, personalization, and specialized AIs. It is an OpenAI-compatible subset, not every hosted API feature.

With local network access off, the default endpoint on this computer needs no API key. With it on, an app or script on another device needs a key for every request; apps on this computer still need none, and people sign in with their password in a browser instead. Create a named key in API Access and copy its secret when it is shown; you can rotate or revoke it there. Send it as Authorization: Bearer YOUR_KEY.

Each key has permissions a request can only narrow: whether it may use memories and connected knowledge (never, on request, or always), which tools (the profile's, read-only, or none), and whether it may choose where it runs. API requests use memories only when they ask, unless the key says always. A request can ask for JSON with response_format, and Toskar checks and repairs the result.

A request that names a model gets the room it needs. When its messages and answer are more than the model's context window on this computer, Toskar starts the model again with a bigger one, up to what the model was made for, if it still fits. Coding tools that send a lot at once can ask up front, with toskar.context_window set to the tokens they need. When no size fits, the request fails with CONTEXT_TOO_LONG, and nothing is cut off.

Coding agents and editors that run their own tools can use a model directly. Name the model as raw: and its ID, such as raw:qwen2.5-7b-q4, and the request goes straight to the model with the agent's tools, and the model's tool calls come back to the agent. It skips Toskar's assistant: no memories, knowledge, look-ups, or answer checks. A request from this computer can do this without a key. For another device, an Admin turns on Drive models directly, for coding agents, in that key's permissions in API Access. GET /v1/models lists the raw: models a key may use. Agents built for Anthropic's format work too: point them at Toskar's address, such as http://127.0.0.1:7331, and set their model to the model's ID. They reach POST /v1/messages, which works the same way. So do agents built for OpenAI's Responses format, through POST /v1/responses: send the whole conversation each time, since Toskar doesn't keep earlier responses.

toskarctl connect sets these up for you. Run toskarctl connect claude-code, codex, opencode, or aider to print the settings that agent needs, or add --write to save them: for Claude Code and OpenCode in the project folder you're in, and for Codex as a toskar profile you run with codex --profile toskar. Your agent's usual settings stay as they were. Pick the model with --model, or let it choose the best installed model for coding. For editors, toskarctl connect continue, cline, roo-code, zed, jetbrains, or copilot prints what to enter in that editor's settings, since they keep it there. An agent with many tools, such as one with MCP servers, works too: when its tools would take more than a quarter of what the model reads at once, the model gets the ones the request most likely needs and searches for the rest as it goes. The agent never notices.

The Toskar extension for VS Code lists Toskar's models in Copilot Chat's model picker and adds @toskar, Toskar's assistant, to Copilot Chat. On this computer it needs no setup. For Toskar on another computer, run Toskar: Connect to Another Computer in VS Code. Type the address Toskar shows, check that the code VS Code shows matches the encryption check code under Connect a device, then type the 6-digit code. VS Code then trusts only that computer's certificate, and it's listed under Devices, where you can disconnect it. The model picker drives models directly, so it works only when an Admin or the Owner showed the code; with a Member's code, @toskar works and the picker doesn't.

For another computer, use the LAN endpoint shown in API Access rather than localhost. Keep LAN access on a trusted network; the displayed HTTP endpoint does not itself provide public-internet TLS protection.

Apps that speak MCP, such as Claude Desktop, Claude Code, Cursor, and VS Code, can ask your local AI questions, list its models, and search your connected knowledge. API Access → Use Toskar in other AI apps shows what to paste into each.

curl http://127.0.0.1:7331/v1/models

curl http://127.0.0.1:7331/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"MODEL_ID_FROM_LIST","messages":[{"role":"user","content":"Hello"}],"stream":false}'

These pages describe Toskar 1.12.0. Download 1.12.0 and its release notes ↗ · Need help? Report a bug or request a feature ↗

Something missing or wrong?

Kind

Sent with it: docs 1.12.0. It becomes a public issue in toskar-core.

Connect another app through the API · Toskar 1.12.0 documentation