{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nativeport-ai/json-schema/nativeport-ai-inference-model-schema.json",
  "title": "InferenceModel",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nativeport-ai-openapi.yml#/components/schemas/InferenceModel",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The canonical model id (same form accepted in a chat request's `model` field)."
    },
    "object": {
      "type": "string",
      "enum": [
        "model"
      ]
    },
    "created": {
      "type": "integer"
    },
    "owned_by": {
      "type": "string",
      "description": "For a Hugging Face entry, the underlying HF repo's owner segment — not necessarily the same string as `provider`."
    },
    "provider": {
      "$ref": "#/$defs/InferenceModelProvider"
    },
    "capabilities": {
      "$ref": "#/$defs/InferenceModelCapabilities"
    },
    "supported_parameters": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The optional `InferenceChatRequest` fields this gateway accepts — uniform across every listed model, since the common set is provider-agnostic by construction."
    },
    "pricing": {
      "$ref": "#/$defs/InferenceModelPricing"
    }
  },
  "$defs": {
    "InferenceModelCapabilities": {
      "type": "object",
      "properties": {
        "streaming": {
          "type": "boolean"
        },
        "tools": {
          "type": "boolean"
        },
        "tool_choice": {
          "type": "boolean"
        },
        "vision": {
          "type": "boolean",
          "description": "Whether this specific model is known to accept `image_url` content parts — truthful per model, not a blanket value across the catalog."
        }
      },
      "title": "InferenceModelCapabilities"
    },
    "InferenceModelPricing": {
      "type": "object",
      "properties": {
        "currency": {
          "type": "string",
          "enum": [
            "usd"
          ]
        },
        "input_per_million": {
          "type": "number",
          "format": "double"
        },
        "output_per_million": {
          "type": "number",
          "format": "double"
        },
        "cached_input_per_million": {
          "type": "number",
          "format": "double",
          "description": "OpenAI's cached-input discount rate, or Anthropic's cache-READ rate. Absent where the provider has no cache-read discount (xAI, Hugging Face)."
        },
        "cache_write_5m_per_million": {
          "type": "number",
          "format": "double",
          "description": "Anthropic only — writing a 5-minute ephemeral cache breakpoint."
        },
        "cache_write_1h_per_million": {
          "type": "number",
          "format": "double",
          "description": "Anthropic only — writing a 1-hour ephemeral cache breakpoint."
        },
        "cache_write_per_million": {
          "type": "number",
          "format": "double",
          "description": "OpenAI `gpt-5.6` family only — rate for the `cache_write_tokens` category OpenAI reports in `usage.input_tokens_details` (Responses API) or `usage.prompt_tokens_details` (Chat Completions API). A mutually exclusive input token category, never additive with `input_per_million` or `cached_input_per_million`."
        },
        "long_context": {
          "$ref": "#/$defs/InferenceModelPricingLongContext",
          "description": "OpenAI `gpt-5.6` family only — present when the model has a distinct rate tier for requests whose input token count exceeds `threshold_input_tokens`. Absent for every other provider and model."
        }
      },
      "description": "Clean per-1M-token USD rates with the gateway's 5.5% fee included, sourced from the same price tables each native provider route bills from.",
      "title": "InferenceModelPricing"
    },
    "InferenceModelPricingLongContext": {
      "type": "object",
      "properties": {
        "threshold_input_tokens": {
          "type": "integer",
          "description": "Input token count above which these long-context rates replace the top-level (short-context) rates."
        },
        "input_per_million": {
          "type": "number",
          "format": "double"
        },
        "cached_input_per_million": {
          "type": "number",
          "format": "double"
        },
        "cache_write_per_million": {
          "type": "number",
          "format": "double"
        },
        "output_per_million": {
          "type": "number",
          "format": "double"
        }
      },
      "description": "OpenAI `gpt-5.6` family only — present when the model has a distinct rate tier for requests whose input token count exceeds `threshold_input_tokens`. Absent for every other provider and model.",
      "title": "InferenceModelPricingLongContext"
    },
    "InferenceModelProvider": {
      "type": "string",
      "enum": [
        "openai",
        "anthropic",
        "xai",
        "huggingface"
      ],
      "title": "InferenceModelProvider"
    }
  }
}