# A facts document in YAML, with the reasoning in comments.
#
# The same facts as anthropic.claude-sonnet-5.5.api.json (its stem ends in
# -annotated so the two do not shadow each other by stem), written by hand in
# the other first-class encoding (spec/profile.md, "Encoding"): a
# consumer must accept either, the JSON Schema applies to both, and a descriptor
# digest covers the bytes as published, so this file is its own revision even
# where its values agree with the JSON one.
#
# Values follow the provider's published pages, which `source` names per
# section. A commented line is a judgement; `null` means documented as not
# applying here, never "unknown" - unknown is an absent key.

$schema: https://0xcopy.github.io/models-metadata/schemas/facts.v0.json
layer: provider
as_of: "2026-12-02"   # quoted: unquoted, YAML 1.1 readers turn it into a date

scope:
  provider: anthropic
  model: claude-sonnet-5.5
  api_version: "2026-10-21"

access:
  auth: [apiKey]
  headers:
    # null: the caller supplies the credential; it is never written down.
    x-api-key: null
    anthropic-version: "2026-10-21"
  source: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
  basis: published
  note: x-api-key header.

reasoning:
  param: /thinking
  display:
    param: /thinking/display
    values: [summarized, omitted]
    default: omitted
  source: https://platform.claude.com/docs/en/build-with-claude/thinking
  basis: published
  note: On Claude 5 and later models thinking is already on and needs no configuration.

replay:
  fields:
    # Required, not optional: the signed thinking blocks must go back unchanged.
    thinking: required
  source: https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks
  basis: published
  note: With tool use, pass every thinking block back complete and unmodified alongside its tool_use block.

messages:
  system_mid_conversation: supported
  source: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
  basis: published
  note: Append a system-role message instead of editing the top-level system field, so the cached prefix stays unchanged. Not available on Claude Sonnet 5.

controls:
  # All three samplers are rejected on this route, even at their default value:
  # this is a "do not send it" fact, not a "tune it" fact.
  temperature:
    support: rejected
    source: https://platform.claude.com/docs/en/api/migration-2026-10-21
    basis: published
    note: 400 even at the default value.
  top_p:
    support: rejected
    source: https://platform.claude.com/docs/en/api/migration-2026-10-21
    basis: published
    note: 400 even at the default value.
  top_k:
    support: rejected
    source: https://platform.claude.com/docs/en/api/migration-2026-10-21
    basis: published
    note: 400 even at the default value.

caching:
  implicit:
    available: false
  explicit:
    # Explicit only: nothing is cached unless the request marks a breakpoint.
    available: true
    param: /cache_control
    min_tokens: 512
    ttl: [PT5M, PT1H]
    default_ttl: PT5M
    ttl_param: /cache_control/ttl
    # A hit refreshes the lifetime, so a busy prefix never expires mid-use.
    ttl_is: sliding
    refresh_on_hit: true
    targets: [tools, system, messages]
    max_breakpoints: 4
  usage:
    read: /usage/cache_read_input_tokens
    write: /usage/cache_creation_input_tokens
  source: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
  basis: published
  note: Automatic caching is one top-level cache_control field; min_tokens is for the Claude API, AWS, Google Cloud and Foundry.

pricing:
  billing: metered
  currency: USD
  tokens:
    per: 1000000
    input: 2
    output: 10
    # A cache read is a twentieth of input; a write costs more than input.
    cache_read: 0.1
    cache_write:
      PT5M: 2.5
      PT1H: 4
  source: https://platform.claude.com/docs/en/build-with-claude/prompt-caching
  basis: published
  note: Cache hits and refreshes are 0.05x base input on this model.

rate_limits:
  # Cache reads do not count against the input-tokens-per-minute budget.
  counts_cache_reads: false
  headers:
    - anthropic-ratelimit-requests-remaining
    - anthropic-ratelimit-input-tokens-remaining
    - anthropic-ratelimit-output-tokens-remaining
    - retry-after
  source: https://platform.claude.com/docs/en/api/rate-limits
  basis: published
