Skip to main content
The OneHot plugin teaches coding agents such as Claude Code, Codex and Cursor to build with the OneHot API. The agent learns to write decisions, act on the probabilities, train models and handle errors. For current details, the plugin points it to these docs.

Install the plugin

Set SQWISH_API_KEY to a key from the console first.
This needs Claude Code 2.1.292 or later. With an older version, add the marketplace first:
Restart Claude Code and type /mcp to check that onehot is connected.
Install it one way only, or your agent loads two copies of the skill. With the Claude Code plugin, remove any OneHot MCP connection you added to Claude Code by hand. Otherwise it sees every tool twice. With the skill alone, including in Codex or Cursor, keep the MCP connection you added by hand. The skill is on GitHub to read or to copy by hand.

Keep it up to date

The skill follows the API. An old copy can lead your agent to send fields the API no longer takes. Claude Code leaves auto-update off for marketplaces that Anthropic doesn’t run, so turn it on once: type /plugin, open Marketplaces, choose sqwish, then Enable auto-update. To update by hand, run claude plugin update onehot@sqwish. In other agents, run npx skills update onehot.

Example prompts

Say “using the OneHot skill” so any agent loads it. In Claude Code you can also run /onehot:onehot.
Using the OneHot skill, find where this project classifies text with string matching, regular expressions or by parsing a language model’s reply, and propose OneHot decisions to replace them.
Using the OneHot skill, route incoming support tickets to billing, technical or other, and send a ticket to a person when no team gets at least 0.6.
Using the OneHot skill, lint my decisions, then try them on the labelled examples in tickets.jsonl and tell me which wording and threshold work best.
Using the OneHot skill, quote a fine-tune on tickets.jsonl, start it if it costs under $5, and report the gate as it is.

What OneHot’s MCP does

Endpointhttps://api.sqwish.ai/mcpStreamable HTTP · Bearer API key
MCP is a way for an assistant to call tools. You give it one address. It reads the tools that address offers and calls one when the task needs it. OneHot’s server offers decision tools. Ask which tickets need a refund, and how sure the model is, and the agent can call decide on each one. The answer is a probability for every outcome you allowed. The model does not write a reply, so it cannot invent an outcome that is not on your list. A person can score text from the chat. A coding agent can check a decision, quote it and run it while it works. The key, the errors and the charges are the same as on the HTTP API. The calls spend credit from the account that owns the key.

Connect through MCP

The plugin connects Claude Code for you. Connect by hand for Codex and Cursor, or to use the tools without the skill. Connect one way only, or the agent sees every tool twice. Each tool is one call to the HTTP API, with the same key and the same errors. A key with inference access can decide, read models and families, and use lint_decision and list_recipes. Its calls to the other tools get 403 key_scope. The endpoint accepts POST only and returns 405 to a GET. The tools use your account. They can spend credit, including by keeping a model warm. Approve those calls in the client.
Run this once. To share the server with your team, add --scope project, which writes .mcp.json. Then write the header as 'Authorization: Bearer ${SQWISH_API_KEY}', in single quotes and with braces, so the file holds ${SQWISH_API_KEY} and not the key.
Then type /mcp in Claude Code and check that onehot is connected.
The commands above read your key from SQWISH_API_KEY. To test the connection, ask the agent to list models. It should call list_models and report which are available.

The tools

Start with list_recipes for a complete request. Use lint_decision to check the wording and estimate_decide for the quote. Then call decide. The tools take text only. To ask about pictures, have the agent write code that calls the API (Images). A fine-tune’s model joins its family only when its gate passes. A family that is switched on then moves to it (how a family moves).
decide, create_family and continue_family spend credit. So do keep_family_warm and keep_model_warm, where keep warm is billed. Switching, rolling back and deleting change what answers your calls. The tools that switch, keep warm, roll back or delete tell the agent to ask you first.

Claude Code tool-call hook

POST /v1/hooks/claude-code is a separate check on Claude Code PreToolUse payloads. It returns allow, ask or deny. Each check is a decision, charged like any other. The default, mode=guard, never grants permission. mode=auto can allow, which skips Claude Code’s permission prompt. If the model isn’t sure, or scoring fails after the request is accepted, the hook asks the person. To turn it on, add this to .claude/settings.json in your project, or to ~/.claude/settings.json for every project. Then set SQWISH_API_KEY before you start Claude Code. Keep the timeout short. If the hook does not answer in time, Claude Code asks you as it normally would. mode is a query parameter: for mode=auto, add ?mode=auto to the hook’s URL.
Keep your own permission checks as well. The tool-risk recipe is the decision, and the hook route is the payload. Errors explains each status code, whether to retry it and whether it is charged.

Files an agent can read

Two files on the API host tell an agent how to use OneHot. Fetching them needs no account.

openapi.json

The machine-readable contract: routes, bodies, and responses. It matches the API reference tab.

llms.txt

A short guide to authentication, decisions, and the workflows around them. It links to the OpenAPI document.
These docs also come as Markdown files: a page index and the full text.

Common problems

Run /onehot:onehot in Claude Code, or say “using the OneHot skill”. Check that the skill is installed for your agent, then restart it.
Start the agent from a shell where SQWISH_API_KEY is set. api_key_required means the agent sent no key. Signing in to the console doesn’t count. invalid_api_key means the key is wrong or revoked. Make another one in the console.
The skill is out of date. Update it and try again.
Describe each outcome more precisely, and give a way out such as “other”. Pick thresholds on examples whose answers you know. lint_decision flags the common mistakes.

Questions

At https://api.sqwish.ai/openapi.json. Fetching it needs no key. llms.txt on the same host is the short guide, and it links to that file.
The same API key as the HTTP API, sent as Authorization: Bearer. Create it in the console.
Only when you approve a tool that changes what answers: a switch, a rollback or a delete. If the gate passes, a family it starts or continues for you moves to the trained model by itself. Any family that is switched on does the same.
Use https://api.sqwish.ai/mcp. The endpoint accepts POST only, with Authorization: Bearer and an API key from the console. If the client cannot connect, call the HTTP API from the OpenAPI document directly.