# Hoody Decide **Page:** foundation/hoody-ai/decisions [Download Raw Markdown](./foundation/hoody-ai/decisions.md) --- # Hoody Decide `hoody-ai/hoody-decide` is Hoody AI's decision model. You send a `state` (text, JSON, or images) and a set of named questions; each question comes back as calibrated probabilities instead of prose. It answers the small, choice-shaped questions a program asks many times a day: is this log line an incident, which team owns this ticket, how risky is this command. Like [Hoody Free](/foundation/hoody-ai/models/#hoody-free), it is free of charge, needs no API key, and works only from inside a computer that has [AI access on](/foundation/hoody-ai/#turn-ai-access-on-or-off), which is the default. Any program running in your computer can call it: it is a plain HTTPS request with the computer token, so any language or tool that can send JSON works. Send the request to `POST https://ai.hoody.com/api/v1/systemone` or `POST https://ai.hoody.com/api/v1/decisions`: both paths take the same body and return the same answer. Authenticate with the computer's own token, `Authorization: Bearer computer-{computerName}`, as for every [Hoody AI call from a computer](/foundation/hoody-ai/usage/#quick-reference). This asks two questions about one state: The Hoody CLI has no decision command; from a shell inside your computer, send the request with curl. ```bash # Ask two questions about one state from inside your computer curl -X POST "https://ai.hoody.com/api/v1/systemone" \ -H "Authorization: Bearer computer-dev-env" \ -H "Content-Type: application/json" \ -d '{ "model": "hoody-ai/hoody-decide", "state": "Deploy failed: disk quota exceeded on /var/lib/app", "questions": { "urgent": {"type": "noul", "instructions": "Does this need a human within the hour?"}, "owner": {"type": "choice", "instructions": "Which team owns the fix?", "criteria": {"infra": "servers, disks, networks", "app": "application code", "data": "databases and storage"}} } }' ``` The Hoody SDK has no call for this endpoint, so this uses `fetch`; the agent's decision call is under [Advanced](/foundation/hoody-ai/decisions/#advanced). ```typescript // Call the decision endpoint directly from your computer const response = await fetch('https://ai.hoody.com/api/v1/systemone', { method: 'POST', headers: { 'Authorization': 'Bearer computer-dev-env', 'Content-Type': 'application/json' }, body: JSON.stringify({ model: 'hoody-ai/hoody-decide', state: 'Deploy failed: disk quota exceeded on /var/lib/app', questions: { urgent: { type: 'noul', instructions: 'Does this need a human within the hour?' }, owner: { type: 'choice', instructions: 'Which team owns the fix?', criteria: { infra: 'servers, disks, networks', app: 'application code', data: 'databases and storage' } } } }) }); const data = response.headers.get('content-type')?.includes('application/json') ? await response.json() : { error: { message: await response.text() } }; if (!response.ok) { if (data.error?.code === 'decision_limit_reached') { console.log(`limit ${data.error.limit} lifts at ${data.error.reset_at}`); } throw new Error( `${response.status} ${data.error?.code ?? response.statusText}: ${data.error?.message ?? ''}` ); } console.log(data.answers.urgent.noul, data.answers.owner.choice); ``` ```bash curl -X POST "https://ai.hoody.com/api/v1/systemone" \ -H "Authorization: Bearer computer-dev-env" \ -H "Content-Type: application/json" \ -d '{ "model": "hoody-ai/hoody-decide", "state": "Deploy failed: disk quota exceeded on /var/lib/app", "questions": { "urgent": {"type": "noul", "instructions": "Does this need a human within the hour?"}, "owner": {"type": "choice", "instructions": "Which team owns the fix?", "criteria": {"infra": "servers, disks, networks", "app": "application code", "data": "databases and storage"}} } }' ``` Sends the same two questions as the HTTP tab: a yes/no probability and a choice between three teams. The answer: ```json { "model": "hoody-ai/hoody-decide", "answers": { "urgent": { "type": "noul", "noul": 0.82 }, "owner": { "type": "choice", "choice": "infra", "confidence": 0.9, "probabilities": { "infra": 0.9, "app": 0.04, "data": 0.06 } } }, "usage": { "input_tokens": 412, "output_tokens": 18 } } ``` `usage.input_tokens` is what the request counted against your daily input-token limit; `usage.output_tokens` is reported separately. ## Write the questions Send a JSON object with `model`, `state` (what the questions are about: a string, a JSON object, or a JSON array) and `questions`, which maps each question name to a question. Every question needs `instructions`, a string, object or array that says what to decide, and one of three types: | `type` | Answers with | For example | |---|---|---| | `noul` | The probability of yes | Triage: whether a log line, alert or failed job needs a person now | | `choice` | One of the labels you list, with a probability for each | Routing: which team, queue or handler a ticket or message belongs to | | `score` | A score from 0 on the levels you define, lowest first | Scoring: rate a proposed command, change or reply on levels your program defines | Criteria and answer fields are in [question types](/foundation/hoody-ai/decisions/reference/#question-types), limits in [size limits](/foundation/hoody-ai/decisions/reference/#size-limits). Questions that answer well: - Give each question a short, stable name; your code reads the answer by that name. - Describe every `choice` label and `score` level in plain words. The descriptions are what the model decides against. - Ask related questions about one state in a single request instead of one request per question. - Act on a threshold you choose (for example, page someone when `noul` is above 0.8) rather than on the top answer alone. ## Send images in the state To ask yes/no questions about a screenshot, such as whether a page rendered correctly, put images inside `state` as inline base64 data URLs, in the same part shape as chat vision requests: ```json { "model": "hoody-ai/hoody-decide", "state": [ { "type": "text", "text": "Screenshot of the checkout page after deploy" }, { "type": "image_url", "image_url": { "url": "data:image/png;base64," } } ], "questions": { "broken": { "type": "noul", "instructions": "Is the page visibly broken?" } } } ``` PNG, JPEG, WebP and GIF are accepted, up to 4 images per request and 1 MiB each after decoding. Remote image URLs (`https://...`) are refused: send the bytes inline. An object in `state` with a key such as `file` or `image` is read as an image part, so a plain object such as `{ "file": "app.log" }` is refused with `400 invalid_decision_request`. Rename such keys, or send the state as a string. The full rule: [image parts](/foundation/hoody-ai/decisions/reference/#image-parts). ## Limits and cost Hoody Decide is free, and rows for it in the [computer usage ledger](/foundation/hoody-ai/security/#read-a-computers-ai-usage) (`GET /usage`) name `hoody-ai/hoody-decide` and carry no cost. It has its own limits, separate from the Hoody Free chat limits. Like the other free models, they apply per server: each of your servers has its own, set by that server's plan, and all computers on one server share them. Limits of different servers never add up, and a rented machine divided into smaller servers shares one set. There are five: requests per minute, requests per day, questions per day, input tokens per day, and requests at once. Every question in a request counts toward the daily question limit. Minute limits use a rolling 60-second window and daily limits a rolling 24-hour window; nothing resets at midnight. The Free plan's limits are the base, and a higher plan raises them, by amounts set for decisions rather than by the factor of the plan's AI allowance ([Free limits by plan](/foundation/hoody-ai/models/#free-limits-by-plan)). The numbers are not listed here, because they can change. A refusal names the limit it reached: the request gets `429 decision_limit_reached` until it frees up ([the refusal body](/foundation/hoody-ai/decisions/reference/#limit-refusals)). To see how much is used, `GET /api/v1/users/me/free-ai-usage` gives a rough reading per server you own, with decisions as one of its lanes: [See how much you have used](/foundation/hoody-ai/models/#see-how-much-you-have-used). ## Handle errors and retries Check `response.ok` before reading `answers`. The status says whether to change the request or wait and retry: | Response | What to do | |---|---| | `400` or `413` | Change the request. Read `error.message` for JSON responses; a `413` may return plain text instead | | `429 decision_limit_reached`, `503 decision_capacity_exhausted`, `503 decision_routing_unavailable` | Wait for the number of seconds in `Retry-After` before retrying | | `503 free_owner_identity_missing` | Contact support if it persists | Branch on `code`, and on `limit` for a `429`; `message` is text for people. Responses, including most errors, carry an `x-hoody-request-id` header: keep it when present and quote it when you report a problem. Every code: [troubleshooting](/foundation/hoody-ai/decisions/reference/#troubleshooting). ## Advanced - **Guardrail checker for Bots:** unless `guardrail_check` is `off`, a Bot with guardrails checks outgoing tasks and delegate messages against them using its realm's checker. Choosing **Hoody safety checker** as **Checker model** in the Hub under **AI** > **Settings** > **Models & keys** > **Advanced** > **Show advanced** sets it to Hoody Decide, which needs no key. The picker appears when the safety checker is on and another checker choice is available. Without the picker, send `"model": "hoody-ai/hoody-decide"` to `PUT /api/v1/agent/jev/settings` ([checker settings](/api/agent/models/#get-apiv1agentjevsettings)). - **Decisions through the agent:** the agent in a computer asks the same `noul`, `choice` and `score` questions on `POST /api/v1/agent/jev/decide`, with a model you can set to `hoody-ai/hoody-decide`. Use it to call decisions from the SDK (`client.agent.jev.decide`) through the agent's URL, or to answer with another provider's model on that provider's key ([decision calls on the Agent Models API page](/api/agent/models/#post-apiv1agentjevdecide)). ## Reference Every field, limit and error code: the [Hoody Decide reference](/foundation/hoody-ai/decisions/reference/). ## What's Next - [Models & Pricing](/foundation/hoody-ai/models/): the model catalog and Hoody Free - [Usage Guide](/foundation/hoody-ai/usage/): calling Hoody AI from computers - [Hoody AI Security](/foundation/hoody-ai/security/): how a computer authenticates without an API key