{
  "model": {
    "$defs": {
      "Currency": {
        "enum": [
          "USD"
        ],
        "type": "string"
      },
      "Date": {
        "format": "date",
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
        "type": "string"
      },
      "Decimal": {
        "description": "Exact non-negative decimal in USD per unit, written as a string (never a float).",
        "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
        "type": "string"
      },
      "Limits": {
        "additionalProperties": false,
        "description": "Token limits. Unknown limits are omitted, never zero.",
        "properties": {
          "context": {
            "description": "Context window (input + output) in tokens.",
            "format": "uint64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "input": {
            "description": "Maximum input tokens, when smaller than the context window.",
            "format": "uint64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "output": {
            "description": "Maximum output tokens per request.",
            "format": "uint64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Meter": {
        "description": "What a price line charges for.",
        "oneOf": [
          {
            "const": "input_tokens",
            "description": "Uncached input tokens, USD per 1M tokens.",
            "type": "string"
          },
          {
            "const": "output_tokens",
            "description": "Output tokens (including reasoning tokens), USD per 1M tokens.",
            "type": "string"
          },
          {
            "const": "cache_read_tokens",
            "description": "Cache read (hit/refresh) input tokens, USD per 1M tokens.",
            "type": "string"
          },
          {
            "const": "cache_write_tokens",
            "description": "Cache write tokens with the provider's default TTL, USD per 1M tokens.",
            "type": "string"
          },
          {
            "const": "cache_write_5m_tokens",
            "description": "Cache write tokens with a 5-minute TTL, USD per 1M tokens.",
            "type": "string"
          },
          {
            "const": "cache_write_1h_tokens",
            "description": "Cache write tokens with a 1-hour TTL, USD per 1M tokens.",
            "type": "string"
          },
          {
            "const": "input_characters",
            "description": "Input characters (for example text to speech), USD per 1M characters.",
            "type": "string"
          },
          {
            "const": "output_images",
            "description": "Generated images, USD per image.",
            "type": "string"
          },
          {
            "const": "input_audio_seconds",
            "description": "Input audio duration, USD per second.",
            "type": "string"
          },
          {
            "const": "output_audio_seconds",
            "description": "Output audio duration, USD per second.",
            "type": "string"
          },
          {
            "const": "search_units",
            "description": "Search/tool units (for example web searches), USD per unit.",
            "type": "string"
          },
          {
            "const": "requests",
            "description": "Flat per-request charge, USD per request.",
            "type": "string"
          }
        ]
      },
      "Modalities": {
        "additionalProperties": false,
        "properties": {
          "input": {
            "items": {
              "$ref": "#/$defs/Modality"
            },
            "type": "array"
          },
          "output": {
            "items": {
              "$ref": "#/$defs/Modality"
            },
            "type": "array"
          }
        },
        "required": [
          "input",
          "output"
        ],
        "type": "object"
      },
      "Modality": {
        "enum": [
          "text",
          "image",
          "audio",
          "video",
          "pdf",
          "embedding"
        ],
        "type": "string"
      },
      "Offering": {
        "additionalProperties": false,
        "description": "One way to call the model: a provider and the id that provider expects.",
        "properties": {
          "aliases": {
            "description": "Other ids that reach the same deployment at the same price.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "label": {
            "description": "Short qualifier shown next to the provider, e.g. \"US cross-Region\".",
            "type": [
              "string",
              "null"
            ]
          },
          "limits": {
            "anyOf": [
              {
                "$ref": "#/$defs/Limits"
              },
              {
                "type": "null"
              }
            ],
            "description": "Per-offering limits when they differ from the model's."
          },
          "prices": {
            "default": [],
            "description": "Append-only price history, oldest first. Empty means \"price unknown\".",
            "items": {
              "$ref": "#/$defs/PriceEntry"
            },
            "type": "array"
          },
          "provider": {
            "description": "Provider id.",
            "type": "string"
          },
          "sync": {
            "$ref": "#/$defs/OfferingSync",
            "description": "Source keys for `omg-models sync` when they differ from `upstream_id`."
          },
          "upstream_id": {
            "description": "The model id on that provider's wire API (Bedrock profile ids keep\ntheir `global.`/`us.` prefix: the prefix changes the price).",
            "type": "string"
          }
        },
        "required": [
          "provider",
          "upstream_id"
        ],
        "type": "object"
      },
      "OfferingSync": {
        "additionalProperties": false,
        "description": "Overrides for how sync finds this offering in each source.",
        "properties": {
          "disabled": {
            "description": "Exclude this offering from price sync.",
            "type": "boolean"
          },
          "genai_prices": {
            "description": "genai-prices model id to match (default: `upstream_id`).",
            "type": [
              "string",
              "null"
            ]
          },
          "litellm": {
            "description": "LiteLLM key (default: `upstream_id`).",
            "type": [
              "string",
              "null"
            ]
          },
          "models_dev": {
            "description": "models.dev model key within the provider's `models_dev_provider`.",
            "type": [
              "string",
              "null"
            ]
          },
          "openrouter": {
            "description": "OpenRouter model id (default: `upstream_id`).",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "PartialDate": {
        "pattern": "^[0-9]{4}-[0-9]{2}(-[0-9]{2})?$",
        "type": "string"
      },
      "PriceEntry": {
        "additionalProperties": false,
        "description": "One price, effective from a date until the next entry. Never edited after\npublication: a change is a new entry with a later `effective_from`.",
        "properties": {
          "batch": {
            "additionalProperties": {
              "$ref": "#/$defs/Decimal"
            },
            "description": "Batch API rates, when the provider publishes them. Never derived.",
            "type": [
              "object",
              "null"
            ]
          },
          "batch_tiers": {
            "items": {
              "$ref": "#/$defs/Tier"
            },
            "type": "array"
          },
          "currency": {
            "$ref": "#/$defs/Currency"
          },
          "effective_from": {
            "$ref": "#/$defs/Date"
          },
          "not_applicable": {
            "description": "Meters that cannot apply to this offering (different from unknown).",
            "items": {
              "$ref": "#/$defs/Meter"
            },
            "type": "array"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "$ref": "#/$defs/Provenance"
          },
          "standard": {
            "additionalProperties": {
              "$ref": "#/$defs/Decimal"
            },
            "description": "Interactive (standard) rates.",
            "type": "object"
          },
          "standard_tiers": {
            "description": "Prompt-size tiers for the standard rates, ascending.",
            "items": {
              "$ref": "#/$defs/Tier"
            },
            "type": "array"
          }
        },
        "required": [
          "effective_from",
          "currency",
          "standard",
          "source"
        ],
        "type": "object"
      },
      "Provenance": {
        "additionalProperties": false,
        "description": "Where a price came from.",
        "properties": {
          "carried_over": {
            "description": "Meters copied unchanged from the previous entry because this source\ndoes not list them.",
            "items": {
              "$ref": "#/$defs/Meter"
            },
            "type": "array"
          },
          "cites": {
            "description": "The provider pricing page the source itself cites, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "entry_key": {
            "description": "The entry key inside the source document.",
            "type": [
              "string",
              "null"
            ]
          },
          "fetched_at": {
            "$ref": "#/$defs/Timestamp",
            "description": "When it was fetched (UTC)."
          },
          "kind": {
            "$ref": "#/$defs/SourceKind"
          },
          "sha256": {
            "description": "SHA-256 of the fetched document (lowercase hex).",
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "description": "The page or file the values were read from (https).",
            "type": "string"
          },
          "version": {
            "description": "Source version: git commit, ETag or publication date.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "kind",
          "url",
          "fetched_at"
        ],
        "type": "object"
      },
      "SourceKind": {
        "oneOf": [
          {
            "const": "manual",
            "description": "Entered by a maintainer (explain in `notes`).",
            "type": "string"
          },
          {
            "const": "provider-page",
            "description": "The provider's own pricing or model page.",
            "type": "string"
          },
          {
            "const": "provider-price-list",
            "description": "A provider's machine-readable price list (e.g. AWS offer files).",
            "type": "string"
          },
          {
            "const": "litellm",
            "description": "BerriAI/litellm `model_prices_and_context_window.json` (MIT).",
            "type": "string"
          },
          {
            "const": "genai-prices",
            "description": "pydantic/genai-prices v2 data (MIT).",
            "type": "string"
          },
          {
            "const": "openrouter",
            "description": "OpenRouter's public models API.",
            "type": "string"
          },
          {
            "const": "models.dev",
            "description": "models.dev `api.json` (MIT).",
            "type": "string"
          }
        ]
      },
      "Status": {
        "enum": [
          "active",
          "deprecated",
          "retired"
        ],
        "type": "string"
      },
      "Tier": {
        "additionalProperties": false,
        "description": "Rates that replace the base rates for the whole request when the prompt\n(all input tokens, including cache reads and writes) is **strictly\ngreater** than `above_prompt_tokens`. The highest exceeded tier wins.",
        "properties": {
          "above_prompt_tokens": {
            "format": "uint64",
            "minimum": 0,
            "type": "integer"
          },
          "rates": {
            "additionalProperties": {
              "$ref": "#/$defs/Decimal"
            },
            "type": "object"
          }
        },
        "required": [
          "above_prompt_tokens",
          "rates"
        ],
        "type": "object"
      },
      "Timestamp": {
        "format": "date-time",
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
        "type": "string"
      }
    },
    "$id": "https://models.omg.bitop.dev/schema/model.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "description": "`providers/<home>/models/<id>.toml`.",
    "properties": {
      "deprecation_date": {
        "anyOf": [
          {
            "$ref": "#/$defs/Date"
          },
          {
            "type": "null"
          }
        ]
      },
      "description": {
        "type": [
          "string",
          "null"
        ]
      },
      "docs": {
        "description": "Model documentation (https).",
        "type": [
          "string",
          "null"
        ]
      },
      "family": {
        "description": "Model family, e.g. \"claude-sonnet\".",
        "type": [
          "string",
          "null"
        ]
      },
      "id": {
        "description": "Catalog model id; must equal the file name. Unique across the catalog.",
        "type": "string"
      },
      "knowledge_cutoff": {
        "anyOf": [
          {
            "$ref": "#/$defs/PartialDate"
          },
          {
            "type": "null"
          }
        ],
        "description": "Knowledge cutoff, `YYYY-MM` or `YYYY-MM-DD`."
      },
      "license": {
        "description": "Weights licence (SPDX id or name), for open-weights models.",
        "type": [
          "string",
          "null"
        ]
      },
      "limits": {
        "$ref": "#/$defs/Limits",
        "default": {}
      },
      "modalities": {
        "$ref": "#/$defs/Modalities"
      },
      "name": {
        "description": "Display name, e.g. \"Claude Sonnet 5.5\".",
        "type": "string"
      },
      "offerings": {
        "default": [],
        "description": "Where the model is served. The home provider (the directory) must be one.",
        "items": {
          "$ref": "#/$defs/Offering"
        },
        "type": "array"
      },
      "open_weights": {
        "description": "Whether the trained weights are publicly downloadable.",
        "type": "boolean"
      },
      "reasoning": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "release_date": {
        "anyOf": [
          {
            "$ref": "#/$defs/Date"
          },
          {
            "type": "null"
          }
        ],
        "description": "First public release."
      },
      "retirement_date": {
        "anyOf": [
          {
            "$ref": "#/$defs/Date"
          },
          {
            "type": "null"
          }
        ]
      },
      "status": {
        "$ref": "#/$defs/Status",
        "default": "active",
        "description": "Lifecycle status."
      },
      "tool_call": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "vendor": {
        "description": "Who made the model (lab/vendor), e.g. \"Anthropic\".",
        "type": "string"
      }
    },
    "required": [
      "id",
      "name",
      "vendor",
      "open_weights",
      "modalities"
    ],
    "title": "ModelFile",
    "type": "object"
  },
  "provider": {
    "$defs": {
      "ApiStyle": {
        "oneOf": [
          {
            "const": "openai-chat",
            "description": "OpenAI Chat Completions compatible (`POST {api_base}/chat/completions`).",
            "type": "string"
          },
          {
            "const": "openai-responses",
            "description": "OpenAI Responses API (`POST {api_base}/responses`).",
            "type": "string"
          },
          {
            "const": "anthropic-messages",
            "description": "Anthropic Messages API (`POST {api_base}/messages`).",
            "type": "string"
          },
          {
            "const": "bedrock-converse",
            "description": "Amazon Bedrock Converse API (SigV4).",
            "type": "string"
          }
        ]
      },
      "PriceSourceKind": {
        "oneOf": [
          {
            "const": "none",
            "description": "Not synced; prices are maintained by hand.",
            "type": "string"
          },
          {
            "const": "litellm",
            "description": "BerriAI/litellm `model_prices_and_context_window.json`.",
            "type": "string"
          },
          {
            "const": "openrouter",
            "description": "OpenRouter `GET /api/v1/models` (and `:batch` ids).",
            "type": "string"
          }
        ]
      },
      "ProviderKind": {
        "oneOf": [
          {
            "const": "cloud",
            "description": "A first-party model API or a cloud platform (OpenAI, Anthropic, Bedrock).",
            "type": "string"
          },
          {
            "const": "aggregator",
            "description": "A router/reseller in front of other providers (OpenRouter).",
            "type": "string"
          },
          {
            "const": "self-hosted",
            "description": "Software you run yourself (vLLM, Ollama); usually no public price.",
            "type": "string"
          }
        ]
      },
      "ProviderSync": {
        "additionalProperties": false,
        "description": "Provider-level sync settings.",
        "properties": {
          "genai_prices_provider": {
            "description": "pydantic genai-prices provider id for cross-checks (`anthropic`, `aws`, ...).",
            "type": [
              "string",
              "null"
            ]
          },
          "litellm_providers": {
            "description": "Accepted LiteLLM `litellm_provider` values (for `prices = \"litellm\"`).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "models_dev_provider": {
            "description": "models.dev provider id for metadata (`anthropic`, `amazon-bedrock`, ...).",
            "type": [
              "string",
              "null"
            ]
          },
          "prices": {
            "$ref": "#/$defs/PriceSourceKind",
            "default": "none",
            "description": "The primary price source for this provider's offerings."
          }
        },
        "type": "object"
      }
    },
    "$id": "https://models.omg.bitop.dev/schema/provider.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "description": "`providers/<id>/provider.toml`.",
    "properties": {
      "api_base": {
        "description": "API base URL (https; http allowed only for self-hosted providers).",
        "type": [
          "string",
          "null"
        ]
      },
      "api_style": {
        "$ref": "#/$defs/ApiStyle",
        "default": "openai-chat",
        "description": "Which wire protocol the API examples use."
      },
      "auth": {
        "description": "How clients authenticate (plain text, no secrets).",
        "type": [
          "string",
          "null"
        ]
      },
      "docs": {
        "description": "API documentation (https).",
        "type": [
          "string",
          "null"
        ]
      },
      "env": {
        "description": "Environment variables conventionally holding credentials.",
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "id": {
        "description": "Provider id; must equal the directory name. `[a-z0-9][a-z0-9-]*`.",
        "type": "string"
      },
      "name": {
        "description": "Display name, e.g. \"Amazon Bedrock\".",
        "type": "string"
      },
      "pricing_page": {
        "description": "The provider's official pricing page (https), for verification.",
        "type": [
          "string",
          "null"
        ]
      },
      "sync": {
        "$ref": "#/$defs/ProviderSync",
        "default": {
          "prices": "none"
        },
        "description": "How `omg-models sync` tracks this provider."
      },
      "type": {
        "$ref": "#/$defs/ProviderKind",
        "description": "What kind of provider this is."
      },
      "website": {
        "description": "Public website (https).",
        "type": "string"
      }
    },
    "required": [
      "id",
      "name",
      "type",
      "website"
    ],
    "title": "ProviderFile",
    "type": "object"
  }
}
