Developer Dashboard

Claude Fable 5.2, Gemini 4 Hydrogen, and Decision 1 ​

Date: 2026-11-18 / (1405-08-27)

Summary ​

Gemini 4 Hydrogen and Gemini Decision 1 are available on AvalAI alongside Claude Fable 5.2. Hydrogen supports everyday coding, agents, and multimodal work; Decision evaluates closed-ended questions without generating text. This update brings together their current prices, endpoint choices, and complete request/response examples.

Details ​

Anthropic: Claude Fable 5.2 ​

Use claude-fable-5-2 for demanding software engineering, multi-step research, and long-running agents. Anthropic released Fable 5.2 on November 9, 2026 and reports better coding, reasoning, vision, and communication, with output generation up to 30% faster than Fable 5.1. These are provider evaluations; compare quality, latency, and total task cost on your own workload.

Anthropic specifies a 1,000,000-token context shared by input and output, a 128,000-token output ceiling, text/image input, and text output. Adaptive thinking is always on. Its upstream effort levels are low, medium, high, xhigh, and max, with high as the API default. Start with the baseline request below, then evaluate optional controls on the endpoint you use.

Keep native thinking blocks and the earlier conversation prefix intact when continuing an agent session. Anthropic rejects disabled or fixed-budget thinking and forced native tool_choice types any and tool; omit sampling controls temperature, top_p, and top_k. The provider also requires 30-day data retention unless it expressly authorizes zero retention. These upstream rules are not changed by selecting an OpenAI-compatible route or setting store: false.

Fable's existing provider section and November 11 announcement remain available. This page adds a comparison with the two Google models and updated integration examples.

Google: Gemini 4 Hydrogen ​

Use gemini-4-hydrogen for everyday coding and debugging, interactive applications, tool-using agents, and multimodal document analysis. Google's November 16 announcement positions Hydrogen as a faster execution model that can work independently or alongside Carbon and Argon in an application-managed workflow.

Google documents text, image, audio, video, and PDF input with text output. Input, thinking, and output share a 1,048,576-token context window. Ordinary synchronous output is limited to 65,536 tokens, including thinking. Google's longer decode workflows can use the remaining context through background execution or continuation; those features are not established through AvalAI by this release. Hydrogen does not generate images or audio and does not support the Live API.

Thinking levels are low, medium, high (default), and xhigh. Google recommends choosing the lowest level that meets your evaluation targets. In-range temperature, top_p, and top_k values are ignored upstream; out-of-range values return a validation error. Remove explicit cache references: Hydrogen supports implicit caching only, starting with eligible input of at least 4,096 tokens. A repeat prompt does not guarantee a cache hit through AvalAI.

See Hydrogen on AvalAI and Google's model guidance. Hosted Google Search, Maps, computer-use, and code-execution features need their own endpoint validation; Google product subscriptions and upstream discounted service tiers do not determine AvalAI prices.

Google: Gemini Decision 1 ​

Use gemini-decision-1 when your application needs a probability that a condition is true, one category from a fixed set, or a score against an ordered rubric. It supports request routing, policy checks, candidate scoring, and selecting which tool an application should use. It does not generate a conversation reply, extracted fields, a custom JSON object, or tool-call arguments.

Google's model evaluates independent questions in one prefill pass and generates zero output tokens. Its upstream context limit is 262,144 tokens across shared input and all questions, with up to 1,000 questions, 2–255 choice options, and 2–255 ordered score levels. Most rubrics should use 2–10 levels. Google documents text/image/audio/video/PDF input; the runnable AvalAI examples here use one shared text string. Optional media transport and larger requests require separate route checks.

Decision supports three distinct AvalAI interfaces, shown below. Use /v1/decisions for the standard question-array format, /v1/systemone for state with a named question map, or /v1beta/decisions for Google's native input with a named question map. Do not send this model to Chat Completions, Responses, Messages, or :generateContent.

Caching is unsupported, so repeated input across requests is billed in full. Within one request, shared evidence is billed once; each question adds its instructions, criteria, and formatting as input tokens. Set thresholds using labeled examples and keep validation, permission checks, and downstream actions in application code. Confidence is a model signal, not proof that a decision is correct.

See Decision on AvalAI, the Decisions reference, the System One reference, and the decision-model guide.

Enabled AvalAI endpoints ​

Exact AvalAI model IDEndpoints
claude-fable-5-2/v1/chat/completions, /v1/responses, /v1/messages
gemini-4-hydrogen/v1/chat/completions, /v1/responses, /v1/messages, native /v1beta/models/gemini-4-hydrogen:generateContent
gemini-decision-1/v1/decisions, /v1/systemone, /v1beta/decisions

Pricing ​

All rates are USD per 1 million tokens, from AvalAI's current pricing. Output rates for Fable and Hydrogen include billable thinking tokens.

ModelInputCached inputCache creation inputOutput
claude-fable-5-2$8.00$0.20$10.00$40.00
gemini-4-hydrogen$1.50$0.075—$7.50
gemini-decision-1$0.10Not supported—$0.00; no generated output tokens

Fable's cache-read rate is 97.5% below ordinary input; Hydrogen's eligible implicit cache hits cost 95% less. Apply each input token's appropriate category once. The Fable cache-creation rate does not promise every upstream cache lifetime. Decision's internal zero cached-input entry does not establish caching or free input. Tool charges, provider subscription allowances, and upstream Batch/Flex/Fast options are outside this token table. See current pricing.

API request and response examples ​

Read AVALAI_API_KEY from your server-side environment. Curl and OpenAI SDK examples below use one attempt with automatic retries disabled; connection and request deadlines are sample application choices. Output budgets include reasoning and can be reached before visible text is complete.

Every response below is illustrative, not a live AvalAI capture. IDs, text, probabilities, token counts, optional metadata, and costs are examples. The sample conversion rate is 100,000 Tomans/USD; use your returned usage and estimated_cost values for reconciliation. A successful HTTP status alone does not prove a complete answer.

Chat Completions: Fable or Hydrogen ​

This request uses Fable. To use Hydrogen on this endpoint, change only model to gemini-4-hydrogen. Both use messages; read final text from choices[0].message.content.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 120 --retry 0 \
  https://api.avalai.ir/v1/chat/completions \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "model": "claude-fable-5-2",
    "messages": [{"role": "user", "content": "In one sentence, explain why a migration needs a rollback plan."}],
    "max_tokens": 2048
  }'
python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AVALAI_API_KEY"],
    base_url="https://api.avalai.ir/v1",
    timeout=120.0,
    max_retries=0,
)
completion = client.chat.completions.create(
    model="claude-fable-5-2",
    messages=[
        {
            "role": "user",
            "content": "In one sentence, explain why a migration needs a rollback plan.",
        }
    ],
    max_tokens=2048,
)
print(completion.choices[0].message.content)
javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AVALAI_API_KEY,
  baseURL: "https://api.avalai.ir/v1",
  timeout: 120_000,
  maxRetries: 0,
});
const completion = await client.chat.completions.create({
  model: "claude-fable-5-2",
  messages: [{ role: "user", content: "In one sentence, explain why a migration needs a rollback plan." }],
  max_tokens: 2048,
});
console.log(completion.choices[0].message.content);
json
{
  "id": "chatcmpl-fable-example",
  "object": "chat.completion",
  "created": 1794960000,
  "model": "claude-fable-5-2",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "A rollback plan provides a tested way to restore service if a migration fails."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 100,
    "total_tokens": 120,
    "prompt_tokens_details": {
      "cached_tokens": 0
    }
  },
  "estimated_cost": {
    "unit": "0.0041600000",
    "irt": 416.0,
    "exchange_rate": 100000
  }
}

The sample Fable cost is (20 × 8 + 100 × 40) / 1,000,000 = $0.00416; Hydrogen with the same usage would cost $0.00078. Check finish_reason: length means the output budget was reached.

Responses: Hydrogen or Fable ​

This example uses Hydrogen; replace model with claude-fable-5-2 to use Fable. Responses uses input and max_output_tokens. SDKs expose response.output_text; raw JSON has typed output items. Check status, error, and incomplete_details before using the answer.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 120 --retry 0 \
  https://api.avalai.ir/v1/responses \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "model": "gemini-4-hydrogen",
    "input": "In one sentence, explain why a migration needs a rollback plan.",
    "max_output_tokens": 2048
  }'
python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AVALAI_API_KEY"],
    base_url="https://api.avalai.ir/v1",
    timeout=120.0,
    max_retries=0,
)
response = client.responses.create(
    model="gemini-4-hydrogen",
    input="In one sentence, explain why a migration needs a rollback plan.",
    max_output_tokens=2048,
)
print(response.output_text)
javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AVALAI_API_KEY,
  baseURL: "https://api.avalai.ir/v1",
  timeout: 120_000,
  maxRetries: 0,
});
const response = await client.responses.create({
  model: "gemini-4-hydrogen",
  input: "In one sentence, explain why a migration needs a rollback plan.",
  max_output_tokens: 2048,
});
console.log(response.output_text);
json
{
  "id": "resp_hydrogen_example",
  "object": "response",
  "created_at": 1794960000,
  "status": "completed",
  "error": null,
  "incomplete_details": null,
  "model": "gemini-4-hydrogen",
  "output": [
    {
      "id": "msg_hydrogen_example",
      "type": "message",
      "status": "completed",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "A rollback plan provides a tested way to restore service if a migration fails.",
          "annotations": []
        }
      ]
    }
  ],
  "usage": {
    "input_tokens": 20,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 100,
    "output_tokens_details": {
      "reasoning_tokens": 80
    },
    "total_tokens": 120
  },
  "estimated_cost": {
    "unit": "0.0007800000",
    "irt": 78.0,
    "exchange_rate": 100000
  }
}

Here the 100 output tokens include 80 reasoning tokens. (20 × 1.50 + 100 × 7.50) / 1,000,000 = $0.00078. This response does not establish Google's native background execution or continuation through AvalAI.

Native Messages: Fable or Hydrogen ​

Messages requires max_tokens and returns typed content blocks. This example uses Fable; changing the exact ID to gemini-4-hydrogen selects Hydrogen on the same owner-confirmed Messages route. Use the AvalAI host root, without /v1, when configuring an Anthropic SDK.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 120 --retry 0 \
  https://api.avalai.ir/v1/messages \
  -H "x-api-key: $AVALAI_API_KEY" \
  -H 'anthropic-version: 2023-06-01' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "model": "claude-fable-5-2",
    "max_tokens": 2048,
    "messages": [{"role": "user", "content": "In one sentence, explain why a migration needs a rollback plan."}]
  }'
json
{
  "id": "msg_fable_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-fable-5-2",
  "content": [
    {
      "type": "text",
      "text": "A rollback plan provides a tested way to restore service if a migration fails."
    }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 20,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "output_tokens": 100
  },
  "estimated_cost": {
    "unit": "0.0041600000",
    "irt": 416.0,
    "exchange_rate": 100000
  }
}

Read text blocks by type and preserve native thinking blocks when continuing Fable conversations. Check stop_reason; a refusal or exhausted budget is not a finished task. The illustrative text-only result does not promise that thinking blocks will always be absent.

Native Gemini: Hydrogen ​

Use contents and parts with :generateContent. The Google GenAI SDK expects https://api.avalai.ir with API version v1beta, rather than an OpenAI /v1 base URL. This baseline omits explicit caching and thinking overrides.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 120 --retry 0 \
  https://api.avalai.ir/v1beta/models/gemini-4-hydrogen:generateContent \
  -H "x-goog-api-key: $AVALAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "contents": [{"role": "user", "parts": [{"text": "In one sentence, explain why a migration needs a rollback plan."}]}],
    "generationConfig": {"maxOutputTokens": 2048}
  }'
json
{
  "candidates": [
    {
      "content": {
        "role": "model",
        "parts": [
          {
            "text": "A rollback plan provides a tested way to restore service if a migration fails."
          }
        ]
      },
      "finishReason": "STOP",
      "index": 0
    }
  ],
  "usageMetadata": {
    "promptTokenCount": 20,
    "candidatesTokenCount": 20,
    "thoughtsTokenCount": 80,
    "totalTokenCount": 120
  },
  "modelVersion": "gemini-4-hydrogen",
  "responseId": "hydrogen-native-example",
  "estimated_cost": {
    "unit": "0.0007800000",
    "irt": 78.0,
    "exchange_rate": 100000
  }
}

The sample bills 20 input tokens and 100 output tokens: 20 candidate tokens plus 80 thinking tokens. Inspect finishReason and prompt feedback before reading a candidate. This native generation shape is not the Decision shape below.

Standard Decisions: question array ​

Use input, an array of named questions, predicate, choices, and levels. Each question evaluates the same evidence independently. Do not substitute native criteria or the incorrect field options for choices on this endpoint.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 30 --retry 0 \
  https://api.avalai.ir/v1/decisions \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
  "model": "gemini-decision-1",
  "input": "The blue mug I ordered arrived cracked and cannot be used.",
  "questions": [
    {
      "name": "is_damaged",
      "type": "predicate",
      "instructions": "Did the item arrive damaged?"
    },
    {
      "name": "queue",
      "type": "choice",
      "instructions": "Which support queue should handle this message?",
      "choices": [
        {
          "value": "billing",
          "description": "Payments, invoices, or refunds."
        },
        {
          "value": "replacements",
          "description": "Damaged, missing, or wrong items."
        },
        {
          "value": "general",
          "description": "Other product or account questions."
        }
      ]
    },
    {
      "name": "severity",
      "type": "score",
      "instructions": "How severe is the issue for the customer?",
      "levels": [
        {
          "label": "Cosmetic",
          "description": "Appearance only; the item still works."
        },
        {
          "label": "Workaround available",
          "description": "The item is degraded but can still be used."
        },
        {
          "label": "Fully blocked",
          "description": "The item cannot be used."
        }
      ]
    }
  ]
}'
json
{
  "model": "gemini-decision-1",
  "answers": [
    {
      "type": "predicate",
      "name": "is_damaged",
      "probability": 0.99
    },
    {
      "type": "choice",
      "name": "queue",
      "choice": "replacements",
      "probabilities": [
        {
          "value": "billing",
          "probability": 0.01
        },
        {
          "value": "replacements",
          "probability": 0.98
        },
        {
          "value": "general",
          "probability": 0.01
        }
      ],
      "confidence": 0.98
    },
    {
      "type": "score",
      "name": "severity",
      "score": 1.7,
      "probabilities": [
        {
          "value": 0,
          "label": "Cosmetic",
          "probability": 0.05
        },
        {
          "value": 1,
          "label": "Workaround available",
          "probability": 0.2
        },
        {
          "value": 2,
          "label": "Fully blocked",
          "probability": 0.75
        }
      ],
      "confidence": 0.75
    }
  ],
  "usage": {
    "input_tokens": 100,
    "output_tokens": 0,
    "total_tokens": 100
  },
  "estimated_cost": {
    "unit": "0.0000100000",
    "irt": 1.0,
    "exchange_rate": 100000
  }
}

Read answers by name and type. Predicate returns probability; choice returns the selected supplied value; score returns the weighted mean of zero-based level indices. In this example 0 × 0.05 + 1 × 0.20 + 2 × 0.75 = 1.70. A score is not a percentage or a literal extracted quantity. The sample request costs 100 × 0.10 / 1,000,000 = $0.00001; the zero output rate does not make the input free.

System One: state and named questions ​

The same judgments use state and a map of question IDs. Yes/no is noul, choices use a criteria object, and scores use an ordered criteria array. This endpoint returns an answer map, not the standard Decisions array.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 30 --retry 0 \
  https://api.avalai.ir/v1/systemone \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
  "model": "gemini-decision-1",
  "state": "The blue mug I ordered arrived cracked and cannot be used.",
  "questions": {
    "is_damaged": {
      "type": "noul",
      "instructions": "Did the item arrive damaged?"
    },
    "queue": {
      "type": "choice",
      "instructions": "Which support queue should handle this message?",
      "criteria": {
        "billing": "Payments, invoices, or refunds.",
        "replacements": "Damaged, missing, or wrong items.",
        "general": "Other product or account questions."
      }
    },
    "severity": {
      "type": "score",
      "instructions": "How severe is the issue for the customer?",
      "criteria": [
        "Cosmetic: appearance only; the item still works.",
        "Workaround available: the item is degraded but can still be used.",
        "Fully blocked: the item cannot be used."
      ]
    }
  }
}'
json
{
  "model": "gemini-decision-1",
  "answers": {
    "is_damaged": {
      "type": "noul",
      "noul": 0.99,
      "confidence": 0.99
    },
    "queue": {
      "type": "choice",
      "choice": "replacements",
      "probabilities": {
        "billing": 0.01,
        "replacements": 0.98,
        "general": 0.01
      },
      "confidence": 0.98
    },
    "severity": {
      "type": "score",
      "score": 1.7,
      "legend": {
        "0": "Cosmetic: appearance only; the item still works.",
        "1": "Workaround available: the item is degraded but can still be used.",
        "2": "Fully blocked: the item cannot be used."
      },
      "probabilities": {
        "0": 0.05,
        "1": 0.2,
        "2": 0.75
      },
      "confidence": 0.75
    }
  },
  "usage": {
    "input_tokens": 100,
    "output_tokens": 0,
    "total_tokens": 100
  },
  "estimated_cost": {
    "unit": "0.0000100000",
    "irt": 1.0,
    "exchange_rate": 100000
  }
}

answers.is_damaged.noul is the probability of yes, not a generated boolean. Validate answers.queue.choice against the keys you sent. Native score legend keys are string indices. Keep probabilities and confidence as returned; missing entries are unresolved data, not zero.

Native Google Decisions: input and named questions ​

Google's native surface uses input with the same named question map. For optional Noul descriptions it uses criteria.true_description and criteria.false_description; System One uses criteria.true and criteria.false. No descriptions are needed for this unambiguous baseline. Native usage fields are total_input_tokens and total_output_tokens.

bash
curl --silent --show-error --fail-with-body \
  --connect-timeout 10 --max-time 30 --retry 0 \
  https://api.avalai.ir/v1beta/decisions \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-binary '{
  "model": "gemini-decision-1",
  "input": "The blue mug I ordered arrived cracked and cannot be used.",
  "questions": {
    "is_damaged": {
      "type": "noul",
      "instructions": "Did the item arrive damaged?"
    },
    "queue": {
      "type": "choice",
      "instructions": "Which support queue should handle this message?",
      "criteria": {
        "billing": "Payments, invoices, or refunds.",
        "replacements": "Damaged, missing, or wrong items.",
        "general": "Other product or account questions."
      }
    },
    "severity": {
      "type": "score",
      "instructions": "How severe is the issue for the customer?",
      "criteria": [
        "Cosmetic: appearance only; the item still works.",
        "Workaround available: the item is degraded but can still be used.",
        "Fully blocked: the item cannot be used."
      ]
    }
  }
}'
json
{
  "model": "gemini-decision-1",
  "answers": {
    "is_damaged": {
      "type": "noul",
      "noul": 0.99,
      "confidence": 0.99
    },
    "queue": {
      "type": "choice",
      "choice": "replacements",
      "probabilities": {
        "billing": 0.01,
        "replacements": 0.98,
        "general": 0.01
      },
      "confidence": 0.98
    },
    "severity": {
      "type": "score",
      "score": 1.7,
      "legend": {
        "0": "Cosmetic: appearance only; the item still works.",
        "1": "Workaround available: the item is degraded but can still be used.",
        "2": "Fully blocked: the item cannot be used."
      },
      "probabilities": {
        "0": 0.05,
        "1": 0.2,
        "2": 0.75
      },
      "confidence": 0.75
    }
  },
  "usage": {
    "total_input_tokens": 100,
    "input_tokens_by_modality": [
      {
        "modality": "text",
        "tokens": 100
      }
    ],
    "total_output_tokens": 0,
    "total_tokens": 100
  },
  "estimated_cost": {
    "unit": "0.0000100000",
    "irt": 1.0,
    "exchange_rate": 100000
  }
}

See the native Gemini Decisions reference for the full schema. Google GenAI SDK 3.2 or later documents client.decisions.create(...) / ai.decisions.create(...); configure the AvalAI host and API version v1beta when adapting its upstream quickstart. Native question keys use 1–64 ASCII characters matching [A-Za-z0-9_-]+. This text example does not qualify SDK execution, media forwarding, or the upstream 1,000-question ceiling through AvalAI.

Integration and debugging ​

  • Keep generation and Decision schemas separate. messages, temperature, max_tokens, tools, and stream are not additions to the native Decision baseline.
  • Noul probabilities lie between 0.01 and 0.99 upstream. Set thresholds inside that range, and treat missing, malformed, or unknown answers as unresolved. A closed choice still has a best label when none fits; include a described other option or evaluate a separate scope question.
  • A confidence value is not permission to act. Check labeled examples, validate answer IDs/types/values, and send uncertain or consequential cases for review. Dependent questions require a later request; one question cannot consume another question's answer in the same call.
  • For 400, inspect the exact request schema and selected model. Correct bad fields or unsupported controls before retrying. Native Google safety filtering may return 400 with an error object rather than answers; a safety block is not a negative predicate.
  • Resolve authentication/access errors and exhausted credit before retrying. Retry genuine temporary throttling or gateway failures only with bounded attempts and a deadline, honoring Retry-After when available. Keep downstream actions outside the retry loop.
  • Retain the endpoint, exact model ID, HTTP status, safe error body, and avalai-request-id for debugging. Use response headers, error handling, and rate limits.