> ## Documentation Index
> Fetch the complete documentation index at: https://mixroute.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Decisions API

> Google Decisions through MixRoute: named noul, choice and score questions, typed probability maps, multimodal input structure and error handling.

Evaluate shared input with Gemini Decision 1 and receive a typed answer for each named question. This page describes Google's Decisions protocol, which differs from OpenAI Decisions and Jev System One.

`POST https://api.mixroute.ai/v1beta/decisions`

Send Authorization: Bearer \$MIXROUTE\_API\_KEY and Content-Type: application/json. Use your MixRoute key and keep it server-side; do not send it to Google's API host.

> [!WARNING]
>
> Google uses a questions object keyed by question ID and an answers object with matching keys. Use noul for yes/no and criteria for options or levels. Do not copy OpenAI's questions array, predicate, choices or levels fields, or Jev's state field.

## Request parameters

| Field | Description |
| - | - |
| `model` | Required. Use gemini-decision-1. |
| `input` | Required shared evidence: a nonempty string, one content block, or an array of content blocks. |
| `questions` | Required map of 1-1,000 questions. Keys are 1-64 ASCII characters matching `[A-Za-z0-9_-]+`. Answers use the same keys. |

| Field | Description |
| - | - |
| `questions.<id>.type` | Required: `noul` / `choice` / `score` |
| `questions.<id>.instructions` | Required full question or rubric, as a string, text block or array of text blocks. Instructions accept text only. The model does not see the question IDs. |
| `questions.<id>.criteria` | `noul`: Optional object with `true_description` and/or `false_description` strings. Omit it when the instructions define the outcomes clearly. |
| `questions.<id>.criteria` | `choice`: Required map of 2-255 option IDs to description strings. An empty description is allowed. Option IDs must be nonempty; leading/trailing spaces and control characters are not allowed. |
| `questions.<id>.criteria` | `score`: Required ordered array of 2-255 nonempty level descriptions. Level values are their zero-based array indexes, not arbitrary numeric labels. |

Each question is evaluated independently against the shared input and cannot see another answer. Put the complete question in instructions, then combine answers in application code.

Option IDs: 1-128 characters and at most 512 UTF-8 bytes. Internal ASCII spaces are allowed; non-ASCII whitespace is not.

## Request examples

Set MIXROUTE\_API\_KEY. The Python example uses requests; the JavaScript example uses Node.js fetch.

> [tab] cURL
>
> ```bash theme={null}
> curl --request POST "https://api.mixroute.ai/v1beta/decisions" \
>   --header "Authorization: Bearer $MIXROUTE_API_KEY" \
>   --header "Content-Type: application/json" \
>   --data '{
>   "model": "gemini-decision-1",
>   "input": "CSV export fails on every attempt. The customer needs the file today and asks for a human agent.",
>   "questions": {
>     "team": {
>       "type": "choice",
>       "instructions": "Which team should handle this ticket?",
>       "criteria": {
>         "engineering": "Software defects",
>         "billing": "Payments and refunds"
>       }
>     },
>     "urgency": {
>       "type": "score",
>       "instructions": "How soon does the customer need help?",
>       "criteria": [
>         "No deadline is specified.",
>         "Help is needed within a week.",
>         "Help is explicitly required today."
>       ]
>     },
>     "needs_human": {
>       "type": "noul",
>       "instructions": "Does the customer request a human agent?"
>     }
>   }
> }'
> ```

> [tab] Python
>
> ```python theme={null}
> import json
> import os
> import requests
>
> payload = json.loads(r'''{
>   "model": "gemini-decision-1",
>   "input": "CSV export fails on every attempt. The customer needs the file today and asks for a human agent.",
>   "questions": {
>     "team": {
>       "type": "choice",
>       "instructions": "Which team should handle this ticket?",
>       "criteria": {
>         "engineering": "Software defects",
>         "billing": "Payments and refunds"
>       }
>     },
>     "urgency": {
>       "type": "score",
>       "instructions": "How soon does the customer need help?",
>       "criteria": [
>         "No deadline is specified.",
>         "Help is needed within a week.",
>         "Help is explicitly required today."
>       ]
>     },
>     "needs_human": {
>       "type": "noul",
>       "instructions": "Does the customer request a human agent?"
>     }
>   }
> }''')
> response = requests.post(
>     "https://api.mixroute.ai/v1beta/decisions",
>     headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
>     json=payload,
>     timeout=60,
>     allow_redirects=False,
> )
> response.raise_for_status()
> result = response.json()
> if "error" in result:
>     raise RuntimeError(result["error"])
> answers = result.get("answers")
> if not isinstance(answers, dict):
>     raise ValueError("Expected an answers object")
> fields = {"noul": "noul", "choice": "choice", "score": "score"}
> for name, question in payload["questions"].items():
>     answer = answers.get(name)
>     if not isinstance(answer, dict) or answer.get("type") != question["type"]:
>         raise ValueError("Missing or unexpected answer type: " + name)
>     print(name, answer[fields[question["type"]]], answer["confidence"])
> print(result.get("usage", {}))
> ```

> [tab] JavaScript
>
> ```javascript theme={null}
> const apiKey = process.env.MIXROUTE_API_KEY;
> if (!apiKey) throw new Error("Set MIXROUTE_API_KEY");
> const payload = {
>   "model": "gemini-decision-1",
>   "input": "CSV export fails on every attempt. The customer needs the file today and asks for a human agent.",
>   "questions": {
>     "team": {
>       "type": "choice",
>       "instructions": "Which team should handle this ticket?",
>       "criteria": {
>         "engineering": "Software defects",
>         "billing": "Payments and refunds"
>       }
>     },
>     "urgency": {
>       "type": "score",
>       "instructions": "How soon does the customer need help?",
>       "criteria": [
>         "No deadline is specified.",
>         "Help is needed within a week.",
>         "Help is explicitly required today."
>       ]
>     },
>     "needs_human": {
>       "type": "noul",
>       "instructions": "Does the customer request a human agent?"
>     }
>   }
> };
> const response = await fetch("https://api.mixroute.ai/v1beta/decisions", {
>   method: "POST",
>   headers: {Authorization: "Bearer " + apiKey, "Content-Type": "application/json"},
>   body: JSON.stringify(payload),
>   redirect: "error",
>   signal: AbortSignal.timeout(60000),
> });
> const result = await response.json();
> if (!response.ok || result.error) {
>   throw new Error("HTTP " + response.status + ": " + JSON.stringify(result.error ?? result));
> }
> if (!result.answers || Array.isArray(result.answers) || typeof result.answers !== "object") {
>   throw new Error("Expected an answers object");
> }
> const fields = {noul: "noul", choice: "choice", score: "score"};
> for (const [name, question] of Object.entries(payload.questions)) {
>   const answer = result.answers[name];
>   if (!answer || answer.type !== question.type) {
>     throw new Error("Missing or unexpected answer type: " + name);
>   }
>   console.log(name, answer[fields[question.type]], answer.confidence);
> }
> console.log(result.usage ?? {});
> ```

## Answers and usage

| Field | Description |
| - | - |
| `noul` | noul is P(true), between 0.01 and 0.99, not a boolean. confidence is max(noul, 1 - noul). |
| `choice` | choice is the winning option ID; probabilities maps each option ID to its probability. confidence is the winning probability. Equal probabilities are resolved by UTF-8 alphabetical option-key order. |
| `score` | score is the probability-weighted average of the level indexes and can be fractional. probabilities maps string indexes to probabilities; legend maps those indexes to their descriptions. confidence is the largest level probability, not the normalized score. |

Probabilities are not guarantees of correctness. Calibrate action thresholds on representative labeled data, and allow review when confidence is low or none of the supplied choices fits.

```json theme={null}
{
  "answers": {
    "team": {
      "confidence": 0.9980277470061801,
      "choice": "engineering",
      "probabilities": {
        "billing": 0.0019722529938198032,
        "engineering": 0.9980277470061801
      },
      "type": "choice"
    },
    "urgency": {
      "confidence": 0.9833902224118356,
      "score": 1.9825588708050947,
      "probabilities": {
        "0": 0.0008313516067408738,
        "1": 0.015778425981423486,
        "2": 0.9833902224118356
      },
      "legend": {
        "0": "No deadline is specified.",
        "1": "Help is needed within a week.",
        "2": "Help is explicitly required today."
      },
      "type": "score"
    },
    "needs_human": {
      "confidence": 0.99,
      "noul": 0.99,
      "type": "noul"
    }
  },
  "usage": {
    "total_tokens": 230,
    "total_input_tokens": 230,
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 230
      }
    ],
    "total_output_tokens": 0
  }
}
```

Zero output tokens are expected: this model returns typed decisions without generating text tokens. Input is still billed. Read `usage.total_input_tokens`, `usage.total_output_tokens` and `usage.total_tokens`; use the console usage records for actual charges.

## Limits and input formats

Shared input and all questions together must fit within 262,144 tokens. JSON nesting is limited to 100 levels.

Text blocks use `{"type":"text","text":"..."}`. Image, audio, video and PDF document blocks use type, `mime_type` and either inline Base64 data or uri. Serialize application JSON as a text string; do not send an arbitrary application object as a content block.

Google documents an inline limit of 100 MB per request (50 MB for PDFs) and 15 MB per external HTTPS URL. Files API URIs, public URLs and signed HTTPS URLs are provider formats; upload access and media retrieval through MixRoute depend on the route. YouTube URLs and direct gs\:// URIs are not supported by Decisions.

Adjacent text blocks are concatenated without a separator, so include spaces or newlines. Do not send conversation-message, thought or tool-call blocks; serialize that context as text. Context caching, Batch API, Flex and Priority inference are not part of this API. Route-specific limits may be lower than the provider limits.

## Error handling

Check HTTP status and the JSON error object before reading answers. Invalid fields or limits can return HTTP 400. Google safety blocks return an error instead of answers; do not reuse OpenAI's per-question refusal handling. Also reject missing answers or unexpected answer types.

A timeout does not prove the request was not executed. Avoid blind POST retries. For rate limits or temporary service errors, retain the request ID and use controlled retry/backoff appropriate to your application.

## Related protocols

[Gemini Decision 1](https://mixroute.ai/docs/model-api/google/gemini-decision-1.md) · [OpenAI Decisions](https://mixroute.ai/docs/api-reference/endpoint/decisions.md) · [Jev System One](https://mixroute.ai/docs/api-reference/endpoint/jev.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.