Coding client Beta
Beta: in use, and details can still change.
komplai's coding client connects a coding tool on your computer to Coding Beta, the API for coding models at https://api.komplai.dk/v1/coding. It has two parts: the command komplai-code and a plugin for OpenCode 2.0.28. Your coding tool reads and edits files and runs commands with your approval. komplai returns text, reasoning and function calls, and never runs a tool.
The client is not published on public npm. The person responsible for your organisation's setup supplies the approved version and its installation. If nobody has, contact us.
Before you start
- Node.js 22.14 or later, and a browser on the same computer.
- Coding is turned on for your organisation. It follows Chat: your organisation's Chat runs in komplai's EU cloud with approved processing and a monthly AI spending cap, and an administrator has given you access to Chat under Tool access (
/settings/apps).
Sign in
komplai-code login- The command prints a sign-in address and opens it in your browser.
- Sign in with your komplai account, as you do in the hub.
- Connect your coding tool shows each organisation where you can use Coding, with its processing terms: where data is processed, the provider's terms on training and retention, what komplai stores, the data mode, the approved models with the provider's prices in DKK, and how much is left under the organisation's monthly AI spending cap.
- Under the organisation you choose, tick that you have reviewed the terms and that your coding requests count towards the organisation's monthly AI spending cap. Tick that the key may be saved on this computer.
- Choose Connect to followed by the organisation's name. The terminal prints the organisation and when the access expires.
No coding request is sent while you sign in, and no account is created. If no organisation has Coding turned on for you, the page says so.
The connection is a personal API key (kp_live_...) with coding:read and coding:complete that expires after 30 days. It is listed under API keys (/api-access) in the hub, where you can revoke it. Your sign-in token is used only while you connect and is never saved.
The key is saved outside your project, in this folder:
macOS ~/Library/Application Support/Komplai/coding/
Linux ~/.local/share/komplai/coding/
Windows %USERPROFILE%\AppData\Local\Komplai\coding\On macOS and Linux, the folder and the file can be read only by you; it is a private file, not an encrypted keychain. On Windows, only your Windows account can open the file, and it is encrypted with Windows DPAPI. The client refuses to save the key inside a repository or in a folder others can read.
Commands
| Command | What it does |
|---|---|
komplai-code status | Shows the organisation, when the access expires, the current terms (contract), the monthly AI spending cap and this month's use (balance) and the data terms, as JSON |
komplai-code models | Lists the approved coding models with their limits and the provider's prices in DKK, as JSON |
komplai-code logout | Revokes the key in komplai, then removes it from this computer |
logout also revokes an expired key. If the network fails, the key stays on the computer so you can run logout again. To connect a computer that is already connected, run logout first.
Use it in OpenCode
The plugin works with OpenCode 2.0.28 and refuses other versions.
- Add the plugin file
opencode.jsfrom the client topluginsin your own OpenCode configuration, with its absolute path. - In OpenCode's integrations, choose the komplai coding integration and its sign-in. Your browser opens the same sign-in and terms as
komplai-code login, on the same computer as OpenCode. - Choose one of the approved models.
{
"plugins": ["/path/to/komplai-coding-client/dist/opencode.js"]
}The key stays in the client's private file. OpenCode keeps only a marker without the key, and a connection made with komplai-code login works in OpenCode too. The plugin adds the commands komplai-status, komplai-models and komplai-logout.
OpenCode offers only the approved models. The plugin sends the current terms and a new request id with every call, and it switches OpenCode's automatic retries off, because a retry with a new request id would be billed as a new call. OpenCode's cost fields are in US dollars, so the plugin leaves them empty; the prices in DKK are shown at sign-in and by komplai-models.
When the terms change
The terms cover the provider, its terms on data, the data mode, the agreement and the approved models with their prices. When any of them changes, the client stops and asks you to sign in again and review the new terms (terms_changed). Ordinary use does not change the terms.
Where your code is processed
- Prompts, code and tool results go through komplai's API at Hetzner in Germany to the approved coding model in komplai's EU cloud in France.
- komplai stores no prompts, answers or tool results. Metadata about access and usage is recorded and kept as your organisation's agreement sets out.
- The provider does not use the content for training and does not keep it by default, apart from a temporary, project-isolated cache of intermediate results. In a troubleshooting or security investigation, a whole request can be kept for up to two weeks, and aggregated, anonymised usage data for up to six months. The sign-in page shows the terms and when komplai last checked them.
- Usage is metered at the provider's price and counts towards your organisation's monthly AI spending cap. Before each call, the most it can cost is reserved under the cap. Calls stop when the cap, your organisation's own limit or your personal limit is reached, and the client never moves to another model.
- When the data mode is test data, use test data only.
Errors
The client shows a plain message for each error. The ones you meet most often:
| Code | What to do |
|---|---|
| coding_not_enabled | Ask your administrator for access to Chat. komplai turns Coding on for your organisation; your administrator can contact us. |
| terms_changed | Run komplai-code logout, then sign in again and review the new terms. |
| ai_credit_exhausted | The organisation's monthly AI spending cap is reached. Ask your administrator. |
| person_ai_credit_exhausted | Your personal limit is reached. Ask your administrator. |
| invalid_api_key | The access has expired or was revoked. Run komplai-code logout, then sign in again. |
Build your own client
To connect another coding tool, create a personal API key with coding:read and coding:complete under API keys in the hub. Read GET /v1/coding/account and show the terms to the person before the first call, then send each call to POST /v1/coding/chat/completions with the current terms in X-Komplai-Contract and a new UUID in X-Request-Id for every operation. Coding explains the API, and the Coding reference has every field.