Gemini - API - AI Agents - Automation
6 min lectura

Gemini Decisions API: route tasks with probabilities instead of generated text

Google's Gemini Decision 1 returns probabilities for bounded choices. Use the copyable support-routing example, pricing, limits, and a human-review escape.

Gemini Decisions API: route tasks with probabilities instead of generated text

Your app receives “I was charged twice.” A generative model could write a long explanation, but your workflow only needs to choose billing, technical support, or human review. Parsing that choice out of prose introduces format failures and latency. On November 11, 2026, Google introduced the Gemini Decisions API for closed-set questions: it returns options and probabilities without generating output text. For builders, the practical change is a classifier you can place inside a workflow without asking a model to narrate the action.

What is available

The model ID is gemini-decision-1, accessed through the Decisions API in Google AI Studio using an SDK or REST. It accepts shared input across text, images, audio, video, and PDFs. A request can evaluate up to 1,000 independent questions, subject to a combined 262,144-token context window. The three question types are noul for yes/no, choice for fixed options, and score for an ordered rubric. noul really is the API's type name; replacing it with boolean would not match the documented schema.

Each question returns an answer and estimated confidence. You can route an easy ticket and send ambiguous ones to a person. That is not a correctness guarantee: a high probability can still be wrong on data unlike your test set. Google reports 150–250 ms end-to-end latency and a cost comparison with Gemini 3.5 Flash-Lite in its benchmarks. Those are vendor measurements, not SoyJB test results or promises for your infrastructure.

Copyable example: route a support message

This script submits a fictional message and four possible destinations. If the choice is other or confidence is below 0.80, it returns human_review. The 0.80 cutoff is an illustrative starting point, not a threshold validated for your business. Install google-genai version 3.2 or later and set GEMINI_API_KEY before making a real API call.

"""Small support-ticket routing example for the Gemini Decisions API.

Requires google-genai >= 3.2 and a GEMINI_API_KEY to make a real API call.
"""

import os


def choose_route(choice: str, confidence: float, threshold: float = 0.80) -> str:
    """Keep uncertain or out-of-scope cases with a human reviewer."""
    if choice == "other" or confidence < threshold:
        return "human_review"
    return choice


def main() -> None:
    from google import genai

    client = genai.Client(
        api_key=os.environ["GEMINI_API_KEY"],
        http_options={"api_version": "v1beta"},
    )
    result = client.decisions.create(
        model="gemini-decision-1",
        input="My invoice was charged twice for last month's plan.",
        questions={
            "route": {
                "type": "choice",
                "instructions": "Which team should review this customer message?",
                "criteria": {
                    "billing": "Payments, invoices, refunds, and subscriptions.",
                    "bug": "A product feature is broken or fails unexpectedly.",
                    "feature": "A request for a new product capability.",
                    "other": "Anything that does not clearly fit the other categories.",
                },
            }
        },
    )
    answer = result.answers["route"]
    print(
        {
            "route": choose_route(answer.choice, answer.confidence),
            "confidence": answer.confidence,
        }
    )


if __name__ == "__main__":
    main()

We checked the file's syntax locally and tested three cases for choose_route: 0.80 accepts a route, while 0.79 and other require human review. We did not call Gemini because that requires an API key; we therefore cannot claim the model classified this example or measured its latency. You can copy the script and replace the sample with an authorized case from your application.

Bounded decision flow: message, API probabilities, then route or human review
The API proposes probabilities; your code applies the policy and keeps uncertain cases with a person.

Decide whether it fits your product

  1. Choose a closed decision. Routing among billing, bug, feature request, and other fits. Writing an empathetic reply does not; this API does not generate that text.
  2. Collect labeled examples. Take a small set of real, anonymized messages and manually assign the right route. Include edge cases, such as a billing complaint that also describes a bug. Measure category-specific mistakes before automating.
  3. Provide an escape. Add other and a confidence threshold. Google's documentation notes that choice distributes probability across your options even when none really fits. Without an escape, the wrong option can still win.
  4. Compare with your current process. Record time to the correct team, reassignment errors, and actual input-token cost. Fast output in a demo is not enough.
  5. Keep human control over consequential actions. Denials, refunds, and account changes need extra rules and approval where appropriate. A classifier can suggest a queue; it should not impose irreversible outcomes on its own.

Google lists a no-cost tier for prototypes and US$0.10 per million input tokens on the paid tier, with no output-token charges. Shared input is billed once per request, but each question adds its own instructions and criteria. The pricing page says free-tier content may be used to improve products, while paid-tier content is not; check terms and permissions before sending real personal data to a prototype. The official SDK example uses v1beta.

Limits before scaling

Questions in a single request are independent and cannot see each other's answers. If one decision depends on another, combine them in your own code or make a second call. Check project and regional limits in AI Studio. Some inputs may receive a safety error rather than answers. Low token prices also say nothing about accuracy for your tickets, language, or industry. The useful measure is whether classification plus review costs less than your current process without increasing meaningful errors.

Another access path: Vercel also announced on November 11 that google/gemini-decision-1 is available on AI Gateway. Vercel's AI SDK 7 supports PDF, audio, and video inputs; its TypeSafe-compatible and Decisions interfaces support text and images. This guide uses Google's direct SDK and its noul type. Do not copy that type into Vercel's boolean interface without checking its schema. Gateway calls appear in logs and budgets.

Primary sources, checked November 11, 2026: Google's announcement, Decisions API guide, and official pricing. Third-party integrations are rolling out; the example uses Google's SDK.

Comentarios

Aún no hay comentarios. Sé el primero.

Deja un comentario