{
  "openapi": "3.1.0",
  "info": {
    "title": "MeshAPI",
    "description": "One key, all AI models.",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Chat Completions",
        "description": "OpenAI-compatible chat completions endpoint.\n\nAuth:        Authorization: Bearer rsk_<ULID>\nStreaming:   set stream=true for SSE chunks\nTemplates:   set template=\"name\" + variables={...}\nRate limits: RPM and RPD enforced per key via Redis fixed-window counters\nSpend cap:   enforced if key.spend_cap_usd is set (soft cap)",
        "operationId": "chat_completions",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "anthropic/claude-haiku-4.5",
                    "messages": [
                      {
                        "role": "user",
                        "content": "Say hi in one sentence."
                      }
                    ],
                    "temperature": 0.2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completion (JSON), or an SSE stream when stream=true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletionResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Successful chat completion",
                    "value": {
                      "id": "chatcmpl-DxC3eeQ6uBWSljHJ0MzxY3ZcGykl0",
                      "object": "chat.completion",
                      "created": 1783000074,
                      "model": "gpt-4o-2024-08-06",
                      "choices": [
                        {
                          "index": 0,
                          "message": {
                            "role": "assistant",
                            "content": "Hi there! How can I assist you today?",
                            "annotations": []
                          },
                          "finish_reason": "stop"
                        }
                      ],
                      "usage": {
                        "prompt_tokens": 12,
                        "completion_tokens": 10,
                        "total_tokens": 22,
                        "prompt_tokens_details": {
                          "cached_tokens": 0,
                          "audio_tokens": 0
                        },
                        "completion_tokens_details": {
                          "reasoning_tokens": 0,
                          "audio_tokens": 0,
                          "accepted_prediction_tokens": 0,
                          "rejected_prediction_tokens": 0
                        }
                      },
                      "service_tier": "default",
                      "system_fingerprint": "fp_42864b4b2b"
                    }
                  }
                }
              },
              "text/event-stream": {
                "example": "data: {\"id\":\"gen-1748331628-ABCdef123\",\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"},\"finish_reason\":null}]}\n\ndata: [DONE]\n\n"
              }
            }
          },
          "400": {
            "description": "Model does not support chat completions API",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_capability_not_supported",
                    "message": "Model 'text-embedding-3-small' does not support the chat/completions API."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient balance or spend cap reached",
            "content": {
              "application/json": {
                "examples": {
                  "spend_cap_reached": {
                    "summary": "Per-key spend cap reached",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Spend cap of $10.0000 reached. Current spend: $10.0023. Contact your administrator to increase the cap."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "no_balance": {
                    "summary": "Insufficient credit balance",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Insufficient balance. Top up your account to use paid models."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "API key is suspended",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "API key is suspended."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "404": {
            "description": "Prompt template not found",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Template '01ARZ3NDEKTSV4RRFFQ69G5FAV' not found."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Request validation failed.",
                    "details": [
                      {
                        "type": "missing",
                        "loc": [
                          "body",
                          "model"
                        ],
                        "msg": "Field required"
                      }
                    ]
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (RPM or RPD)",
            "content": {
              "application/json": {
                "examples": {
                  "rpm_exceeded": {
                    "summary": "Requests-per-minute limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPM limit of 60 req/min exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "rpd_exceeded": {
                    "summary": "Requests-per-day limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPD limit of 1000 req/day exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry",
            "content": {
              "application/json": {
                "examples": {
                  "internal_error": {
                    "summary": "Internal platform error",
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected error occurred. Please retry; if it persists, contact support with the request_id."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "504": {
            "description": "Upstream provider did not respond in time",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "gateway_timeout",
                    "message": "The model provider did not respond in time. Please try again."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable \u2014 retryable (see Retry-After)",
            "content": {
              "application/json": {
                "examples": {
                  "upstream_error": {
                    "summary": "Upstream provider returned an error",
                    "value": {
                      "error": {
                        "code": "upstream_error",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "provider_not_available": {
                    "summary": "Provider credentials not configured",
                    "value": {
                      "error": {
                        "code": "provider_not_available",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/images/generations": {
      "post": {
        "tags": [
          "Images"
        ],
        "summary": "Generate Image",
        "description": "OpenAI-compatible image generation endpoint.\n\n> **Note:** The image response may not render in GitBook's \"Test it\" panel.\n> To view the generated image, try this endpoint with Postman, curl, or\n> another HTTP client.",
        "operationId": "generate_image",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageGenerationRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "openai/gpt-image-1",
                    "prompt": "A clean product photo of a stainless steel water bottle on a white table",
                    "size": "1024x1024",
                    "response_format": "url"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "created": 1783001227,
                      "data": [
                        {
                          "url": "https://images.example.com/generations/water-bottle.png"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient balance or spend cap reached"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry"
          },
          "503": {
            "description": "Upstream provider error \u2014 retryable (see Retry-After)"
          },
          "504": {
            "description": "Upstream provider did not respond in time"
          },
          "501": {
            "description": "Provider does not support image generation"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "x-hideTryItPanel": true
      }
    },
    "/v1/images/edits": {
      "post": {
        "tags": [
          "Images"
        ],
        "summary": "Edit an image",
        "description": "OpenAI-compatible image editing endpoint.\n\nAccepts EITHER ``multipart/form-data`` (binary uploads: ``image``, optional\n``mask``, ``reference_images``) OR ``application/json`` whose image fields are\ndata-URL / base64 strings (or ``{\"url\": ...}`` objects) \u2014 the same convention\nas the chat ``image_url``. Remote http(s) URLs are rejected (mesh does not\nserver-side-fetch images); send a ``data:image/<fmt>;base64,<data>`` URL.\n\nSupports ``operation`` in {edit, remove_background, upscale, outpaint, mix,\nreframe, inpaint}. Each op is gated by the resolved model's supports_image_<op>\nflag (422 when unset / unsupported); the legacy provider matrix is a\ntransitional backstop for the original four ops.\n\n- ``edit`` (default): openai, byteplus, vertex \u2014 prompt + image (+ optional mask + refs).\n- ``remove_background``: openai, vertex \u2014 image only; prompt optional.\n- ``upscale``: vertex (Imagen) or byteplus (Seedream Smart Upscale) \u2014 image +\n  upscale_factor (x2|x4; Seedream maps x2\u21922k, x4\u21924k).\n- ``outpaint``: vertex \u2014 image + prompt + mask (defines expansion region).\n- ``mix``: Gemini image models + gpt-image (openai) \u2014 prompt + image + 1-3\n  reference_images (2-4 sources composed into one, sent as image[]); single\n  output.\n- ``reframe``: Gemini image models \u2014 image + aspect_ratio\n  (1:1|3:4|4:3|9:16|16:9|2:3|3:2); recomposes by outpainting to the target\n  ratio; single output.\n- ``inpaint``: openai, vertex \u2014 image + mask (canonical WHITE=edit; mesh\n  normalizes per provider). Optional mask_feather blends the result back\n  through the mask (Pillow; 501 if unavailable).\n\n> **Note:** The image response may not render in GitBook's \"Test it\" panel.\n> To view the edited image, try this endpoint with Postman, curl, or another\n> HTTP client.",
        "operationId": "edit_image",
        "responses": {
          "200": {
            "description": "The edited image(s).",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Successful image edit response",
                    "value": {
                      "created": 1717200000,
                      "data": [
                        {
                          "url": "https://images.example.com/edits/portrait-with-scarf.png"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient balance or spend cap reached"
          },
          "415": {
            "description": "Unsupported image content type"
          },
          "422": {
            "description": "Validation error (missing required field or oversized file)"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry"
          },
          "503": {
            "description": "Upstream provider error \u2014 retryable (see Retry-After)"
          },
          "504": {
            "description": "Upstream provider did not respond in time"
          },
          "501": {
            "description": "Provider does not support image editing"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "default": {
                  "summary": "Example request (JSON with base64 image)",
                  "value": {
                    "model": "openai/gpt-image-1",
                    "prompt": "Add a red scarf to the portrait",
                    "image": {
                      "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "x-hideTryItPanel": true
      }
    },
    "/v1/video/generations": {
      "post": {
        "tags": [
          "Video"
        ],
        "summary": "Create Video Generation",
        "description": "Create a BytePlus Seedance video generation task.\n\nReturns immediately with ``{\"id\": \"<task_id>\"}``.\nPoll ``GET /v1/video/generations/{id}`` until status is\n``succeeded``, ``failed``, or ``expired``.\n\nPass ``callback_url`` to receive a POST notification when the task\nstatus changes. We intercept the BytePlus callback, update our DB,\nthen forward the full task payload to your URL.",
        "operationId": "create_video_generation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoGenerationRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "byteplus/dreamina-seedance-2-0",
                    "content": [
                      {
                        "type": "text",
                        "text": "A paper boat drifting across a calm pond at sunrise."
                      }
                    ],
                    "duration": 5,
                    "ratio": "16:9",
                    "generate_audio": true,
                    "watermark": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task created; poll the returned id for status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoSubmitResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "id": "vid_01JZ0S8R7G5A4N3C2V1B0M9K8J"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A requested parameter is not forwarded by the target provider (only when VIDEO_UNSUPPORTED_PARAMS_STRICT is on)"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Insufficient balance or spend cap reached"
          },
          "422": {
            "description": "Model not found or not a BytePlus video model"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "502": {
            "description": "BytePlus upstream error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      },
      "get": {
        "tags": [
          "Video"
        ],
        "summary": "List Video Generations",
        "description": "List BytePlus video generation tasks persisted in MeshAPI's DB.\n\nThis endpoint is intentionally DB-only: it does not poll BytePlus or update\ntask state. Use ``GET /v1/video/generations/{id}`` to refresh a non-terminal\ntask from the upstream provider.",
        "operationId": "list_video_generations",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "enum": [
                      "queued",
                      "running",
                      "cancelled",
                      "succeeded",
                      "failed",
                      "expired"
                    ],
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by one or more task statuses, e.g. ?status=running&status=failed",
              "title": "Status"
            },
            "description": "Filter by one or more task statuses, e.g. ?status=running&status=failed"
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by one or more MeshAPI model ids",
              "title": "Model"
            },
            "description": "Filter by one or more MeshAPI model ids"
          },
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include tasks created at or after this ISO 8601 timestamp",
              "title": "Created After"
            },
            "description": "Only include tasks created at or after this ISO 8601 timestamp"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only include tasks created before this ISO 8601 timestamp",
              "title": "Created Before"
            },
            "description": "Only include tasks created before this ISO 8601 timestamp"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Persisted video generation tasks for the authenticated owner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTaskListResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "object": "list",
                      "data": [
                        {
                          "id": "vid_01JZ0S8R7G5A4N3C2V1B0M9K8J",
                          "model": "byteplus/dreamina-seedance-2-0",
                          "status": "succeeded",
                          "error": null,
                          "created_at": 1783001227,
                          "updated_at": 1783001527,
                          "content": {
                            "video_url": "https://storage.example.com/video/vid_01JZ0S8R7G5A4N3C2V1B0M9K8J.mp4"
                          },
                          "seed": 12345,
                          "resolution": "720p",
                          "ratio": "16:9",
                          "duration": 5,
                          "frames": null,
                          "framespersecond": 24,
                          "generate_audio": true,
                          "safety_identifier": null,
                          "priority": null,
                          "draft": null,
                          "draft_task_id": null,
                          "service_tier": null,
                          "execution_expires_after": null,
                          "usage": {
                            "prompt_tokens": 0,
                            "completion_tokens": 0,
                            "total_tokens": 0
                          }
                        }
                      ],
                      "has_more": false,
                      "total": 1,
                      "limit": 20,
                      "offset": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/video/generations/{task_id}": {
      "get": {
        "tags": [
          "Video"
        ],
        "summary": "Get Video Generation",
        "description": "Retrieve the status and result of a BytePlus video generation task.\n\nReturns from DB when the task is in a terminal state. Otherwise polls\nBytePlus live and syncs the DB row.\n\nPoll until ``status`` is one of:\n``succeeded`` \u2014 ``content.video_url`` is populated,\n``failed`` \u2014 check ``error`` field,\n``expired`` \u2014 task timed out.\n\n**Version-gated behaviour**\n\n- `video.poll_by_request_id` \u2014 poll a video task by its MeshAPI `request_id` as well as the provider task id. Requires `X-Mesh-Version: 2026-09` or later.",
        "operationId": "get_video_generation",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Task status and result when succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoTaskResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "id": "vid_01JZ0S8R7G5A4N3C2V1B0M9K8J",
                      "model": "byteplus/dreamina-seedance-2-0",
                      "status": "succeeded",
                      "error": null,
                      "created_at": 1783001227,
                      "updated_at": 1783001527,
                      "content": {
                        "video_url": "https://storage.example.com/video/vid_01JZ0S8R7G5A4N3C2V1B0M9K8J.mp4"
                      },
                      "seed": 12345,
                      "resolution": "720p",
                      "ratio": "16:9",
                      "duration": 5,
                      "frames": null,
                      "framespersecond": 24,
                      "generate_audio": true,
                      "safety_identifier": null,
                      "priority": null,
                      "draft": null,
                      "draft_task_id": null,
                      "service_tier": null,
                      "execution_expires_after": null,
                      "usage": {
                        "prompt_tokens": 0,
                        "completion_tokens": 0,
                        "total_tokens": 0
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "502": {
            "description": "BytePlus upstream error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/chat/compare": {
      "post": {
        "tags": [
          "Chat"
        ],
        "summary": "Chat Compare",
        "description": "Send one conversation to several models at once and get their answers together.\n\nPass 2\u201310 model ids in `models` with the usual `messages`. They run in parallel and\neach result carries its own content, token usage and latency, so you can compare\nquality against cost on real traffic instead of guessing.\n\nSet `comparison_model` to have a further model judge the answers, optionally steered\nby `comparison_instructions`. Use `model_overrides` when one model needs different\nparameters from the rest; `temperature` and `max_tokens` otherwise apply to all.\nWith `stream` true, results arrive as they finish rather than after the slowest.\n\n**Every model in the list is a billed call**, so a comparison across five models\ncosts five completions plus the judge, and one model failing does not fail the\nrequest \u2014 that result reports its own error.",
        "operationId": "chat_compare",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompareRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "models": [
                      "openai/gpt-4o-mini",
                      "anthropic/claude-haiku-4.5"
                    ],
                    "messages": [
                      {
                        "role": "user",
                        "content": "Explain TCP vs UDP in two sentences."
                      }
                    ],
                    "comparison_model": "openai/gpt-4o-mini"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-model results plus an optional synthesized comparison (JSON), or an SSE stream when stream=true",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompareResponse"
                },
                "example": {
                  "comparison_id": "cmp_01ARZ3NDEKTSV4RRFFQ6",
                  "object": "compare.completion",
                  "created": 1748331628,
                  "models": [
                    "openai/gpt-4o-mini",
                    "anthropic/claude-haiku-4.5",
                    "google/gemini-3-flash-preview"
                  ],
                  "results": [
                    {
                      "model": "openai/gpt-4o-mini",
                      "response_body": {
                        "id": "chatcmpl-DrTNOwFsT3v79HmQwOwMgEM2IbWJl",
                        "object": "chat.completion",
                        "created": 1748331628,
                        "model": "gpt-4o-mini-2024-07-18",
                        "choices": [
                          {
                            "index": 0,
                            "message": {
                              "role": "assistant",
                              "content": "TCP is a connection-oriented protocol that guarantees ordered, reliable delivery; UDP is connectionless and sends datagrams without delivery or ordering guarantees."
                            },
                            "finish_reason": "stop"
                          }
                        ],
                        "usage": {
                          "prompt_tokens": 24,
                          "completion_tokens": 47,
                          "total_tokens": 71
                        }
                      },
                      "content": "TCP is a connection-oriented protocol that guarantees ordered, reliable delivery; UDP is connectionless and sends datagrams without delivery or ordering guarantees.",
                      "latency_ms": 812,
                      "usage": {
                        "prompt_tokens": 24,
                        "completion_tokens": 47,
                        "total_tokens": 71
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV::openai/gpt-4o-mini"
                    },
                    {
                      "model": "anthropic/claude-haiku-4.5",
                      "response_body": {
                        "id": "chatcmpl-019ed1d24b0371a390ab",
                        "object": "chat.completion",
                        "model": "anthropic/claude-haiku-4.5",
                        "choices": [
                          {
                            "index": 0,
                            "message": {
                              "role": "assistant",
                              "content": "TCP establishes a connection and guarantees ordered, intact delivery. UDP fires packets without a connection, trading reliability for lower latency."
                            },
                            "finish_reason": "stop"
                          }
                        ],
                        "usage": {
                          "prompt_tokens": 24,
                          "completion_tokens": 52,
                          "total_tokens": 76
                        }
                      },
                      "content": "TCP establishes a connection and guarantees ordered, intact delivery. UDP fires packets without a connection, trading reliability for lower latency.",
                      "latency_ms": 650,
                      "usage": {
                        "prompt_tokens": 24,
                        "completion_tokens": 52,
                        "total_tokens": 76
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV::anthropic/claude-haiku-4.5"
                    },
                    {
                      "model": "google/gemini-3-flash-preview",
                      "latency_ms": 0,
                      "error": "Upstream provider returned an error.",
                      "error_code": "upstream_error",
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV::google/gemini-3-flash-preview"
                    }
                  ],
                  "comparison": "Both answers are correct. Claude's phrasing is slightly clearer on the latency trade-off; GPT-4o-mini is more precise on ordering guarantees.",
                  "comparison_model": "openai/gpt-4o-mini",
                  "comparison_usage": {
                    "prompt_tokens": 180,
                    "completion_tokens": 60,
                    "total_tokens": 240
                  },
                  "comparison_fallback_used": false,
                  "total_latency_ms": 1340,
                  "partial": true,
                  "skip_comparison": false
                }
              },
              "text/event-stream": {
                "example": "event: meta\ndata: {\"comparison_id\":\"cmp_01ARZ3NDEKTSV4RRFFQ6\",\"models\":[\"openai/gpt-4o-mini\",\"anthropic/claude-haiku-4.5\"],\"comparison_model\":\"openai/gpt-4o-mini\",\"skip_comparison\":false}\n\nevent: model_chunk\ndata: {\"model\":\"openai/gpt-4o-mini\",\"delta\":\"TCP is connection-oriented...\",\"latency_ms\":812,\"error\":null,\"error_code\":null,\"usage\":{\"prompt_tokens\":24,\"completion_tokens\":47}}\n\nevent: model_done\ndata: {\"results\":[...]}\n\nevent: comparison_chunk\ndata: {\"delta\":\"Both answers are correct...\",\"finish_reason\":null}\n\nevent: done\ndata: {\"comparison_id\":\"cmp_01ARZ3NDEKTSV4RRFFQ6\",\"total_latency_ms\":1340,\"partial\":false,\"comparison_model\":\"openai/gpt-4o-mini\",\"comparison_fallback_used\":false}\n\n"
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient balance or spend cap reached",
            "content": {
              "application/json": {
                "examples": {
                  "spend_cap_reached": {
                    "summary": "Per-key spend cap reached",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Spend cap of $10.0000 reached. Current spend: $10.0023. Contact your administrator to increase the cap."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "no_balance": {
                    "summary": "Insufficient credit balance",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Insufficient balance. Top up your account to use paid models."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "API key is suspended",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "API key is suspended."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Request validation failed.",
                    "details": [
                      {
                        "type": "missing",
                        "loc": [
                          "body",
                          "model"
                        ],
                        "msg": "Field required"
                      }
                    ]
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (RPM or RPD)",
            "content": {
              "application/json": {
                "examples": {
                  "rpm_exceeded": {
                    "summary": "Requests-per-minute limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPM limit of 60 req/min exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "rpd_exceeded": {
                    "summary": "Requests-per-day limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPD limit of 1000 req/day exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry",
            "content": {
              "application/json": {
                "examples": {
                  "internal_error": {
                    "summary": "Internal platform error",
                    "value": {
                      "error": {
                        "code": "internal_error",
                        "message": "An unexpected error occurred. Please retry; if it persists, contact support with the request_id."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "provider_job_failed": {
                    "summary": "The provider's job failed \u2014 not retried automatically",
                    "value": {
                      "error": {
                        "code": "provider_job_failed",
                        "message": "Internal Error. You were not charged for this attempt. It was not retried automatically because the provider had already started the job; sending the request again starts a new one."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "Upstream provider error",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "upstream_error",
                    "message": "Upstream provider returned an error."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable \u2014 retryable (see Retry-After)",
            "content": {
              "application/json": {
                "examples": {
                  "upstream_error": {
                    "summary": "Upstream provider returned an error",
                    "value": {
                      "error": {
                        "code": "upstream_error",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "provider_not_available": {
                    "summary": "Provider credentials not configured on this server",
                    "value": {
                      "error": {
                        "code": "provider_not_available",
                        "message": "Provider 'vertex' is not available. The required credentials may not be configured on this server."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/batches": {
      "post": {
        "tags": [
          "Batch"
        ],
        "summary": "Create Batch",
        "description": "Create a batch job.\n\nAccepts requests inline \u2014 no separate file upload step required.\nModel and provider are resolved from `body.model` across all requests;\nall requests must target the same model.\n\nReturns 429 (batch_limit_exceeded) if the owner already has 10 or more\nbatches in a non-terminal state.\nReturns 501 (not_implemented) if the resolved provider doesn't support batch.",
        "operationId": "create_batch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBatchRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "requests": [
                      {
                        "custom_id": "item-1",
                        "method": "POST",
                        "url": "/v1/chat/completions",
                        "body": {
                          "model": "openai/gpt-5.4",
                          "messages": [
                            {
                              "role": "user",
                              "content": "Summarize the following text: Small sample text..."
                            }
                          ],
                          "max_tokens": 200,
                          "temperature": 0.2
                        }
                      },
                      {
                        "custom_id": "item-2",
                        "method": "POST",
                        "url": "/v1/chat/completions",
                        "body": {
                          "model": "openai/gpt-5.4",
                          "messages": [
                            {
                              "role": "user",
                              "content": "Translate to French: Hello world"
                            }
                          ]
                        }
                      }
                    ],
                    "completion_window": "24h",
                    "metadata": {
                      "job_name": "nightly-support-summaries"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch job created",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Successful batch creation response",
                    "value": {
                      "id": "batch_6a46708ba644819099dacb31e0339a86",
                      "object": "batch",
                      "endpoint": "/v1/chat/completions",
                      "input_file_id": "file-2LvNxHkyRFbSPcLEnEdHW9",
                      "completion_window": "24h",
                      "status": "validating",
                      "created_at": 1783001227,
                      "expires_at": 1783087627,
                      "request_counts": {
                        "total": 0,
                        "completed": 0,
                        "failed": 0
                      },
                      "usage": {
                        "input_tokens": 0,
                        "output_tokens": 0,
                        "total_tokens": 0,
                        "input_tokens_details": {
                          "cached_tokens": 0
                        },
                        "output_tokens_details": {
                          "reasoning_tokens": 0
                        }
                      },
                      "metadata": {
                        "job_name": "my-batch-job"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      },
      "get": {
        "tags": [
          "Batch"
        ],
        "summary": "List Batches",
        "description": "List batch jobs for the authenticated key's owner.\n\nReturns MeshAPI's own BatchJob records (unified view across all providers)\nin the OpenAI list format: `{\"object\": \"list\", \"data\": [...], \"has_more\": bool}`.\nSupports cursor-based pagination via `after` (batch_id) and `limit`.",
        "operationId": "list_batches",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "object": "list",
                      "data": [
                        {
                          "id": "batch_6a46708ba644819099dacb31e0339a86",
                          "object": "batch",
                          "endpoint": "/v1/chat/completions",
                          "input_file_id": "file-2LvNxHkyRFbSPcLEnEdHW9",
                          "completion_window": "24h",
                          "status": "completed",
                          "created_at": 1783001227,
                          "completed_at": 1783004827,
                          "request_counts": {
                            "total": 2,
                            "completed": 2,
                            "failed": 0
                          },
                          "metadata": {
                            "job_name": "nightly-support-summaries"
                          }
                        }
                      ],
                      "has_more": false,
                      "first_id": "batch_6a46708ba644819099dacb31e0339a86",
                      "last_id": "batch_6a46708ba644819099dacb31e0339a86"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/batches/{batch_id}": {
      "get": {
        "tags": [
          "Batch"
        ],
        "summary": "Get Batch",
        "description": "Get batch status from the upstream provider.\nUsage logging and billing fire automatically on the first terminal observation.\nWhen the batch is completed and has an output file, the response includes a\n`results` key with the parsed output (list of per-request response objects).",
        "operationId": "get_batch",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Batch Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Batch details",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Successful batch details response",
                    "value": {
                      "id": "batch_6a46708ba644819099dacb31e0339a86",
                      "object": "batch",
                      "endpoint": "/v1/chat/completions",
                      "model": "gpt-5.4-2026-03-05",
                      "input_file_id": "file-2LvNxHkyRFbSPcLEnEdHW9",
                      "completion_window": "24h",
                      "status": "in_progress",
                      "created_at": 1783001227,
                      "in_progress_at": 1783001289,
                      "expires_at": 1783087627,
                      "request_counts": {
                        "total": 2,
                        "completed": 0,
                        "failed": 0
                      },
                      "usage": {
                        "input_tokens": 0,
                        "output_tokens": 0,
                        "total_tokens": 0,
                        "input_tokens_details": {
                          "cached_tokens": 0
                        },
                        "output_tokens_details": {
                          "reasoning_tokens": 0
                        }
                      },
                      "metadata": {
                        "job_name": "my-batch-job"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/batches/{batch_id}/cancel": {
      "post": {
        "tags": [
          "Batch"
        ],
        "summary": "Cancel Batch",
        "description": "Cancel an in-progress batch. Partial results may still be available.",
        "operationId": "cancel_batch",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Batch Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Batch cancellation request accepted",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Successful batch cancel response",
                    "value": {
                      "id": "batch_6a46708ba644819099dacb31e0339a86",
                      "object": "batch",
                      "endpoint": "/v1/chat/completions",
                      "model": "gpt-5.4-2026-03-05",
                      "input_file_id": "file-2LvNxHkyRFbSPcLEnEdHW9",
                      "completion_window": "24h",
                      "status": "cancelling",
                      "created_at": 1783001227,
                      "in_progress_at": 1783001289,
                      "expires_at": 1783087627,
                      "cancelling_at": 1783001766,
                      "request_counts": {
                        "total": 2,
                        "completed": 0,
                        "failed": 0
                      },
                      "usage": {
                        "input_tokens": 0,
                        "output_tokens": 0,
                        "total_tokens": 0,
                        "input_tokens_details": {
                          "cached_tokens": 0
                        },
                        "output_tokens_details": {
                          "reasoning_tokens": 0
                        }
                      },
                      "metadata": {
                        "job_name": "my-batch-job"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "tags": [
          "Responses"
        ],
        "summary": "Create Response",
        "description": "Responses API endpoint \u2014 provider resolved dynamically from DB.\n\nAuth:        Authorization: Bearer rsk_<ULID>\nStreaming:   set stream=true for SSE chunks\nRate limits: RPM and RPD enforced per key via Redis fixed-window counters\nSpend cap:   enforced if key.spend_cap_usd is set\nProvider:    resolved from model_pricing.provider (same as chat/completions)",
        "operationId": "create_response",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "openai/gpt-5-pro",
                    "input": "Explain quantum computing in one sentence.",
                    "stream": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Completed response (JSON), a queued background job when background=true, or an SSE stream when stream=true",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Successful responses API response",
                    "value": {
                      "id": "resp_0543e9748a0f014a006a2b806f5e3481",
                      "object": "response",
                      "created_at": 1781235823,
                      "status": "completed",
                      "model": "openai/gpt-4o",
                      "output": [
                        {
                          "id": "msg_0543e9748a0f014a006a2b80a0d14081",
                          "type": "message",
                          "status": "completed",
                          "role": "assistant",
                          "content": [
                            {
                              "type": "output_text",
                              "text": "Quantum computers use quantum bits that can exist in superposition, harnessing interference to solve certain problems more efficiently than classical computers.",
                              "annotations": []
                            }
                          ]
                        }
                      ],
                      "usage": {
                        "input_tokens": 13,
                        "output_tokens": 63,
                        "total_tokens": 76
                      }
                    }
                  }
                }
              },
              "text/event-stream": {
                "example": "data: {\"type\":\"response.created\",\"response\":{\"id\":\"resp_abc\",\"status\":\"in_progress\"}}\n\ndata: {\"type\":\"response.output_text.delta\",\"delta\":\"Hello\"}\n\ndata: {\"type\":\"response.completed\",\"response\":{\"status\":\"completed\"}}\n\n"
              }
            }
          },
          "400": {
            "description": "Model does not support Responses API",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_capability_not_supported",
                    "message": "Model 'meta-llama/llama-3.1-8b-instruct' does not support the responses API."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient balance or spend cap reached",
            "content": {
              "application/json": {
                "examples": {
                  "spend_cap_reached": {
                    "summary": "Per-key spend cap reached",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Spend cap of $10.0000 reached. Current spend: $10.0023. Contact your administrator to increase the cap."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "no_balance": {
                    "summary": "Insufficient credit balance",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Insufficient balance. Top up your account to use paid models."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "API key is suspended",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "API key is suspended."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Request validation failed.",
                    "details": [
                      {
                        "type": "missing",
                        "loc": [
                          "body",
                          "model"
                        ],
                        "msg": "Field required"
                      }
                    ]
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (RPM or RPD)",
            "content": {
              "application/json": {
                "examples": {
                  "rpm_exceeded": {
                    "summary": "Requests-per-minute limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPM limit of 60 req/min exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "rpd_exceeded": {
                    "summary": "Requests-per-day limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPD limit of 1000 req/day exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "internal_error",
                    "message": "An unexpected error occurred. Please retry; if it persists, contact support with the request_id."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "504": {
            "description": "Upstream provider did not respond in time",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "gateway_timeout",
                    "message": "The model provider did not respond in time. Please try again."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "501": {
            "description": "Provider adapter does not implement the Responses API",
            "content": {
              "application/json": {
                "example": {
                  "detail": "openai/o4-mini does not have support for Responses API."
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable \u2014 retryable (see Retry-After)",
            "content": {
              "application/json": {
                "examples": {
                  "upstream_error": {
                    "summary": "Upstream provider returned an error",
                    "value": {
                      "error": {
                        "code": "upstream_error",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "provider_not_available": {
                    "summary": "Provider credentials not configured",
                    "value": {
                      "error": {
                        "code": "provider_not_available",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/messages": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Create Message",
        "description": "Anthropic-compatible Messages endpoint.\n\nAuth:        x-api-key: rsk_<ULID>  (or Authorization: Bearer rsk_<ULID>)\nModels:      any model this gateway serves, not only Anthropic's\nStreaming:   set stream=true for Anthropic SSE events",
        "operationId": "create_message",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Api-Key"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnthropicMessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/embeddings": {
      "post": {
        "tags": [
          "Embeddings"
        ],
        "summary": "Create Embeddings",
        "description": "Turn text into embedding vectors.\n\nOpenAI-compatible: point the OpenAI SDK's embeddings client at this gateway and it\nworks unchanged. `input` takes a single string or a batch, and the response keeps\nthe input order so you can zip results back to your records.\n\n`model` is required and must name a specific embedding model \u2014 `auto` is rejected,\nbecause a vector is only comparable to other vectors from the same model, so\nsilently choosing one for you would corrupt an index. Provider failover and BYOK\nkeys apply as they do to chat.",
        "operationId": "create_embeddings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingsRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "openai/text-embedding-3-small",
                    "input": "The quick brown fox jumps over the lazy dog."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Embedding response",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Successful embedding response",
                    "value": {
                      "object": "list",
                      "data": [
                        {
                          "object": "embedding",
                          "index": 0,
                          "embedding": [
                            -0.03264831379055977,
                            -0.03786936774849892,
                            0.007462255656719208
                          ]
                        }
                      ],
                      "model": "amazon/titan-embed-text-v2",
                      "usage": {
                        "prompt_tokens": 3,
                        "total_tokens": 3
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Model does not support embeddings API",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_capability_not_supported",
                    "message": "Model 'gpt-4o' does not support the embeddings API."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient balance or spend cap reached",
            "content": {
              "application/json": {
                "examples": {
                  "spend_cap_reached": {
                    "summary": "Per-key spend cap reached",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Spend cap of $10.0000 reached. Current spend: $10.0023. Contact your administrator to increase the cap."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "no_balance": {
                    "summary": "Insufficient credit balance",
                    "value": {
                      "error": {
                        "code": "spend_limit_exceeded",
                        "message": "Insufficient balance. Top up your account to use paid models."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "API key is suspended",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "API key is suspended."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "validation_error",
                    "message": "Request validation failed.",
                    "details": [
                      {
                        "type": "missing",
                        "loc": [
                          "body",
                          "input"
                        ],
                        "msg": "Field required"
                      }
                    ]
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (RPM or RPD)",
            "content": {
              "application/json": {
                "examples": {
                  "rpm_exceeded": {
                    "summary": "Requests-per-minute limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPM limit of 60 req/min exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "rpd_exceeded": {
                    "summary": "Requests-per-day limit hit",
                    "value": {
                      "error": {
                        "code": "rate_limit_exceeded",
                        "message": "RPD limit of 1000 req/day exceeded."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "internal_error",
                    "message": "An unexpected error occurred. Please retry; if it persists, contact support with the request_id."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "504": {
            "description": "Upstream provider did not respond in time",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "gateway_timeout",
                    "message": "The model provider did not respond in time. Please try again."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "503": {
            "description": "Upstream provider unavailable \u2014 retryable (see Retry-After)",
            "content": {
              "application/json": {
                "examples": {
                  "upstream_error": {
                    "summary": "Upstream provider returned an error",
                    "value": {
                      "error": {
                        "code": "upstream_error",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  },
                  "provider_not_available": {
                    "summary": "Provider credentials not configured",
                    "value": {
                      "error": {
                        "code": "provider_not_available",
                        "message": "The model provider is temporarily unavailable. Please try again shortly."
                      },
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/moderations": {
      "post": {
        "tags": [
          "Moderations"
        ],
        "summary": "Classify content against the content policy",
        "description": "Check text or images against the content policy before you act on them.\n\nOpenAI-compatible: `input` accepts a string, a batch of strings, or multimodal parts\nwith image URLs. Each result reports `flagged` plus per-category booleans and scores,\nso you can set your own threshold rather than only trusting the flag.\n\nImages must be PNG, JPEG, GIF or WebP; anything else is rejected up front rather\nthan failing upstream.\n\nModeration is deliberately **not** gated by per-model allow-lists or usage caps \u2014 it\nis a safety primitive, and making it refusable would push callers toward skipping the\ncheck. Your key's rate limits still apply.",
        "operationId": "create_moderation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "omni-moderation-latest",
                    "input": "I want to build a harmless science project."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Moderation result(s).",
            "content": {
              "application/json": {
                "schema": {},
                "example": {
                  "id": "modr-0123",
                  "model": "omni-moderation-latest",
                  "results": [
                    {
                      "flagged": true,
                      "categories": {
                        "sexual": true,
                        "violence": false
                      },
                      "category_scores": {
                        "sexual": 0.97,
                        "violence": 0.0007
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "403": {
            "description": "API key is suspended"
          },
          "422": {
            "description": "Request validation failed"
          },
          "429": {
            "description": "Rate limit exceeded (RPM or RPD)"
          },
          "500": {
            "description": "Mesh-internal error \u2014 do not retry"
          },
          "503": {
            "description": "Upstream provider error, or credentials not configured"
          },
          "504": {
            "description": "Upstream provider did not respond in time"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/audio/speech": {
      "post": {
        "tags": [
          "Audio"
        ],
        "summary": "Create Speech",
        "description": "Convert text to speech.\n\nProvider is resolved automatically from the model name via the model_pricing\ntable \u2014 no hardcoded provider branching. Streaming is used when the provider\nadapter supports it and `stream=true` (the default).\n\nThe `voice` field is required for ElevenLabs models. Sarvam models use\n`speaker` instead.",
        "operationId": "create_speech",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "model": "elevenlabs/eleven_flash_v2_5",
                    "input": "Welcome to MeshAPI.",
                    "voice": "21m00Tcm4TlvDq8ikWAM",
                    "response_format": "mp3_44100_128",
                    "stream": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": "binary audio bytes"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "tags": [
          "Audio"
        ],
        "summary": "Create Transcription",
        "description": "Transcribe an audio file to text.\n\nProvider is resolved automatically from the model name via model_pricing.\n`file` is optional for providers that accept `source_url` or `cloud_storage_url`.\n`additional_formats` is a JSON-encoded string (ElevenLabs-specific, ignored by others).\nReturns `{\"text\": \"...\"}` by default, or per-word structure (`words[]` with each\ntoken's `type`) when `response_format=verbose_json`.",
        "operationId": "create_transcription",
        "parameters": [
          {
            "name": "enable_logging",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true,
              "title": "Enable Logging"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_create_transcription"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptionResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "text": "Today we reviewed the launch plan."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audio/translations": {
      "post": {
        "tags": [
          "Audio"
        ],
        "summary": "Create Translation",
        "description": "Translate speech in any language to English text.\n\nOpenAI-compatible `POST /v1/audio/translations` \u2014 the path the OpenAI SDK's\n`client.audio.translations.create()` calls. Provider is resolved from the\nmodel name via model_pricing; the adapter must implement\n`speech_to_text_translate()` (providers that don't \u2192 422).\n\n`response_format`: `json` (default) \u2192 `{\"text\": \"...\"}`; `text` \u2192 the raw\ntranscript as `text/plain`; `verbose_json` \u2192 the per-word structure. All in\nEnglish.",
        "operationId": "create_translation",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_create_translation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptionResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "text": "We will meet tomorrow morning."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/audio/transcriptions/translate": {
      "post": {
        "tags": [
          "Audio"
        ],
        "summary": "Create Transcription Translate",
        "description": "Transcribe audio and translate it to English.\n\n**Legacy alias** for `POST /v1/audio/translations` \u2014 prefer that\nOpenAI-standard path. Behaviour is identical; retained so existing callers\nkeep working.",
        "operationId": "create_transcription_translate",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_create_transcription_translate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptionResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "text": "We will meet tomorrow morning."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/audio/voices": {
      "get": {
        "tags": [
          "Audio"
        ],
        "summary": "List Voices",
        "description": "List available TTS voices across every model brand, filterable by `brand`.\n\nA unified, normalised catalog covering ElevenLabs, Cartesia, Kokoro, Orpheus,\nand other TTS model brands. ElevenLabs and dynamic (e.g. Cartesia) voices are\nfetched live; open-weight preset voices (Kokoro / Orpheus) come from a static\ncatalog.\n\nFilters (case-insensitive): `brand` (e.g. `elevenlabs`, `hexgrad`,\n`canopylabs`, `cartesia`), `model` (canonical model_id), and `search`\n(substring match on voice id / name). Per-brand fetches are best-effort \u2014\na brand that errors is skipped rather than failing the whole listing.",
        "operationId": "list_voices",
        "parameters": [
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Brand"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Model"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoicesResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "voices": [
                        {
                          "voice_id": "21m00Tcm4TlvDq8ikWAM",
                          "name": "Rachel",
                          "category": "premade"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audio/voices/{voice_id}": {
      "get": {
        "tags": [
          "Audio"
        ],
        "summary": "Get Voice",
        "description": "Return metadata for a single ElevenLabs voice by ID.",
        "operationId": "get_voice",
        "parameters": [
          {
            "name": "voice_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Voice Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {},
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "voice_id": "21m00Tcm4TlvDq8ikWAM",
                      "name": "Rachel",
                      "category": "premade",
                      "labels": {
                        "accent": "american"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/router/select": {
      "post": {
        "tags": [
          "Router"
        ],
        "summary": "Router Select",
        "description": "Resolve the Auto Router's model choice for a prompt without running inference.",
        "operationId": "router_select",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RouterSelectRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "messages": [
                      {
                        "role": "user",
                        "content": "Write a SQL query for monthly revenue."
                      }
                    ],
                    "api_type": "completions",
                    "exclude_models": [
                      "openai/gpt-4o-mini"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouterSelectResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "model": "anthropic/claude-haiku-4.5",
                      "auto_router": {
                        "selected": true,
                        "strategy": "registry",
                        "reason": "Best latency-adjusted fit for the prompt and API type."
                      },
                      "reasoning_effort": "none"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/admin-keys": {
      "get": {
        "tags": [
          "Admin Keys"
        ],
        "summary": "List Admin Keys",
        "operationId": "list_admin_keys",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminKeySummary"
                  },
                  "type": "array",
                  "title": "Response List Admin Keys"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      },
      "post": {
        "tags": [
          "Admin Keys"
        ],
        "summary": "Create Admin Key",
        "description": "Mint an admin key. The plaintext is returned exactly once.\n\nD4 rule 1: the caller may grant only permissions they already hold, at a\nscope they already hold \u2014 checked against `check_org_permissions`'s\nresolved `OrgAccess`, never against the token's own claims.",
        "operationId": "create_admin_key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAdminKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminKeyCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/admin-keys/{key_id}": {
      "get": {
        "tags": [
          "Admin Keys"
        ],
        "summary": "Get Admin Key",
        "operationId": "get_admin_key",
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminKeySummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Admin Keys"
        ],
        "summary": "Revoke Admin Key",
        "description": "Revoke immediately \u2014 no grace window (\u00a77).\n\nRe-checks current authority against the key's own scope, like rotate.\nRevocation is destructive: a demoted admin who can still SEE a key they\ncreated must not be able to kill the org's automation with it.",
        "operationId": "revoke_admin_key",
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RevokeAdminKeyRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/admin-keys/{key_id}/rotate": {
      "post": {
        "tags": [
          "Admin Keys"
        ],
        "summary": "Rotate Admin Key",
        "description": "Mint a successor, then shorten the predecessor to a grace window (\u00a77).\n\nBoth keys work during the overlap \u2014 rotation is not revocation, which is\nimmediate and has no grace.\n\nRe-checks the caller's CURRENT authority against the predecessor's own\nscope/permissions, exactly like create \u2014 the route floor alone (default\nSELF) is not enough: a caller demoted since minting an ORG-scoped key\nwould otherwise still find it via `created_by` and rotate it into a\nfresh 90-day ORG-scoped credential nobody would let them create today.",
        "operationId": "rotate_admin_key",
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RotateAdminKeyRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminKeyCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/balance": {
      "get": {
        "tags": [
          "Balance"
        ],
        "summary": "Get Balance",
        "description": "Return the credit balance for the authenticated caller.\n\nAccepts either a dashboard session token (JWT) or an rsk_ API key. With an\norg context the org owner's balance is returned \u2014 all members of an org share\nthe same billing pool; a caller with no org gets their own balance. The\nresponse also reports how much of the balance is reserved by in-flight\noperations (`reserved_usd`, plus a per-category `reserved_breakdown`) and the\nspendable remainder (`available_usd`).\n\nAuth: Authorization: Bearer <user JWT | rsk_ key>",
        "operationId": "get_balance",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceOut"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "balance_usd": "42.5000000",
                      "reserved_usd": "15.0000000",
                      "available_usd": "27.5000000",
                      "reserved_breakdown": [
                        {
                          "kind": "realtime",
                          "reserved_usd": "5.0000000"
                        },
                        {
                          "kind": "video",
                          "reserved_usd": "10.0000000"
                        }
                      ],
                      "updated_at": "2026-07-14T10:15:30+00:00",
                      "message": null
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/errors": {
      "get": {
        "tags": [
          "Errors"
        ],
        "summary": "Get Error Catalog",
        "description": "Return the full error action-item catalog for client-side error surfacing.\n\nResolution a client should apply: look up ``codes`` by its specific error\nidentifier, fall back to ``categories`` by the error's category, then\n``default``. The payload is small and slow-changing \u2014 cache it and re-fetch\nwhen ``version`` changes.",
        "operationId": "get_error_catalog",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorCatalogOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/usage": {
      "post": {
        "tags": [
          "Usage"
        ],
        "summary": "Query Usage Summary",
        "description": "Aggregate usage stats for the authenticated caller.\n\nAccepts either a dashboard session token (JWT) or an rsk_ API key. With a JWT\nthe stats span every key the caller can see in the given org; with an API key\nthey are scoped to that single key (the body's org_id / member filters are\nignored). Results are cached for 1 minute per org/filter combination for JWT\ncallers. Pass ?refresh=true to bypass.",
        "operationId": "query_usage_summary",
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Refresh"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageFilter"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "org_id": "0190a1b2-3c4d-7e8f-9012-3456789abcde",
                    "since": "2026-07-01",
                    "until": "2026-07-14",
                    "limit": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/app__usage__analytics__UsageSummary"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "total_requests": 1284,
                      "successful_requests": 1270,
                      "error_requests": 14,
                      "prompt_tokens": 482913,
                      "completion_tokens": 197233,
                      "total_tokens": 680146,
                      "total_cost_usd": "12.4832100",
                      "total_platform_fee_usd": "0.6241600",
                      "by_model_total": 3,
                      "by_model": [
                        {
                          "model": "openai/gpt-4o-mini",
                          "requests": 900,
                          "prompt_tokens": 300000,
                          "completion_tokens": 120000,
                          "total_tokens": 420000,
                          "cost_usd": "6.1200000",
                          "platform_fee_usd": "0.3060000"
                        },
                        {
                          "model": "anthropic/claude-haiku-4.5",
                          "requests": 320,
                          "prompt_tokens": 150000,
                          "completion_tokens": 60000,
                          "total_tokens": 210000,
                          "cost_usd": "4.9000000",
                          "platform_fee_usd": "0.2450000"
                        },
                        {
                          "model": "openai/text-embedding-3-small",
                          "requests": 64,
                          "prompt_tokens": 32913,
                          "completion_tokens": 0,
                          "total_tokens": 32913,
                          "cost_usd": "1.4632100",
                          "platform_fee_usd": "0.0731600"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/usage/events": {
      "post": {
        "tags": [
          "Usage"
        ],
        "summary": "Query Usage Events",
        "description": "Paginated per-request event history for the authenticated caller.\n\nAccepts either a dashboard session token (JWT) or an rsk_ API key; with an API\nkey results are scoped to that single key (body org_id / member filters are\nignored). Results are cached for 1 minute per org/filter combination for JWT\ncallers. Pass ?refresh=true to bypass, or filter by `request_id`, which is\nnever served from cache (see below).",
        "operationId": "query_usage_events",
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Refresh"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageFilter"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "org_id": "0190a1b2-3c4d-7e8f-9012-3456789abcde",
                    "since": "2026-07-01",
                    "model": [
                      "openai/gpt-4o-mini"
                    ],
                    "status": [
                      "success"
                    ],
                    "limit": 20,
                    "offset": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageEventsPage"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "events": [
                        {
                          "id": "0190a1c0-0000-7000-8000-00000000e1e1",
                          "key_id": "0190a1b2-0000-7000-8000-0000000000aa",
                          "key_label": "prod-key",
                          "user_id": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
                          "end_user_id": "customer-42",
                          "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV",
                          "model": "openai/gpt-4o-mini",
                          "model_name": "gpt-4o-mini",
                          "model_provider": "openai",
                          "stream": false,
                          "prompt_tokens": 128,
                          "completion_tokens": 64,
                          "total_tokens": 192,
                          "cost_usd": "0.0000480",
                          "latency_ms": 812,
                          "tokens_per_second": 78.82,
                          "status": "success",
                          "error_code": null,
                          "error_category": null,
                          "error_message": null,
                          "created_at": "2026-07-14T10:15:30+00:00",
                          "model_type": "text",
                          "is_byok": false,
                          "provider": "openai",
                          "fallback_triggered": false,
                          "platform_fee_usd": "0.0000024",
                          "attempt_no": 1,
                          "is_retry_attempt": false,
                          "routing_fallback": false
                        }
                      ],
                      "total": 1284,
                      "limit": 50,
                      "offset": 0
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/usage/rejections": {
      "post": {
        "tags": [
          "Usage"
        ],
        "summary": "Query Rejections",
        "description": "Requests refused before any model was called \u2014 rate limit, spend cap, balance,\nmodel access (MESH-679).\n\nThese never reach usage logging, so they are absent from /v1/usage/events by\nconstruction: a refusal has no tokens, no cost and no provider, and belongs in\nthe request log rather than the billing ledger. Served from the request log,\nwhich has recorded them all along.\n\nSame auth and scoping as /v1/usage/events \u2014 an rsk_ key sees only its own\nrefusals; a session token sees the org's, narrowed to the caller's own keys\nunless they are an org or team admin.",
        "operationId": "query_rejections",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RejectionFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RejectionsPage"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/usage/requests/{request_id}": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "Get Request",
        "description": "Look up one request by the id returned in its `X-Request-Id` response header.\n\nReports what the gateway knows about that request: the model and provider that\nserved it, status, latency, tokens, cost, and every attempt made \u2014 so a retry\nor a fallback to another target is visible rather than inferred.\n\nRequests refused before any model was called (rate limit, spend cap, empty\nbalance, model access) write no usage row, and are served from the request log\nwith `outcome: \"rejected\"`.\n\nTwo surfaces are not resolvable here, because their usage is not recorded\nagainst the HTTP request's id: `/v1/chat/compare`, whose fan-out is recorded\nper model under a derived id, and `/v1/batches`, whose usage is recorded\nagainst the batch id \u2014 use `GET /v1/batches/{batch_id}` for those.\n\nResolvable for **90 days**. Older ids return 404, as does an id belonging to\nanother account \u2014 existence is never confirmed across tenants.\n\n`request_headers` carries the HTTP headers of the request \u2014 what the gateway\nreceived, and what it returned (the rate-limit state we reported, the request\nid, the routing disclosure; never the provider's own set). Credentials are\nreplaced at capture: `Authorization`, `x-api-key`, `api-key`,\n`x-goog-api-key` and cookies report their NAME with a `[redacted]` value, so\n\"you sent no Authorization header\" stays distinguishable from \"you sent one\".\nThe client-IP forwarding chain is not reported. NULL when the request log no\nlonger holds the record \u2014 the rest of the payload answers regardless.\n\n`request_bodies` carries the prompt and completion themselves, and is NULL\nunless the key that made the request has opted in to exposing them \u2014 its own\npolicy governs, not the caller's. It cannot be enabled for an organisation\nwith zero data retention on, which is also why a ZDR org has none to show.\nWhere PII redaction is enabled this is the REDACTED copy; the raw body is\nnever stored. A body over the size cap reports `truncated: true` with its\noriginal size rather than being silently shortened.\n\n`video_task` carries the current status and result of the video generation\ntask a `POST /v1/video/generations` request created \u2014 the stored response\nbody only ever shows the submit's `queued`. Read from our records; it never\npolls the provider. NULL for any other request.\n\nNo provider-side diagnostic is ever included. Error text is the same scrubbed\nmessage the original response carried.",
        "operationId": "get_request",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Request Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestLookupOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/usage/events/{event_id}/attempts": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "Get Usage Event Attempts",
        "description": "Per-attempt timeline for one request (the served row + any retried rows sharing\nits request_id), oldest first \u2014 powers the logs drawer's \"Attempts\" history so a\ncaller can see every model that was tried. Same customer-facing scrubbing as the\nevents list, with one caveat: each attempt carries `provider`, the upstream it\nwas attempted against. Treat that field as unstable \u2014 whether the upstream is\nexposed at all is under review.\n\nAuthorization mirrors the events list: an API-key caller sees only events made by\nthat key; a JWT caller must belong to the event's org, and a non-privileged member\nis restricted to their own events. Anything else 404s (existence is not leaked).",
        "operationId": "get_usage_event_attempts",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Event Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UsageEventOut"
                  },
                  "title": "Response Get Usage Event Attempts"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/usage/rate-limits": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "Get Rate Limits",
        "description": "Return live rate-limit usage (RPM / RPD / TPM) vs limits. Always reads fresh\nRedis counters \u2014 no caching.\n\nAccepts either a dashboard session token (JWT) \u2014 returning org/team/member\nscopes \u2014 or an rsk_ API key, returning a single `key` scope for that key.",
        "operationId": "get_rate_limits",
        "parameters": [
          {
            "name": "org_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Organisation UUID. Required for session (JWT) callers; ignored for API keys.",
              "title": "Org Id"
            },
            "description": "Organisation UUID. Required for session (JWT) callers; ignored for API keys."
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Team UUID (optional filter)",
              "title": "Team Id"
            },
            "description": "Team UUID (optional filter)"
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "as_of": "2026-07-14T10:20:00+00:00",
                      "org": null,
                      "team": null,
                      "member": null,
                      "key": {
                        "rpm": {
                          "current": 42,
                          "limit": 60,
                          "is_default_limit": false,
                          "pct": 70.0,
                          "resets_in_seconds": 37
                        },
                        "rpd": {
                          "current": 5120,
                          "limit": 10000,
                          "is_default_limit": false,
                          "pct": 51.2,
                          "resets_in_seconds": 49200
                        },
                        "tpm": {
                          "current": 18000,
                          "limit": 1000000,
                          "is_default_limit": true,
                          "pct": 1.8,
                          "resets_in_seconds": 37
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/usage/spend-trend": {
      "get": {
        "tags": [
          "Usage"
        ],
        "summary": "Get Spend Trend",
        "description": "Return historical spend bucketed by the chosen granularity, plus a trailing\n3-bucket moving average and the window's total spend.",
        "operationId": "get_spend_trend",
        "parameters": [
          {
            "name": "org_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Organisation UUID",
              "title": "Org Id"
            },
            "description": "Organisation UUID"
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Team UUID (optional filter)",
              "title": "Team Id"
            },
            "description": "Team UUID (optional filter)"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "hourly",
                "weekly",
                "monthly"
              ],
              "type": "string",
              "description": "Bucketing window: 'hourly' (last 24h, hourly), 'weekly' (last 12 weeks, weekly), 'monthly' (last 30 days, daily).",
              "default": "monthly",
              "title": "Granularity"
            },
            "description": "Bucketing window: 'hourly' (last 24h, hourly), 'weekly' (last 12 weeks, weekly), 'monthly' (last 30 days, daily)."
          },
          {
            "name": "force_refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Skip the cache and recompute from the database.",
              "default": false,
              "title": "Force Refresh"
            },
            "description": "Skip the cache and recompute from the database."
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpendTrendResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audit-logs": {
      "get": {
        "tags": [
          "Audit Logs"
        ],
        "summary": "List Audit Logs",
        "description": "The caller's org trail.\n\n`target.name` is the entity's CURRENT name, resolved at read time. It is not\nstored with the entry \u2014 a renamed entity therefore appears under its new name\nin older entries, and an entity that no longer exists has no name at all.",
        "operationId": "list_audit_logs",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Action"
            }
          },
          {
            "name": "target_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Type"
            }
          },
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Id"
            }
          },
          {
            "name": "actor_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Actor Id"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Audit Logs"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/audit-logs.csv": {
      "get": {
        "tags": [
          "Audit Logs"
        ],
        "summary": "Export Audit Logs Csv",
        "description": "Same dependency as the JSON route, so the role gate cannot drift: a member\nwho cannot list entries cannot download them either.\n\nassert_audit_readable() runs HERE, synchronously, before the response is\nconstructed \u2014 not left to iter_csv_rows's own internal call. StreamingResponse\nsends the 200 status line before ever touching the body iterator, so a check\ninside an async generator raises too late for an HTTP client to see anything\nbut a 200 with an empty body. This pre-flight is what usage.py's CSV export\nalready does (checks run in the handler, not the generator); iter_csv_rows's\nown call stays in place as defense-in-depth for non-HTTP callers only.",
        "operationId": "export_audit_logs_csv",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Action"
            }
          },
          {
            "name": "target_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Type"
            }
          },
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Target Id"
            }
          },
          {
            "name": "actor_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Actor Id"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/catalog": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "List Catalog",
        "description": "Browse global templates, with this org's enable state on each row.",
        "operationId": "list_catalog",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search name + description",
              "title": "Q"
            },
            "description": "Search name + description"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "writing",
                    "code",
                    "support",
                    "data",
                    "marketing",
                    "agents",
                    "productivity",
                    "research",
                    "sales",
                    "operations"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to one category",
              "title": "Category"
            },
            "description": "Filter to one category"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "popular",
                "recent",
                "name"
              ],
              "type": "string",
              "default": "popular",
              "title": "Sort"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 24,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogPage"
                }
              }
            }
          },
          "400": {
            "description": "No org context on the caller's identity"
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/catalog/categories": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "List Categories",
        "description": "Category counts for the filter chips, plus the total behind the \"All\" chip.",
        "operationId": "list_categories",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryCounts"
                }
              }
            }
          },
          "400": {
            "description": "No org context on the caller's identity"
          },
          "401": {
            "description": "Missing or invalid credentials"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/templates/catalog/{template_id}/enable": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Enable Template",
        "description": "Add a global template to the org's library. Idempotent.",
        "operationId": "enable_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogTemplate"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "403": {
            "description": "Not a member of this org"
          },
          "404": {
            "description": "No global template with this id"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Templates"
        ],
        "summary": "Disable Template",
        "description": "Remove a global template from the org's library. Idempotent.\n\nRemoves it from the dashboard only \u2014 any key already calling this template by\nname keeps working (see the module docstring).",
        "operationId": "disable_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogTemplate"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "403": {
            "description": "Not a member of this org"
          },
          "404": {
            "description": "No global template with this id"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Create Template",
        "description": "Create a template scoped to the authenticated user's owner.\n\nMESH-1003: creates version 1 from the submitted content in the same\ntransaction and auto-publishes it \u2014 a template is usable the instant\nit's created, same as before versioning existed.",
        "operationId": "create_template",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTemplateRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "name": "support-reply",
                    "description": "Short customer support replies with a friendly tone.",
                    "system": "You are a concise customer support assistant.",
                    "messages": [
                      {
                        "role": "user",
                        "content": "Reply to: {{ticket}}"
                      }
                    ],
                    "model": "openai/gpt-4o-mini",
                    "params": {
                      "temperature": 0.3,
                      "max_tokens": 300
                    },
                    "variables": [
                      "ticket"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateSummary"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "id": "tmpl_01JZ0R6N9F8K7B6V3Q4A2Y1X0P",
                      "name": "support-reply",
                      "owner": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
                      "org_id": "org_01JZ0QAW6MS7M6WTJ7HE4VK3DF",
                      "team_id": null,
                      "is_global": false,
                      "description": "Short customer support replies with a friendly tone.",
                      "system": "You are a concise customer support assistant.",
                      "messages": [
                        {
                          "role": "user",
                          "content": "Reply to: {{ticket}}"
                        }
                      ],
                      "model": "openai/gpt-4o-mini",
                      "params": {
                        "temperature": 0.3,
                        "max_tokens": 300
                      },
                      "variables": [
                        "ticket"
                      ],
                      "creator_name": "Asha Rao",
                      "creator_email": "asha@example.com",
                      "created_at": "2026-07-02T10:15:30Z",
                      "updated_at": "2026-07-02T10:15:30Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "409": {
            "description": "A template with this name already exists for this owner",
            "content": {
              "application/json": {
                "example": {
                  "detail": "A template named 'my-prompt' already exists for owner 'user_abc123'."
                }
              }
            }
          },
          "500": {
            "description": "Database write error",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Internal Server Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      },
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "List Templates",
        "description": "List templates for the caller's org. Admin/owner can filter by member_owner.\n\n`scope` splits the two things this endpoint has always returned together:\n\n    all      org templates + every global (the historical response \u2014 DEFAULT,\n             so the SDK and the MCP tools see no change)\n    custom   org templates only\n    global   only the globals this org has ENABLED\n\n`global` is the one that reads `template_enablements`, and it is confined to\nthis endpoint: `resolve_template` at inference still resolves any global by\nname for any key, enabled or not.",
        "operationId": "list_templates",
        "parameters": [
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Team Id"
            }
          },
          {
            "name": "member_owner",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Member Owner"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "custom",
                "global"
              ],
              "type": "string",
              "default": "all",
              "title": "Scope"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateSummary"
                  },
                  "title": "Response List Templates"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": [
                      {
                        "id": "tmpl_01JZ0R6N9F8K7B6V3Q4A2Y1X0P",
                        "name": "support-reply",
                        "owner": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
                        "org_id": "org_01JZ0QAW6MS7M6WTJ7HE4VK3DF",
                        "team_id": null,
                        "is_global": false,
                        "description": "Short customer support replies with a friendly tone.",
                        "system": "You are a concise customer support assistant.",
                        "messages": [
                          {
                            "role": "user",
                            "content": "Reply to: {{ticket}}"
                          }
                        ],
                        "model": "openai/gpt-4o-mini",
                        "params": {
                          "temperature": 0.3,
                          "max_tokens": 300
                        },
                        "variables": [
                          "ticket"
                        ],
                        "creator_name": "Asha Rao",
                        "creator_email": "asha@example.com",
                        "created_at": "2026-07-02T10:15:30Z",
                        "updated_at": "2026-07-02T10:15:30Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "500": {
            "description": "Database read error",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Internal Server Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/{template_id}": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Get Template",
        "description": "Get a single template by UUID. Must belong to the caller's owner or their org.",
        "operationId": "get_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateSummary"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "id": "tmpl_01JZ0R6N9F8K7B6V3Q4A2Y1X0P",
                      "name": "support-reply",
                      "owner": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
                      "org_id": "org_01JZ0QAW6MS7M6WTJ7HE4VK3DF",
                      "team_id": null,
                      "is_global": false,
                      "description": "Short customer support replies with a friendly tone.",
                      "system": "You are a concise customer support assistant.",
                      "messages": [
                        {
                          "role": "user",
                          "content": "Reply to: {{ticket}}"
                        }
                      ],
                      "model": "openai/gpt-4o-mini",
                      "params": {
                        "temperature": 0.3,
                        "max_tokens": 300
                      },
                      "variables": [
                        "ticket"
                      ],
                      "creator_name": "Asha Rao",
                      "creator_email": "asha@example.com",
                      "created_at": "2026-07-02T10:15:30Z",
                      "updated_at": "2026-07-02T10:15:30Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "404": {
            "description": "Template not found or not owned by caller",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Template '01ARZ3NDEKTSV4RRFFQ69G5FAV' not found."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "500": {
            "description": "Database read error",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Internal Server Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Templates"
        ],
        "summary": "Update Template",
        "description": "Rename/re-describe a template. Content is versioned separately \u2014 see\nPOST .../versions. Owner can edit own; org admin/owner can edit any org template.",
        "operationId": "update_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTemplateRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "description": "Short customer support replies with a warmer tone.",
                    "params": {
                      "temperature": 0.4,
                      "max_tokens": 350
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateSummary"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "id": "tmpl_01JZ0R6N9F8K7B6V3Q4A2Y1X0P",
                      "name": "support-reply",
                      "owner": "user_01JZ0Q9WZ7ZK3M9YF6R8D2C4B1",
                      "org_id": "org_01JZ0QAW6MS7M6WTJ7HE4VK3DF",
                      "team_id": null,
                      "is_global": false,
                      "description": "Short customer support replies with a warmer tone.",
                      "system": "You are a concise customer support assistant.",
                      "messages": [
                        {
                          "role": "user",
                          "content": "Reply to: {{ticket}}"
                        }
                      ],
                      "model": "openai/gpt-4o-mini",
                      "params": {
                        "temperature": 0.3,
                        "max_tokens": 300
                      },
                      "variables": [
                        "ticket"
                      ],
                      "creator_name": "Asha Rao",
                      "creator_email": "asha@example.com",
                      "created_at": "2026-07-02T10:15:30Z",
                      "updated_at": "2026-07-02T10:20:30Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "404": {
            "description": "Template not found or not owned by caller",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Template '01ARZ3NDEKTSV4RRFFQ69G5FAV' not found."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "409": {
            "description": "A template with this name already exists for this owner",
            "content": {
              "application/json": {
                "example": {
                  "detail": "A template named 'my-prompt' already exists for owner 'user_abc123'."
                }
              }
            }
          },
          "500": {
            "description": "Database write error",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Internal Server Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Templates"
        ],
        "summary": "Delete Template",
        "description": "Hard delete. Owner can delete own; org admin/owner can delete any org template.\nCASCADE takes every template_versions row with it \u2014 there is no separate\n\"delete history\" step.",
        "operationId": "delete_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "404": {
            "description": "Template not found or not owned by caller",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Template '01ARZ3NDEKTSV4RRFFQ69G5FAV' not found."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "500": {
            "description": "Database delete error",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Internal Server Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/{template_id}/versions": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Save Version",
        "description": "Save a new immutable version. Never touches what's published \u2014 see\nPOST .../publish. Any field left unset carries over from the current\nlatest_version_id, matching the old content-bearing PATCH's ergonomics.",
        "operationId": "save_version",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveVersionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateVersionSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "List Versions",
        "description": "Newest first. A READ-only caller sees the published version only \u2014 an\nunpublished save is a draft, visible only to whoever could also edit it.",
        "operationId": "list_versions",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TemplateVersionSummary"
                  },
                  "title": "Response List Versions"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/{template_id}/versions/{version_id}": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Get Version",
        "operationId": "get_version",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Version Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateVersionSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/{template_id}/publish": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Publish Template",
        "description": "Publish `latest_version_id` \u2014 the one action that changes what inference\nresolves to. Idempotent: publishing the currently-published version is a no-op.",
        "operationId": "publish_template",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/templates/{template_id}/versions/{version_id}/rollback": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Rollback Version",
        "description": "Copy `version_id`'s content into a new version and publish it immediately.\nNothing is deleted \u2014 the version being rolled back FROM stays in history,\nand the new row records `reverted_from_version_id` for the audit trail.",
        "operationId": "rollback_version",
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Version Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateVersionSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/playground/threads": {
      "post": {
        "tags": [
          "Playground"
        ],
        "summary": "Create Thread",
        "description": "Create a playground thread owned by the authenticated caller.",
        "operationId": "create_thread",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateThreadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      },
      "get": {
        "tags": [
          "Playground"
        ],
        "summary": "List Threads",
        "description": "The caller's threads, most recently updated first.\n\nReturns summaries with a message COUNT rather than the messages themselves.\nA thread can hold half a megabyte of conversation, and the sidebar that\nconsumes this only needs a label and a timestamp \u2014 shipping every turn of\nevery thread to render a list would make the page slower the more the\ncustomer used it.\n\nScoped by owner AND org. Owner alone is not enough: one person can belong to\nseveral orgs, and `owner` does not change when they switch. Filtering on it\nalone would show the threads they wrote for another customer's org in this\none's playground.",
        "operationId": "list_threads",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadsPage"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/playground/threads/{thread_id}": {
      "get": {
        "tags": [
          "Playground"
        ],
        "summary": "Get Thread",
        "description": "Fetch one thread with its full message list.",
        "operationId": "get_thread",
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Thread Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Playground"
        ],
        "summary": "Update Thread",
        "description": "Update a thread. This is the autosave path \u2014 called once per turn.",
        "operationId": "update_thread",
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Thread Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateThreadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Playground"
        ],
        "summary": "Delete Thread",
        "description": "Hard delete. A thread is scratch content \u2014 there is nothing to restore it for.",
        "operationId": "delete_thread",
        "parameters": [
          {
            "name": "thread_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Thread Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/memories": {
      "post": {
        "tags": [
          "Memory"
        ],
        "summary": "Create Memory",
        "description": "Create a memory scoped to the authenticated caller's owner.",
        "operationId": "create_memory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemoryRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemorySummary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "409": {
            "description": "A memory with this slug already exists for this owner"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      },
      "get": {
        "tags": [
          "Memory"
        ],
        "summary": "List Memories",
        "description": "List memories in the caller's org (MESH-467).\n\nOrg owners/admins see every memory in the org \u2014 they are the ones who have to\nanswer a deletion request. Plain members see only their own.",
        "operationId": "list_memories",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "name": "has_item_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "preference",
                    "guardrail",
                    "fact"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Has Item Type"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MemorySummary"
                  },
                  "title": "Response List Memories"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/memories/usage": {
      "get": {
        "tags": [
          "Memory"
        ],
        "summary": "Memory Usage",
        "description": "Per-memID request counts, injected tokens, and last-used, plus embed cost.\n\nMUST stay declared ABOVE `GET /{slug_or_id}` \u2014 FastAPI matches in\ndeclaration order, so below it \"usage\" is read as a slug and this route is\nunreachable (404, from a memory nobody owns).\n\nScoped to the CALLER'S OWN keys, not the whole org, and that is the honest\nscope rather than a shortcut: injection is owner-scoped in the gateway, so a\ncolleague's memID cannot be attached by your keys at all. It also sidesteps a\nreal ambiguity \u2014 `memory_slugs` records slugs, and slugs are unique per\n(owner, slug) rather than per org, so an org-wide aggregate would silently\nmerge two members' identically-named memories into one row.\n\nEvery token figure is OUR tokenizer's estimate of what the injected block\ncost, not a provider-reported number: no upstream reports the split between\nthe memory block and the rest of the prompt. A request attaching several\nmemIDs logs ONE block size, which is split equally across them here \u2014 see\nthe subquery. Hence `injected_tokens_est`, and hence no derived dollar figure\nbeside it \u2014 see MemoryUsageRow.",
        "operationId": "memory_usage",
        "parameters": [
          {
            "name": "window_days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 90,
              "minimum": 1,
              "default": 30,
              "title": "Window Days"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryUsageResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "422": {
            "description": "window_days out of range"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/memories/counts": {
      "get": {
        "tags": [
          "Memory"
        ],
        "summary": "Memory Counts",
        "description": "Totals for the dashboard's type rail (MESH-467).\n\nScope MIRRORS ``list_memories`` \u2014 owners and admins see the whole org, plain\nmembers only their own, and legacy ``org_id IS NULL`` rows stay visible to\ntheir owner. It has to: a rail that counts rows the list then refuses to\nshow is worse than no rail, and the shared ``_visible_memory_scope`` is what\nkeeps the two from drifting apart.\n\nDeliberately unpaginated and unfiltered by search. These are the totals the\nnav shows, so they describe everything the caller can see rather than\nwhatever the current page or query happens to contain \u2014 which is the whole\nreason the dashboard stopped summing the (capped) list client-side.",
        "operationId": "memory_counts",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryCountsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/memories/{slug_or_id}": {
      "get": {
        "tags": [
          "Memory"
        ],
        "summary": "Get Memory",
        "description": "Get a single memory and its items. Must belong to the caller's owner.",
        "operationId": "get_memory",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryDetail"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory not found or not owned by caller"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Memory"
        ],
        "summary": "Update Memory",
        "description": "Update a memory's name, description, is_active, or retention. Owner-only.",
        "operationId": "update_memory",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemoryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemorySummary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory not found or not owned by caller"
          },
          "422": {
            "description": "retention_days out of range"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Memory"
        ],
        "summary": "Delete Memory",
        "description": "Hard delete a memory (cascades to its items). Owner-scoped.",
        "operationId": "delete_memory",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory not found or not owned by caller"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/memories/{slug_or_id}/items": {
      "post": {
        "tags": [
          "Memory"
        ],
        "summary": "Add Memory Item",
        "description": "Add an item (preference/guardrail/fact) to one of the caller's memories.",
        "operationId": "add_memory_item",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemoryItemRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryItemSummary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory not found or not owned by caller"
          },
          "422": {
            "description": "Invalid item_type, or blank content"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "Memory"
        ],
        "summary": "List Memory Items",
        "description": "List items for one of the caller's memories, ordered by position.",
        "operationId": "list_memory_items",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MemoryItemSummary"
                  },
                  "title": "Response List Memory Items"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory not found or not owned by caller"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/memories/{slug_or_id}/items/revive-expired": {
      "post": {
        "tags": [
          "Memory"
        ],
        "summary": "Revive Expired Items",
        "description": "Give every lapsed preference and fact in this memory a fresh deadline.\n\nRetention is enforced on READ (see ``resolver`` \u2014 it filters on\n``expires_at``), so a lapsed item is already invisible to the gateway while\nits row survives until the sweeper hard-deletes it. This is how it comes\nback, and it is memID-WIDE on purpose: a partial revival would leave someone\nbelieving a rule or fact was restored when only some of them were.\n\n``now() + retention_days``, NOT the ``created_at``-based re-stamping\n``update_memory`` does. That difference is the entire point: re-dating a\n41-day-old fact under a 30-day policy from its creation puts the new deadline\n11 days in the PAST, so it would expire again the instant it was written and\nthe button would look broken while doing exactly what it said.\n\nRetention itself is untouched \u2014 the revived items get a fresh window under\nthe SAME policy and can lapse again. Reviving must not silently rewrite a\nretention policy someone chose.\n\nGuardrails are excluded, as everywhere else: they never carry a deadline, so\nthere is nothing of theirs to revive. Mutation, so ``admin_ok=False`` \u2014 an\norg admin's extra powers are read and delete, not authoring.\n\nNo vector work. Fact search resolves its hits against the rows this UPDATE\ntouches, so an eligible row is retrievable again with nothing to re-embed.",
        "operationId": "revive_expired_items",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviveExpiredResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory not found or not owned by caller"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/memories/{slug_or_id}/items/{item_id}": {
      "patch": {
        "tags": [
          "Memory"
        ],
        "summary": "Update Memory Item",
        "description": "Edit one item's content, key, or position. Owner-only.\n\n``item_type`` is NOT editable. It decides two things at once \u2014 which section\nof the composed block the item lands in, and whether the row is mirrored\ninto Qdrant \u2014 so switching it is a delete plus a create, not an edit. In\nplace it would also strand a preference's ``key`` on a fact, where nothing\nreads it. Callers who need a different type should delete and re-add.",
        "operationId": "update_memory_item",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Item Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemoryItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryItemSummary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory or item not found or not owned by caller"
          },
          "422": {
            "description": "content must not be blank"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Memory"
        ],
        "summary": "Delete Memory Item",
        "description": "Delete a single item from one of the caller's memories. Owner-scoped.",
        "operationId": "delete_memory_item",
        "parameters": [
          {
            "name": "slug_or_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug Or Id"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Item Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "404": {
            "description": "Memory or item not found or not owned by caller"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/end-users/erasures": {
      "post": {
        "tags": [
          "End users"
        ],
        "summary": "Erase an end user's identifier",
        "description": "Removes a caller-supplied `user` identifier from the usage records it was attributed to, so a deletion request from your own end user can be passed through. Billing rows are kept and only the identifier is cleared, which is why this reports rows CLEARED rather than deleted.\n\nIdempotent: erasing an identifier that is already gone succeeds and reports `usage_events_cleared: 0`.\n\n**This is a point in time, not a lock.** Usage rows are written asynchronously after a request completes, so a request already in flight for this end user can re-attribute a row after the call returns. Erase once traffic for the identifier has stopped, or call again.",
        "operationId": "erase_end_user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ErasureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErasureResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials"
          },
          "422": {
            "description": "The caller's key is not bound to an organisation"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/api-versions": {
      "get": {
        "tags": [
          "API Versions"
        ],
        "summary": "List dated API versions",
        "description": "Every dated version this deployment serves, oldest first.\n\nSend one as `X-Mesh-Version` to pin a request, or store it on an API key to pin\nevery request that key makes. Omit it and you get the `baseline` entry.\n\nAn unsupported or malformed value is rejected with `400 invalid_api_version`\nrather than falling back silently, so a typo cannot leave you believing you are\npinned when you are not.",
        "operationId": "list_api_versions",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ApiVersionOut"
                  },
                  "type": "array",
                  "title": "Response List Api Versions"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (user JWT or API key)",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/providers/pinnable": {
      "get": {
        "tags": [
          "Providers"
        ],
        "summary": "List providers an API key can be pinned to",
        "description": "Every provider this deployment can pin a key to, by display name.\n\nStore one as an API key's `fixed_provider` to make it the only provider allowed\nto serve that key. See the provider pinning guide for what the pin does to\nfallback and to billing.\n\nA provider that serves a surface but prices no listed model is left out: pinning\nto it would refuse every request a caller could discover how to make. That makes\nthis list a strict subset of what `fixed_provider` accepts, never a superset, so\nanything offered here is valid.",
        "operationId": "list_pinnable_providers",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PinnableProviderOut"
                  },
                  "type": "array",
                  "title": "Response List Pinnable Providers"
                }
              }
            }
          },
          "503": {
            "description": "The calling key's policy names a brand wildcard and the catalog brand map is not loaded yet \u2014 retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_policy_unavailable",
                    "message": "Model policy cannot be evaluated right now. Please retry."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/providers/{provider}/models": {
      "get": {
        "tags": [
          "Providers"
        ],
        "summary": "List the models one provider serves",
        "description": "The models a key pinned to `provider` can still call.\n\nScoped to providers that can be pinned, because that is the question this\nanswers \u2014 a slug outside that set is a 404 rather than an empty list, which\nwould read as \"pinned and serves nothing\".",
        "operationId": "list_provider_models",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderModelsOut"
                }
              }
            }
          },
          "503": {
            "description": "The calling key's policy names a brand wildcard and the catalog brand map is not loaded yet \u2014 retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_policy_unavailable",
                    "message": "Model policy cannot be evaluated right now. Please retry."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/models": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List Models",
        "description": "List available models with per-user discounted pricing when applicable.\n\nOnly models registered in the `models` table with is_enabled=true are\nreturned. Accepts either a dashboard JWT or an API key.\nIncludes pricing per 1 000 tokens and a convenience ``is_free`` flag.\nIf the caller has an active discount, discounted prices are included.\nResponse is cached for 5 minutes; admin writes invalidate the cache immediately.",
        "operationId": "list_models",
        "parameters": [
          {
            "name": "free",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter: true = free models only, false = paid only, omit = all",
              "title": "Free"
            },
            "description": "Filter: true = free models only, false = paid only, omit = all"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "text",
                    "embedding",
                    "image",
                    "audio",
                    "video"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by model_type: text, embedding, image, audio, video",
              "title": "Type"
            },
            "description": "Filter by model_type: text, embedding, image, audio, video"
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by provider slug, e.g. openai, vertex, fireworks, deepseek. amazon-bedrock and azure-foundry are accepted as aliases.",
              "title": "Provider"
            },
            "description": "Filter by provider slug, e.g. openai, vertex, fireworks, deepseek. amazon-bedrock and azure-foundry are accepted as aliases."
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModelOut"
                  },
                  "title": "Response List Models"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": [
                      {
                        "id": "openai/gpt-4o-mini",
                        "name": "GPT-4o mini",
                        "brand": "openai",
                        "provider": "openai",
                        "context_length": 128000,
                        "is_free": false,
                        "pricing": {
                          "pricing_unit": "per_1m_tokens",
                          "prompt_usd_per_1m": "0.1500000",
                          "completion_usd_per_1m": "0.6000000",
                          "input_usd_per_unit": "0.1500000",
                          "output_usd_per_unit": "0.6000000",
                          "request_usd": "0.0000000"
                        },
                        "description": "Fast, affordable multimodal model for everyday tasks.",
                        "supports_thinking": false,
                        "supports_completions_api": true,
                        "supports_responses_api": true,
                        "supports_realtime": false,
                        "supports_embeddings": false,
                        "supports_tools": true,
                        "supports_structured_output": true,
                        "supports_system_prompt": true,
                        "supports_batching": true,
                        "supports_background_response": false,
                        "supports_video_generation": false,
                        "supports_image_edit": false,
                        "supports_image_inpaint": false,
                        "supports_image_outpaint": false,
                        "supports_image_mix": false,
                        "supports_image_reframe": false,
                        "supports_image_upscale": false,
                        "supports_image_remove_background": false,
                        "supports_image_reference": true,
                        "model_type": "text",
                        "input_modalities": [
                          "text",
                          "image"
                        ],
                        "output_modalities": [
                          "text"
                        ],
                        "context_window": 128000,
                        "standard_context_threshold": 64000
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (user JWT or API key)",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "500": {
            "description": "Internal error while resolving per-user discount rules",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Internal Server Error"
                }
              }
            }
          },
          "503": {
            "description": "The calling key's policy names a brand wildcard and the catalog brand map is not loaded yet \u2014 retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_policy_unavailable",
                    "message": "Model policy cannot be evaluated right now. Please retry."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/models/search": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "Search Models",
        "description": "Paginated, filterable, fuzzy-searchable model listing \u2014 server-side equivalent\nof the dashboard's former client-side table handling.\n\nEvery multi-value filter is an OR within its dimension and an AND across\ndimensions. ``facets`` counts each dimension with its own filter dropped, so\nadding a second value to a dimension always widens the result set.\n\nNote: there is intentionally no upstream-provider filter here. Which provider\nserves a model is not something a caller can pin on the inference API, so\nfiltering the catalog by it would offer a choice that doesn't exist. The\nproviders themselves are not secret \u2014 ``GET /v1/models/{model_id}/providers``\nlists them with their prices \u2014 they just aren't a dimension of this listing.",
        "operationId": "search_models",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Fuzzy search over name, id, and brand",
              "title": "Q"
            },
            "description": "Fuzzy search over name, id, and brand"
          },
          {
            "name": "free",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Plan filter: true = free only, false = paid only, omit = all",
              "title": "Free"
            },
            "description": "Plan filter: true = free only, false = paid only, omit = all"
          },
          {
            "name": "discounted",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true = discounted only, false = regular only, omit = all",
              "title": "Discounted"
            },
            "description": "true = discounted only, false = regular only, omit = all"
          },
          {
            "name": "deprecated",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "true = deprecated only, false = not deprecated only, omit = all",
              "title": "Deprecated"
            },
            "description": "true = deprecated only, false = not deprecated only, omit = all"
          },
          {
            "name": "input_modality",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Match models accepting any of these input modalities",
              "title": "Input Modality"
            },
            "description": "Match models accepting any of these input modalities"
          },
          {
            "name": "output_modality",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Match any output modality (incl. 'embedding'/'realtime' capabilities)",
              "title": "Output Modality"
            },
            "description": "Match any output modality (incl. 'embedding'/'realtime' capabilities)"
          },
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by brand (vendor)",
              "title": "Brand"
            },
            "description": "Filter by brand (vendor)"
          },
          {
            "name": "capability",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Match models whose DEFAULT price row has any of these capabilities (e.g. 'tools', 'thinking', 'image_edit'). The full vocabulary is published in the response's `facets.capability`.",
              "title": "Capability"
            },
            "description": "Match models whose DEFAULT price row has any of these capabilities (e.g. 'tools', 'thinking', 'image_edit'). The full vocabulary is published in the response's `facets.capability`."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "brand",
                "name",
                "id",
                "context_length",
                "price"
              ],
              "type": "string",
              "default": "brand",
              "title": "Sort"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Order"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelsPage"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "items": [
                        {
                          "id": "openai/gpt-4o-mini",
                          "name": "GPT-4o mini",
                          "brand": "openai",
                          "provider": "openai",
                          "context_length": 128000,
                          "is_free": false,
                          "pricing": {
                            "pricing_unit": "per_1m_tokens",
                            "prompt_usd_per_1m": "0.1500000",
                            "completion_usd_per_1m": "0.6000000",
                            "input_usd_per_unit": "0.1500000",
                            "output_usd_per_unit": "0.6000000",
                            "request_usd": "0.0000000"
                          },
                          "description": "Fast, affordable multimodal model for everyday tasks.",
                          "supports_thinking": false,
                          "supports_completions_api": true,
                          "supports_responses_api": true,
                          "supports_realtime": false,
                          "supports_embeddings": false,
                          "supports_tools": true,
                          "supports_structured_output": true,
                          "supports_system_prompt": true,
                          "supports_batching": true,
                          "supports_background_response": false,
                          "supports_video_generation": false,
                          "supports_image_edit": false,
                          "supports_image_inpaint": false,
                          "supports_image_outpaint": false,
                          "supports_image_mix": false,
                          "supports_image_reframe": false,
                          "supports_image_upscale": false,
                          "supports_image_remove_background": false,
                          "supports_image_reference": true,
                          "model_type": "text",
                          "input_modalities": [
                            "text",
                            "image"
                          ],
                          "output_modalities": [
                            "text"
                          ],
                          "context_window": 128000,
                          "standard_context_threshold": 64000
                        }
                      ],
                      "total": 1,
                      "limit": 20,
                      "offset": 0,
                      "brands": [
                        "openai"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "An unknown `capability`, or `sort=price` without exactly one priceable `output_modality`",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "invalid_search_parameter",
                    "message": "Sorting by price needs exactly one output_modality of ['image', 'text', 'video']: the catalog prices text per 1M tokens, images per image and video per second, and no rate is converted between them."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "503": {
            "description": "The calling key's policy names a brand wildcard and the catalog brand map is not loaded yet \u2014 retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_policy_unavailable",
                    "message": "Model policy cannot be evaluated right now. Please retry."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/models/{model_id}/providers": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List a model's providers and their prices",
        "description": "Every upstream provider that can serve this model, with that provider's own\nprice and capabilities.\n\n``GET /v1/models`` and ``GET /v1/models/{model_id}`` publish only the default\nprice row \u2014 what a bare ``model`` string bills at. A model routed through\nseveral providers has a different rate on each, and resilient routing can\nfall back between them, so this endpoint lists them all.\n\nWhich of them is the default is NOT published, by neither field nor position:\nit is a routing decision we re-make freely, and naming it would invite\ncallers to depend on a specific upstream. Rows come back alphabetically.\n\nDiscounts are resolved per row: the caller's model-scoped, provider-scoped,\nand account-wide discounts all apply here, and the largest wins \u2014 so a\ndiscount attached to one provider shows up only on that provider's row.",
        "operationId": "list_model_providers",
        "parameters": [
          {
            "name": "model_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Model Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModelProviderOut"
                  },
                  "title": "Response List Model Providers"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (user JWT or API key)",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "403": {
            "description": "The calling key's model policy excludes this model (`model_excluded`), or records no brand for it so a brand policy cannot be applied (`model_brand_unknown`)",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_excluded",
                    "message": "Model 'openai/gpt-4o' is excluded for this API key. Ask your organization admin to allow it for this key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "404": {
            "description": "Model not found",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Model not found"
                }
              }
            }
          },
          "503": {
            "description": "The calling key's policy names a brand wildcard and the catalog brand map is not loaded yet \u2014 retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_policy_unavailable",
                    "message": "Model policy cannot be evaluated right now. Please retry."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/models/{model_id}": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "Get Model",
        "description": "Return a single enabled model by its model ID with per-user discounted pricing.\n\nServed from the same Redis cache as GET /v1/models \u2014 no additional DB queries\nwhen the cache is warm. Discounts are applied per-user and not cached.",
        "operationId": "get_model",
        "parameters": [
          {
            "name": "model_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Model Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelOut"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "id": "openai/gpt-4o-mini",
                      "name": "GPT-4o mini",
                      "brand": "openai",
                      "provider": "openai",
                      "context_length": 128000,
                      "is_free": false,
                      "pricing": {
                        "pricing_unit": "per_1m_tokens",
                        "prompt_usd_per_1m": "0.1500000",
                        "completion_usd_per_1m": "0.6000000",
                        "input_usd_per_unit": "0.1500000",
                        "output_usd_per_unit": "0.6000000",
                        "request_usd": "0.0000000"
                      },
                      "description": "Fast, affordable multimodal model for everyday tasks.",
                      "supports_thinking": false,
                      "supports_completions_api": true,
                      "supports_responses_api": true,
                      "supports_realtime": false,
                      "supports_embeddings": false,
                      "supports_tools": true,
                      "supports_structured_output": true,
                      "supports_system_prompt": true,
                      "supports_batching": true,
                      "supports_background_response": false,
                      "supports_video_generation": false,
                      "supports_image_edit": false,
                      "supports_image_inpaint": false,
                      "supports_image_outpaint": false,
                      "supports_image_mix": false,
                      "supports_image_reframe": false,
                      "supports_image_upscale": false,
                      "supports_image_remove_background": false,
                      "supports_image_reference": true,
                      "model_type": "text",
                      "input_modalities": [
                        "text",
                        "image"
                      ],
                      "output_modalities": [
                        "text"
                      ],
                      "context_window": 128000,
                      "standard_context_threshold": 64000
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials (user JWT or API key)",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or missing API key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "403": {
            "description": "The calling key's model policy excludes this model (`model_excluded`), or records no brand for it so a brand policy cannot be applied (`model_brand_unknown`)",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_excluded",
                    "message": "Model 'openai/gpt-4o' is excluded for this API key. Ask your organization admin to allow it for this key."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "404": {
            "description": "Model not found",
            "content": {
              "application/json": {
                "example": {
                  "detail": "Model not found"
                }
              }
            }
          },
          "503": {
            "description": "The calling key's policy names a brand wildcard and the catalog brand map is not loaded yet \u2014 retry",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_policy_unavailable",
                    "message": "Model policy cannot be evaluated right now. Please retry."
                  },
                  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/files": {
      "get": {
        "tags": [
          "RAG"
        ],
        "summary": "List Files",
        "description": "List the files you have uploaded, newest first.\n\nScoped to the authenticated caller and the org they are acting in \u2014 you only ever\nsee your own files, and only those uploaded in the current org. Each entry\ncarries the same fields as `GET /v1/files/{file_id}`, including the embedding\nstatus, so you can poll this instead of one file at a time.\n\nPaginate with `limit` (1\u2013200, default 50) and `offset`; `total` is the unpaginated\ncount.",
        "operationId": "list_files",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileListResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "files": [
                        {
                          "file_id": "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T",
                          "upload_status": "uploaded",
                          "file_name": "project_proposal.pdf",
                          "file_type": "pdf",
                          "mime_type": "application/pdf",
                          "status": "ready",
                          "size_bytes": 245760,
                          "asset_url": "gs://meshapi-uploads/file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T/project_proposal.pdf",
                          "signed_url": null,
                          "signed_url_expires_at": null,
                          "embedding_status": "completed",
                          "created_at": "2026-07-02T10:15:30Z",
                          "updated_at": "2026-07-02T10:16:05Z",
                          "total_tokens": 640,
                          "total_cost_usd": 8e-05,
                          "last_error_code": null
                        }
                      ],
                      "total": 1,
                      "limit": 20,
                      "offset": 0
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "RAG"
        ],
        "summary": "Init Upload",
        "description": "Start a file upload and get a signed URL to PUT the bytes to.\n\nThis call does not carry the file itself. It returns a `signed_url`, the\n`required_headers` you must send with it, an `expires_at`, and the `max_size_bytes`\nceiling. Upload the bytes directly to that URL, then poll\n`GET /v1/files/{file_id}` for the status.\n\nWith `embed` true (the default) the file is chunked and embedded once the bytes\nland, which makes it searchable through `POST /v1/files/search`. Any `metadata` you\npass is stored per chunk and can be filtered on at search time.\n\nAccepted types: any `text/*`, PDF, DOC/DOCX, XLS/XLSX, PPTX, JSON, XML, SQL.\nAnything else is a 422 here, before you spend bandwidth on the upload.\n\n`text/*` is taken at face value: a text subtype with no dedicated parser \u2014 `text/rtf`\nis the one to watch \u2014 is chunked exactly as sent, so its markup ends up in the\nembeddings alongside the prose and dilutes search results. Convert such files to\nplain text or PDF before uploading.",
        "operationId": "init_upload",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitUploadRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "file_name": "project_proposal.pdf",
                    "mime_type": "application/pdf",
                    "embed": true,
                    "metadata": {
                      "source": "docs"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitUploadResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "file_id": "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T",
                      "signed_url": "https://storage.googleapis.com/meshapi-uploads/project_proposal.pdf?X-Goog-Signature=...",
                      "expires_at": "2026-07-02T10:30:30Z"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/files/{file_id}": {
      "get": {
        "tags": [
          "RAG"
        ],
        "summary": "Get File Status",
        "description": "Get one file's processing status, and a short-lived download URL for it.\n\nPoll this after uploading the bytes: a file is only searchable once embedding has\nfinished. A failure reports why here rather than by disappearing from the list.\n\nA file that is not yours answers **404**, not 403 \u2014 the response deliberately does\nnot confirm that someone else's `file_id` exists.",
        "operationId": "get_file_status",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileStatusResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "file_id": "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T",
                      "upload_status": "uploaded",
                      "file_name": "project_proposal.pdf",
                      "file_type": "pdf",
                      "mime_type": "application/pdf",
                      "status": "ready",
                      "size_bytes": 245760,
                      "asset_url": "gs://meshapi-uploads/file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T/project_proposal.pdf",
                      "signed_url": null,
                      "signed_url_expires_at": null,
                      "embedding_status": "completed",
                      "created_at": "2026-07-02T10:15:30Z",
                      "updated_at": "2026-07-02T10:16:05Z",
                      "total_tokens": 640,
                      "total_cost_usd": 8e-05,
                      "last_error_code": null
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "RAG"
        ],
        "summary": "Delete File",
        "description": "Delete a file: purge its vectors, delete the object, soft-delete the row.\n\nOrdering is load-bearing and fail-closed on the first step:\n\n  1. Qdrant points \u2014 retrieval filters on the Qdrant payload, NOT this table,\n     so vectors that outlive the row would keep serving the document's content\n     in search. A failure here aborts with 5xx and the row stays live, so the\n     client can retry; the alternative (mark deleted, leave vectors) is a\n     delete that silently didn't delete.\n  2. GCS object \u2014 best-effort by design (delete_gcs_object never raises). The\n     signed download URL is already unreachable once the row is gone, and a\n     stranded blob is a storage cost, not a disclosure.\n  3. The row \u2014 soft-deleted so usage_events.file_id stays resolvable for\n     billing history.\n\nEvery step is idempotent and the whole handler is safely retryable, which is\nwhat makes a failure recoverable rather than terminal. The final purge runs\nAFTER deleted_at is committed, so if Qdrant is down at that moment the row is\nalready hidden \u2014 a retry that could not see it would 404 forever and leave\nany vectors an in-flight worker wrote stranded and searchable. So the lookup\nhere deliberately includes soft-deleted rows: a retry re-runs the purge and\nconverges. An unknown file_id is still a 404; an already-deleted one is 204.",
        "operationId": "delete_file",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Id"
            }
          },
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/v1/files/embed": {
      "post": {
        "tags": [
          "RAG"
        ],
        "summary": "Trigger Embedding Bulk",
        "description": "Manually enqueue embedding jobs for one or more files.\n\nEach file must have upload_status=ready and embedding_status=pending or failed.\nReturns a per-file result \u2014 successes are 'queued', failures include an error message.",
        "operationId": "trigger_embedding_bulk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkEmbedRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "file_ids": [
                      "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T"
                    ],
                    "wait": false,
                    "metadata": {
                      "source": "docs"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkEmbedResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "results": [
                        {
                          "file_id": "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T",
                          "embedding_status": "queued",
                          "chunk_count": null,
                          "error": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/files/search": {
      "post": {
        "tags": [
          "RAG"
        ],
        "summary": "Vector Search",
        "description": "Search your uploaded files and get back the matching passages.\n\nHybrid retrieval: dense (embedding) and sparse (keyword) matches are fused with\nreciprocal rank fusion, so exact terms and paraphrases both work. Results are\nchunks, each with its `file_id`, score and stored metadata \u2014 ready to drop into a\nprompt as context.\n\nNarrow the search with `file_ids`, a `filter` on the metadata you supplied at\nupload, or a `date_from` / `date_to` window. `top_k` defaults to 5 (max 50).\n\nOnly files uploaded with `embed` are searchable. **Each call embeds your query, so\nit is a billed request** \u2014 it counts against your rate limits and spend caps like\nany inference call.",
        "operationId": "vector_search",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "query": "What are the project milestones?",
                    "top_k": 5,
                    "file_ids": [
                      "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "results": [
                        {
                          "file_id": "file_01JZ0S3N6M8ZQ8DGK9VY1R2H3T",
                          "file_name": "project_proposal.pdf",
                          "file_type": "pdf",
                          "mime_type": "application/pdf",
                          "chunk_index": 3,
                          "created_at": 1783001227,
                          "score": 0.92,
                          "text": "Milestone 1 is the design review, followed by implementation.",
                          "parent_text": "The project milestones are design review, implementation, and launch.",
                          "metadata": {
                            "page": 2
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    },
    "/v1/web/search": {
      "post": {
        "tags": [
          "Web Search"
        ],
        "summary": "Web Search",
        "description": "Search the live web and get back ranked results with snippets.\n\nTwo engines sit behind this: the native engine is tried first and Tavily is the\nfallback, so a single engine outage does not fail your request. Pin one with\n`provider` when you need reproducibility \u2014 pinning disables that failover.\n\nShape results with `max_results` (1\u201320), `include_domains` / `exclude_domains`, and\n`search_depth` (`advanced` costs more and only affects Tavily; the native engine\nignores it). The response says which engine answered.\n\n`model` exists only to name the native engine explicitly. It is not a model\nselector \u2014 the native engine has no model concept \u2014 and an unrecognised value is\nrejected with a 422 rather than silently ignored.",
        "operationId": "web_search",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebSearchRequest"
              },
              "examples": {
                "default": {
                  "summary": "Example request",
                  "value": {
                    "query": "latest James Webb telescope discoveries",
                    "model": "perplexity/sonar",
                    "max_results": 5,
                    "include_answer": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebSearchResponse"
                },
                "examples": {
                  "default": {
                    "summary": "Example response",
                    "value": {
                      "query": "latest James Webb telescope discoveries",
                      "answer": "Recent JWST observations include early-galaxy candidates and new exoplanet atmosphere measurements.",
                      "results": [
                        {
                          "title": "JWST spots an early galaxy candidate",
                          "url": "https://example.com/jwst",
                          "content": "Astronomers using JWST reported a distant galaxy candidate...",
                          "score": 0.93
                        }
                      ],
                      "provider": "native",
                      "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "X-Mesh-Version",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-08",
                "2026-09"
              ],
              "default": "2026-08"
            },
            "example": "2026-09",
            "description": "Dated version of the API contract to pin this request to. Omit it and the request is served under `2026-08` \u2014 the oldest supported version, so an existing integration is never moved by a release. A malformed or unsupported value is rejected with `400 invalid_api_version` rather than falling back silently. The version actually served is echoed as `X-Mesh-Version` on every response, including errors."
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptInvitationRequest": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "leave_current_org": {
            "type": "boolean",
            "title": "Leave Current Org",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "token"
        ],
        "title": "AcceptInvitationRequest"
      },
      "AcceptInvitationResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_name",
          "role",
          "user_id"
        ],
        "title": "AcceptInvitationResponse"
      },
      "AccessScope": {
        "type": "integer",
        "enum": [
          0,
          1,
          2
        ],
        "title": "AccessScope",
        "description": "How many rows a permission reaches. ORDERED \u2014 compare with ``>=``.\n\nScope is a FILTER, not a gate. The permission answers \"may you read usage\nbeyond your own\"; the scope answers \"whose\". Keeping them separate is what\nstops the permission enum tripling into ``usage:read:self|team|org``, and it\nputs the row restriction in the data layer where a shared helper can own it."
      },
      "AddTeamMemberRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "default": "member"
          }
        },
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "AddTeamMemberRequest"
      },
      "AdjudicationReadoutOut": {
        "properties": {
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "window_days": {
            "type": "integer",
            "title": "Window Days"
          },
          "window_start": {
            "type": "string",
            "title": "Window Start"
          },
          "generated_at": {
            "type": "string",
            "title": "Generated At"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "outcome_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Outcome Counts"
          },
          "contradicts_all": {
            "type": "integer",
            "title": "Contradicts All"
          },
          "contradicts_all_share": {
            "type": "string",
            "title": "Contradicts All Share"
          },
          "resolved_share": {
            "type": "string",
            "title": "Resolved Share"
          },
          "enforced": {
            "type": "integer",
            "title": "Enforced"
          },
          "shadow": {
            "type": "integer",
            "title": "Shadow"
          },
          "auto_applied": {
            "type": "integer",
            "title": "Auto Applied"
          },
          "tolerance_pct": {
            "type": "string",
            "title": "Tolerance Pct"
          },
          "precondition_samples": {
            "type": "integer",
            "title": "Precondition Samples"
          },
          "precondition_p95": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precondition P95"
          },
          "precondition_p50": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precondition P50"
          },
          "precondition_max": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precondition Max"
          },
          "precondition_verdict": {
            "type": "string",
            "title": "Precondition Verdict"
          },
          "precondition_notes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Precondition Notes"
          },
          "observed_samples": {
            "type": "integer",
            "title": "Observed Samples"
          },
          "observed_p95": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed P95"
          },
          "nearest_contradicted_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nearest Contradicted Pct"
          },
          "sample_days": {
            "type": "integer",
            "title": "Sample Days"
          },
          "span_days": {
            "type": "integer",
            "title": "Span Days"
          },
          "first_seen": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen"
          },
          "last_seen": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen"
          },
          "alert_status": {
            "type": "string",
            "title": "Alert Status"
          },
          "alert_share_threshold": {
            "type": "string",
            "title": "Alert Share Threshold"
          },
          "alert_min_volume": {
            "type": "integer",
            "title": "Alert Min Volume"
          },
          "alert_summary": {
            "type": "string",
            "title": "Alert Summary"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "window_days",
          "window_start",
          "generated_at",
          "total",
          "outcome_counts",
          "contradicts_all",
          "contradicts_all_share",
          "resolved_share",
          "enforced",
          "shadow",
          "auto_applied",
          "tolerance_pct",
          "precondition_samples",
          "precondition_p95",
          "precondition_p50",
          "precondition_max",
          "precondition_verdict",
          "precondition_notes",
          "observed_samples",
          "observed_p95",
          "nearest_contradicted_pct",
          "sample_days",
          "span_days",
          "first_seen",
          "last_seen",
          "alert_status",
          "alert_share_threshold",
          "alert_min_volume",
          "alert_summary"
        ],
        "title": "AdjudicationReadoutOut",
        "description": "MESH-558: the probe-adjudication readout.\n\nRatios cross the wire as STRINGS, the same money/precision convention the\nrest of this router uses \u2014 a float `contradicts_all_share` would round the\nvery quantity a flip decision is argued from."
      },
      "AdminAutoRechargeOut": {
        "properties": {
          "recharge_amount_usd": {
            "type": "string",
            "title": "Recharge Amount Usd"
          },
          "threshold_usd": {
            "type": "string",
            "title": "Threshold Usd"
          },
          "last_triggered_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Triggered At"
          }
        },
        "type": "object",
        "required": [
          "recharge_amount_usd",
          "threshold_usd"
        ],
        "title": "AdminAutoRechargeOut"
      },
      "AdminCouponCreateRequest": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "discount_type": {
            "type": "string",
            "enum": [
              "percentage",
              "flat"
            ],
            "title": "Discount Type"
          },
          "discount_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Discount Value"
          },
          "maximum_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maximum Amount"
          },
          "min_purchase_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Purchase Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "INR"
          },
          "reuse_policy": {
            "type": "string",
            "enum": [
              "single_use",
              "reusable"
            ],
            "title": "Reuse Policy",
            "default": "single_use"
          },
          "max_uses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Uses"
          },
          "valid_till": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Till"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "is_public": {
            "type": "boolean",
            "title": "Is Public",
            "default": false
          },
          "user_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "User Ids"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "discount_type",
          "discount_value"
        ],
        "title": "AdminCouponCreateRequest"
      },
      "AdminCouponUpdateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "discount_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "percentage",
                  "flat"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Type"
          },
          "discount_value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Value"
          },
          "maximum_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maximum Amount"
          },
          "min_purchase_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Purchase Amount"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "reuse_policy": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "single_use",
                  "reusable"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Reuse Policy"
          },
          "max_uses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Uses"
          },
          "valid_till": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Till"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "is_public": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Public"
          },
          "user_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Ids"
          }
        },
        "type": "object",
        "title": "AdminCouponUpdateRequest",
        "description": "Coupons are managed entirely in the backend, so every field is editable."
      },
      "AdminCreatePlatformKeyRequest": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_platform_default": {
            "type": "boolean",
            "title": "Is Platform Default",
            "default": false
          },
          "routing_weight": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Routing Weight",
            "default": 0
          },
          "access_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Key Id"
          },
          "secret_access_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Access Key"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          },
          "service_account_json": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Account Json"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          }
        },
        "type": "object",
        "required": [
          "provider"
        ],
        "title": "AdminCreatePlatformKeyRequest",
        "description": "Create shape per provider (mirrors the BYOK routers' credential shapes):\n\n- string-bearer providers (openai/qwen/\u2026): ``api_key``\n- bedrock \u2014 bearer mode: ``api_key`` (+ optional ``region``)\n- bedrock \u2014 IAM mode: ``access_key_id`` + ``secret_access_key`` (+ ``region``)\n- vertex: ``service_account_json`` (full SA JSON; project auto-derived,\n  optional ``region``)\n- azure_foundry: ``api_key`` + ``endpoint`` (https)"
      },
      "AdminFindingThresholdOverride": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "value": {
            "type": "number",
            "title": "Value"
          },
          "default": {
            "type": "number",
            "title": "Default"
          }
        },
        "type": "object",
        "required": [
          "key",
          "value",
          "default"
        ],
        "title": "AdminFindingThresholdOverride"
      },
      "AdminIncidentOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "severity": {
            "type": "string",
            "title": "Severity"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "affected_components": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Affected Components"
          },
          "scheduled_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Start"
          },
          "scheduled_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled End"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "updates": {
            "items": {
              "$ref": "#/components/schemas/IncidentUpdateOut"
            },
            "type": "array",
            "title": "Updates"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "type",
          "severity",
          "status",
          "affected_components",
          "scheduled_start",
          "scheduled_end",
          "created_at",
          "updated_at",
          "updates"
        ],
        "title": "AdminIncidentOut",
        "description": "The public incident shape plus the one field only operators see.\n\nA subclass rather than a field on `IncidentOut`, because that model is what\n`/status/incidents` and the RSS feed serve: `deleted_at` there would be a\npermanently-null key on a public API (the public surface can never show a\nwithdrawn incident), and a null key is a promise that something might one day\nappear in it."
      },
      "AdminKeyCreateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "masked_key": {
            "type": "string",
            "title": "Masked Key"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "scope": {
            "type": "string",
            "enum": [
              "self",
              "team",
              "org"
            ]
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "revoked_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked By"
          },
          "revoked_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked Reason"
          },
          "rotated_from_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rotated From Id"
          },
          "created_by": {
            "type": "string",
            "title": "Created By"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "masked_key",
          "permissions",
          "scope",
          "team_id",
          "org_id",
          "expires_at",
          "revoked_at",
          "revoked_by",
          "revoked_reason",
          "rotated_from_id",
          "created_by",
          "last_used_at",
          "created_at",
          "key"
        ],
        "title": "AdminKeyCreateResponse"
      },
      "AdminKeyOverridesOut": {
        "properties": {
          "total_keys": {
            "type": "integer",
            "title": "Total Keys",
            "default": 0
          },
          "pii_policy": {
            "type": "integer",
            "title": "Pii Policy",
            "default": 0
          },
          "pii_policy_opt_out": {
            "type": "integer",
            "title": "Pii Policy Opt Out",
            "default": 0
          },
          "body_log_policy": {
            "type": "integer",
            "title": "Body Log Policy",
            "default": 0
          },
          "body_log_policy_opt_out": {
            "type": "integer",
            "title": "Body Log Policy Opt Out",
            "default": 0
          },
          "fixed_provider": {
            "type": "integer",
            "title": "Fixed Provider",
            "default": 0
          },
          "routing_policy": {
            "type": "integer",
            "title": "Routing Policy",
            "default": 0
          },
          "routing_policy_inline": {
            "type": "integer",
            "title": "Routing Policy Inline",
            "default": 0
          },
          "routing_policy_template": {
            "type": "integer",
            "title": "Routing Policy Template",
            "default": 0
          },
          "allowed_models": {
            "type": "integer",
            "title": "Allowed Models",
            "default": 0
          },
          "scopes": {
            "type": "integer",
            "title": "Scopes",
            "default": 0
          },
          "api_version": {
            "type": "integer",
            "title": "Api Version",
            "default": 0
          },
          "cache_override": {
            "type": "integer",
            "title": "Cache Override",
            "default": 0
          },
          "fixed_providers": {
            "items": {
              "$ref": "#/components/schemas/AdminValueCount"
            },
            "type": "array",
            "title": "Fixed Providers",
            "default": []
          },
          "routing_templates": {
            "items": {
              "$ref": "#/components/schemas/AdminValueCount"
            },
            "type": "array",
            "title": "Routing Templates",
            "default": []
          },
          "api_versions": {
            "items": {
              "$ref": "#/components/schemas/AdminValueCount"
            },
            "type": "array",
            "title": "Api Versions",
            "default": []
          }
        },
        "type": "object",
        "title": "AdminKeyOverridesOut",
        "description": "How many of the org's keys set their own value instead of the org/global default."
      },
      "AdminKeySummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "masked_key": {
            "type": "string",
            "title": "Masked Key"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "scope": {
            "type": "string",
            "enum": [
              "self",
              "team",
              "org"
            ]
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "revoked_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked By"
          },
          "revoked_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked Reason"
          },
          "rotated_from_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rotated From Id"
          },
          "created_by": {
            "type": "string",
            "title": "Created By"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "masked_key",
          "permissions",
          "scope",
          "team_id",
          "org_id",
          "expires_at",
          "revoked_at",
          "revoked_by",
          "revoked_reason",
          "rotated_from_id",
          "created_by",
          "last_used_at",
          "created_at"
        ],
        "title": "AdminKeySummary"
      },
      "AdminMeOut": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "roles": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Roles",
            "description": "Internal roles held by the caller. Empty for a customer."
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions",
            "description": "`roles` expanded through the server-side catalog. The SPA gates on this."
          },
          "is_super_admin": {
            "type": "boolean",
            "title": "Is Super Admin",
            "description": "May grant and revoke roles. Not a permission \u2014 see the RBAC design, D7.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "AdminMeOut"
      },
      "AdminModelsPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ModelRegistryOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "AdminModelsPage",
        "description": "Paginated envelope returned by ``GET /admin/models/search``."
      },
      "AdminOrgDetailOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "created_by": {
            "type": "string",
            "title": "Created By"
          },
          "created_by_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Email"
          },
          "org_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpm Limit"
          },
          "org_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpd Limit"
          },
          "org_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Tpm Limit"
          },
          "org_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Spend Cap"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count"
          },
          "team_count": {
            "type": "integer",
            "title": "Team Count"
          },
          "key_count": {
            "type": "integer",
            "title": "Key Count"
          },
          "zero_data_retention": {
            "type": "boolean",
            "title": "Zero Data Retention",
            "default": false
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          },
          "members": {
            "items": {
              "$ref": "#/components/schemas/AdminOrgMemberOut"
            },
            "type": "array",
            "title": "Members"
          },
          "teams": {
            "items": {
              "$ref": "#/components/schemas/AdminTeamOut"
            },
            "type": "array",
            "title": "Teams"
          },
          "pending_invitations": {
            "type": "integer",
            "title": "Pending Invitations"
          },
          "default_api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Api Version"
          },
          "default_pii_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Pii Policy"
          },
          "default_body_log_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Body Log Policy"
          },
          "finding_threshold_overrides": {
            "items": {
              "$ref": "#/components/schemas/AdminFindingThresholdOverride"
            },
            "type": "array",
            "title": "Finding Threshold Overrides",
            "default": []
          },
          "key_overrides": {
            "$ref": "#/components/schemas/AdminKeyOverridesOut",
            "default": {
              "total_keys": 0,
              "pii_policy": 0,
              "pii_policy_opt_out": 0,
              "body_log_policy": 0,
              "body_log_policy_opt_out": 0,
              "fixed_provider": 0,
              "routing_policy": 0,
              "routing_policy_inline": 0,
              "routing_policy_template": 0,
              "allowed_models": 0,
              "scopes": 0,
              "api_version": 0,
              "cache_override": 0,
              "fixed_providers": [],
              "routing_templates": [],
              "api_versions": []
            }
          },
          "features": {
            "$ref": "#/components/schemas/AdminOrgFeaturesOut",
            "default": {
              "byok_providers": [],
              "custom_roles": [],
              "routing_templates": [],
              "alert_channels": [],
              "alert_policies": []
            }
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "created_by",
          "org_rpm_limit",
          "org_rpd_limit",
          "org_tpm_limit",
          "org_spend_cap",
          "balance_usd",
          "member_count",
          "team_count",
          "key_count",
          "created_at",
          "updated_at",
          "members",
          "teams",
          "pending_invitations"
        ],
        "title": "AdminOrgDetailOut"
      },
      "AdminOrgFeaturesOut": {
        "properties": {
          "byok_providers": {
            "items": {
              "$ref": "#/components/schemas/AdminValueCount"
            },
            "type": "array",
            "title": "Byok Providers",
            "default": []
          },
          "custom_roles": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Custom Roles",
            "default": []
          },
          "routing_templates": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Routing Templates",
            "default": []
          },
          "alert_channels": {
            "items": {
              "$ref": "#/components/schemas/AdminValueCount"
            },
            "type": "array",
            "title": "Alert Channels",
            "default": []
          },
          "alert_policies": {
            "items": {
              "$ref": "#/components/schemas/AdminValueCount"
            },
            "type": "array",
            "title": "Alert Policies",
            "default": []
          },
          "auto_recharge": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdminAutoRechargeOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "AdminOrgFeaturesOut",
        "description": "What the org has configured. Enabled/active rows only."
      },
      "AdminOrgMemberOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          },
          "joined_at": {
            "type": "string",
            "title": "Joined At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "role",
          "member_rpm_limit",
          "member_rpd_limit",
          "member_tpm_limit",
          "member_spend_cap",
          "joined_at"
        ],
        "title": "AdminOrgMemberOut"
      },
      "AdminOrgOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "created_by": {
            "type": "string",
            "title": "Created By"
          },
          "created_by_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Email"
          },
          "org_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpm Limit"
          },
          "org_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpd Limit"
          },
          "org_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Tpm Limit"
          },
          "org_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Spend Cap"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count"
          },
          "team_count": {
            "type": "integer",
            "title": "Team Count"
          },
          "key_count": {
            "type": "integer",
            "title": "Key Count"
          },
          "zero_data_retention": {
            "type": "boolean",
            "title": "Zero Data Retention",
            "default": false
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "created_by",
          "org_rpm_limit",
          "org_rpd_limit",
          "org_tpm_limit",
          "org_spend_cap",
          "balance_usd",
          "member_count",
          "team_count",
          "key_count",
          "created_at",
          "updated_at"
        ],
        "title": "AdminOrgOut"
      },
      "AdminOrgTierOut": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "rate_limit_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Tier"
          },
          "self_service_max_rpm": {
            "type": "integer",
            "title": "Self Service Max Rpm"
          },
          "self_service_max_rpd": {
            "type": "integer",
            "title": "Self Service Max Rpd"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "rate_limit_tier",
          "self_service_max_rpm",
          "self_service_max_rpd"
        ],
        "title": "AdminOrgTierOut"
      },
      "AdminOrgUsageSummary": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "api_calls": {
            "type": "integer",
            "title": "Api Calls"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_byok_platform_fee_usd": {
            "type": "string",
            "title": "Total Byok Platform Fee Usd",
            "default": "0"
          },
          "month_api_calls": {
            "type": "integer",
            "title": "Month Api Calls",
            "default": 0
          },
          "month_cost_usd": {
            "type": "string",
            "title": "Month Cost Usd",
            "default": "0"
          },
          "month_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Month Tokens"
          },
          "month_byok_requests": {
            "type": "integer",
            "title": "Month Byok Requests",
            "default": 0
          },
          "month_byok_platform_fee_usd": {
            "type": "string",
            "title": "Month Byok Platform Fee Usd",
            "default": "0"
          },
          "last_activity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity"
          },
          "cached_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached At"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "api_calls",
          "total_cost_usd"
        ],
        "title": "AdminOrgUsageSummary",
        "description": "What an organisation consumed, for the org-detail usage tiles.\n\nDeliberately NOT `UserDetailSummary` with a different id in it. That shape is\nhalf wallet (balance, total paid, spend derived from recharges minus balance)\nand an org has no wallet of its own \u2014 billing pools to the payer, so the only\nbalance in play is the owner's personal one, which `/admin/orgs/{id}` already\nreports and which also funds that person's non-org usage. Reporting it here a\nsecond time under an org-shaped name would invite exactly the reconciliation\nnobody can make add up.\n\nSo spend here is `sum(cost_usd)` over the org's events \u2014 what the org actually\nconsumed \u2014 not a wallet delta. It is a different measure from the user page's\n\"Total Spend\" and the tile says so."
      },
      "AdminOrgsPage": {
        "properties": {
          "orgs": {
            "items": {
              "$ref": "#/components/schemas/AdminOrgOut"
            },
            "type": "array",
            "title": "Orgs"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "orgs",
          "total",
          "page",
          "page_size"
        ],
        "title": "AdminOrgsPage"
      },
      "AdminPlatformKeyOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "secret_ref": {
            "type": "string",
            "title": "Secret Ref"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "is_platform_default": {
            "type": "boolean",
            "title": "Is Platform Default"
          },
          "routing_weight": {
            "type": "integer",
            "title": "Routing Weight"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "secret_reachable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Reachable"
          },
          "secret_console_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Console Url"
          },
          "credential_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Type"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id"
          },
          "model_override_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Override Count"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider",
          "secret_ref",
          "label",
          "is_active",
          "is_platform_default",
          "routing_weight",
          "created_at"
        ],
        "title": "AdminPlatformKeyOut"
      },
      "AdminPlatformKeyProviderOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "credential_shape": {
            "type": "string",
            "title": "Credential Shape"
          },
          "takes_account_id": {
            "type": "boolean",
            "title": "Takes Account Id",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "provider",
          "credential_shape"
        ],
        "title": "AdminPlatformKeyProviderOut",
        "description": "One selectable provider for the create/rotate forms."
      },
      "AdminProviderKeyOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "secret_ref": {
            "type": "string",
            "title": "Secret Ref"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "secret_reachable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Reachable"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "provider",
          "secret_ref",
          "label",
          "is_active",
          "created_at"
        ],
        "title": "AdminProviderKeyOut"
      },
      "AdminRagFile": {
        "properties": {
          "file_id": {
            "type": "string",
            "title": "File Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "file_type": {
            "type": "string",
            "title": "File Type"
          },
          "mime_type": {
            "type": "string",
            "title": "Mime Type"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "upload_status": {
            "type": "string",
            "title": "Upload Status"
          },
          "embedding_status": {
            "type": "string",
            "title": "Embedding Status"
          },
          "signed_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Url"
          },
          "asset_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Url"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost Usd"
          },
          "last_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error Code"
          }
        },
        "type": "object",
        "required": [
          "file_id",
          "user_id",
          "file_name",
          "file_type",
          "mime_type",
          "size_bytes",
          "upload_status",
          "embedding_status",
          "signed_url",
          "asset_url",
          "created_at",
          "updated_at",
          "total_tokens",
          "total_cost_usd",
          "last_error_code"
        ],
        "title": "AdminRagFile"
      },
      "AdminRagFileList": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/AdminRagFile"
            },
            "type": "array",
            "title": "Files"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "files",
          "total",
          "limit",
          "offset"
        ],
        "title": "AdminRagFileList"
      },
      "AdminRequestVideoTaskOut": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "queued | running | succeeded | failed | expired | cancelled."
          },
          "video_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Url",
            "description": "Signed URL of the generated video. Expires."
          },
          "last_frame_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Frame Url"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration",
            "description": "Requested length, in seconds."
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "billed_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Seconds"
          },
          "billed_resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Resolution"
          },
          "settled": {
            "type": "boolean",
            "title": "Settled",
            "description": "Usage for the task has been billed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "provider_model_id": {
            "type": "string",
            "title": "Provider Model Id"
          },
          "provider_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Error Code"
          },
          "provider_error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Error Message"
          }
        },
        "type": "object",
        "required": [
          "task_id",
          "status",
          "settled",
          "created_at",
          "provider",
          "provider_model_id"
        ],
        "title": "AdminRequestVideoTaskOut",
        "description": "Operator view: adds the serving provider and the unscrubbed upstream error."
      },
      "AdminTeamOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "team_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpm Limit"
          },
          "team_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpd Limit"
          },
          "team_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Tpm Limit"
          },
          "team_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Spend Cap"
          },
          "member_count": {
            "type": "integer",
            "title": "Member Count"
          },
          "effective_admin_count": {
            "type": "integer",
            "title": "Effective Admin Count"
          },
          "api_key_count": {
            "type": "integer",
            "title": "Api Key Count"
          },
          "template_count": {
            "type": "integer",
            "title": "Template Count"
          },
          "provider_key_count": {
            "type": "integer",
            "title": "Provider Key Count"
          },
          "model_request_count": {
            "type": "integer",
            "title": "Model Request Count"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "name",
          "slug",
          "is_default",
          "team_rpm_limit",
          "team_rpd_limit",
          "team_tpm_limit",
          "team_spend_cap",
          "member_count",
          "effective_admin_count",
          "api_key_count",
          "template_count",
          "provider_key_count",
          "model_request_count",
          "created_at"
        ],
        "title": "AdminTeamOut"
      },
      "AdminUpdatePlatformKeyRequest": {
        "properties": {
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "is_platform_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Platform Default"
          },
          "routing_weight": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Weight"
          },
          "access_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Key Id"
          },
          "secret_access_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Access Key"
          },
          "service_account_json": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Account Json"
          },
          "account_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Account Id"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          }
        },
        "type": "object",
        "title": "AdminUpdatePlatformKeyRequest",
        "description": "Rotate the secret (same per-provider field shapes as create), toggle\nis_active, set the label, or make the key the provider's default."
      },
      "AdminUserOrgOut": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "custom_roles": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Custom Roles"
          },
          "key_count": {
            "type": "integer",
            "title": "Key Count"
          },
          "balance_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Balance Usd"
          },
          "joined_at": {
            "type": "string",
            "title": "Joined At"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "name",
          "slug",
          "role",
          "key_count",
          "joined_at"
        ],
        "title": "AdminUserOrgOut",
        "description": "One organisation this user belongs to, as the user-detail page lists it."
      },
      "AdminValueCount": {
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "value",
          "count"
        ],
        "title": "AdminValueCount"
      },
      "AlertsResponse": {
        "properties": {
          "channels": {
            "items": {
              "$ref": "#/components/schemas/ChannelResponse"
            },
            "type": "array",
            "title": "Channels"
          },
          "policies": {
            "items": {
              "$ref": "#/components/schemas/PolicyResponse"
            },
            "type": "array",
            "title": "Policies"
          }
        },
        "type": "object",
        "required": [
          "channels",
          "policies"
        ],
        "title": "AlertsResponse"
      },
      "AlgorithmConfigIn": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout Ms",
            "default": 1500
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "AlgorithmConfigIn"
      },
      "AlgorithmStats": {
        "properties": {
          "algorithm": {
            "type": "string",
            "title": "Algorithm"
          },
          "wins": {
            "type": "integer",
            "title": "Wins"
          },
          "failures": {
            "type": "integer",
            "title": "Failures"
          },
          "win_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Win Rate"
          }
        },
        "type": "object",
        "required": [
          "algorithm",
          "wins",
          "failures",
          "win_rate"
        ],
        "title": "AlgorithmStats"
      },
      "AmendIn": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "field": {
            "type": "string",
            "title": "Field"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "unit": {
            "type": "string",
            "title": "Unit"
          },
          "reason": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 3,
            "title": "Reason"
          },
          "evidence_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Evidence Ids",
            "default": []
          },
          "override_band": {
            "type": "boolean",
            "title": "Override Band",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "field",
          "value",
          "unit",
          "reason"
        ],
        "title": "AmendIn",
        "description": "An admin CORRECTING one held field (WS7). Unlike /review this carries a\nprice \u2014 `unit` must be in the row's own pricing_unit family and the server\nconverts it; `reason` is REQUIRED (it is what feeds learning)."
      },
      "AmendOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "field": {
            "type": "string",
            "title": "Field"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "detail": {
            "type": "string",
            "title": "Detail",
            "default": ""
          },
          "applied_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applied Value"
          },
          "row_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Row Unit"
          },
          "drift_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drift Pct"
          },
          "per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Per 1M"
          },
          "native": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Native"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "field",
          "status"
        ],
        "title": "AmendOut"
      },
      "AnthropicMessage": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "system"
            ],
            "title": "Role"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TextBlock"
                    },
                    {
                      "$ref": "#/components/schemas/ImageBlock"
                    },
                    {
                      "$ref": "#/components/schemas/ToolUseBlock"
                    },
                    {
                      "$ref": "#/components/schemas/ToolResultBlock"
                    },
                    {
                      "$ref": "#/components/schemas/ThinkingBlock"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "AnthropicMessage",
        "description": "One turn.\n\nAnthropic's documented roles are ``user`` and ``assistant`` \u2014 system text is\na top-level field, which is the biggest structural difference from the OpenAI\nshape. But ``system`` is accepted here as a THIRD role, because Claude Code\nactually sends one: a request captured against a real session carried\n``roles: [\"user\", \"system\"]`` alongside a populated top-level ``system``.\n\nRejecting it is not \"being strict about the spec\" \u2014 it is being incompatible\nwith the single client this endpoint exists to serve, and it fails on the\nvery first request with a 400 that names an internal field path. OpenAI has a\nnative ``system`` role, so the mapping is direct and lossless."
      },
      "AnthropicMessagesRequest": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Max Tokens"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/AnthropicMessage"
            },
            "type": "array",
            "title": "Messages"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/TextBlock"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          },
          "stop_sequences": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop Sequences"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AnthropicTool"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "tool_choice": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Choice"
          },
          "top_k": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top K"
          },
          "thinking": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thinking"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "model",
          "max_tokens",
          "messages"
        ],
        "title": "AnthropicMessagesRequest",
        "example": {
          "max_tokens": 1024,
          "messages": [
            {
              "content": "say hi",
              "role": "user"
            }
          ],
          "model": "anthropic/claude-haiku-4.5"
        }
      },
      "AnthropicTool": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "input_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Schema"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "AnthropicTool",
        "description": "A tool definition. ``input_schema`` is Anthropic's name for what OpenAI\ncalls ``function.parameters``."
      },
      "ApiVersionOut": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The value to send as `X-Mesh-Version`, e.g. `2026-08`."
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "`ga` | `deprecated` | `sunset`."
          },
          "released": {
            "type": "string",
            "title": "Released",
            "description": "ISO date this version became available."
          },
          "deprecated_on": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated On",
            "description": "ISO date this version was deprecated, or null. Feeds the `Deprecation` response header."
          },
          "sunset_on": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sunset On",
            "description": "ISO date this version stops being served, or null. Feeds the `Sunset` response header."
          },
          "notes_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes Url",
            "description": "Migration guide for leaving this version, or null."
          },
          "baseline": {
            "type": "boolean",
            "title": "Baseline",
            "description": "True for the version a caller gets with no `X-Mesh-Version` header and no stored pin. This is the OLDEST supported version, so an existing integration is never moved by a release."
          },
          "latest": {
            "type": "boolean",
            "title": "Latest",
            "description": "True for the newest released version. Note this is NOT the default \u2014 pin it explicitly to receive it."
          },
          "capabilities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Capabilities",
            "description": "Behaviour available to a caller pinned to this version. Cumulative \u2014 everything introduced at or before this label."
          }
        },
        "type": "object",
        "required": [
          "label",
          "status",
          "released",
          "baseline",
          "latest"
        ],
        "title": "ApiVersionOut",
        "description": "One dated version of the public contract."
      },
      "AppliedChange": {
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "title": "At"
          },
          "old_value": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Old Value"
          },
          "new_value": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Value"
          },
          "actor": {
            "type": "string",
            "title": "Actor"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "at",
          "old_value",
          "new_value",
          "actor",
          "reason"
        ],
        "title": "AppliedChange"
      },
      "ApproveIn": {
        "properties": {
          "model_ids": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/ApproveTarget"
                }
              ]
            },
            "type": "array",
            "maxItems": 200,
            "minItems": 1,
            "title": "Model Ids"
          },
          "action": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ],
            "title": "Action"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "model_ids",
          "action"
        ],
        "title": "ApproveIn"
      },
      "ApproveOut": {
        "properties": {
          "action": {
            "type": "string",
            "title": "Action"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ApproveResultOut"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "action",
          "results"
        ],
        "title": "ApproveOut"
      },
      "ApproveResultOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "status"
        ],
        "title": "ApproveResultOut"
      },
      "ApproveTarget": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          }
        },
        "type": "object",
        "required": [
          "model_id"
        ],
        "title": "ApproveTarget",
        "description": "A model_id optionally pinned to a specific provider's row."
      },
      "AsOfField": {
        "properties": {
          "value": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value",
            "description": "The field's value at `at`, USD per the row's pricing_unit. NULL means unset."
          },
          "as_of_source": {
            "type": "string",
            "title": "As Of Source",
            "description": "change_log | current | last_known | unknown \u2014 see the module docstring's honesty contract. `current` means exactly 'the live model_pricing row says so, right now'; it is never returned when the row is absent."
          },
          "last_change_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Change At",
            "description": "applied_at of the change that was in effect at `at`. NULL when as_of_source is 'unknown' (nothing in the ledger predates `at`)."
          },
          "earliest_change_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Earliest Change At",
            "description": "applied_at of the OLDEST applied change for this field \u2014 the ledger's horizon. 'We have no audit trail before this instant.' NULL means the field has no applied history at all (a legacy seed). On an 'unknown' answer this is what tells the caller how far back the evidence actually goes."
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id",
            "description": "Run that applied the change in effect at `at` \u2014 the 'why was I billed this'."
          },
          "actor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor",
            "description": "'engine', a sync job, or the admin user id."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "Classifier / review reason recorded on that change."
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source",
            "description": "Winning price source on that change (provider_api, \u2026)."
          },
          "changes_undone": {
            "type": "integer",
            "title": "Changes Undone",
            "description": "How many applied changes were replayed backwards to reach `at`."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note",
            "description": "Set only when the reconstruction is not self-consistent \u2014 the replayed value and the ledger's own statement disagree. A non-NULL note means this value is NOT a trustworthy answer to a billing dispute; run the invariant sweep first."
          }
        },
        "type": "object",
        "required": [
          "value",
          "as_of_source",
          "last_change_at",
          "earliest_change_at",
          "run_id",
          "actor",
          "reason",
          "source",
          "changes_undone"
        ],
        "title": "AsOfField"
      },
      "AsOfOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "title": "At"
          },
          "row_exists": {
            "type": "boolean",
            "title": "Row Exists",
            "description": "False when model_pricing has no row for this pair but the change log does \u2014 the reconstruction is then seeded from the ledger's own final value and is history-only."
          },
          "row_serving": {
            "type": "boolean",
            "title": "Row Serving",
            "description": "True only when a row exists AND is_active is true \u2014 i.e. requests are actually billed at this row right now (the billing queries all filter is_active). This is the sole condition under which any field may report as_of_source='current'."
          },
          "deprecated_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated Date",
            "description": "The row's deprecation date, when set. Present so an inactive row's answer carries when it stopped being the live price rather than only that it did."
          },
          "serving": {
            "$ref": "#/components/schemas/ServingOut",
            "description": "Axis 2 \u2014 whether the row was BILLABLE at `at`, replayed from the audited is_active transitions. Independent of the price axis: `fields[...]` says what the price WAS, this says whether anyone could be charged it."
          },
          "pricing_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Unit",
            "description": "The row's CURRENT unit. Not a priced field, so historical changes to it are not replayable \u2014 see the module docstring."
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "fields": {
            "additionalProperties": {
              "$ref": "#/components/schemas/AsOfField"
            },
            "type": "object",
            "title": "Fields"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "at",
          "row_exists",
          "row_serving",
          "deprecated_date",
          "serving",
          "pricing_unit",
          "currency",
          "fields"
        ],
        "title": "AsOfOut"
      },
      "AssetReapResult": {
        "properties": {
          "reaped": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Reaped"
          }
        },
        "type": "object",
        "required": [
          "reaped"
        ],
        "title": "AssetReapResult"
      },
      "AssetSweepResult": {
        "properties": {
          "reaped": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Reaped"
          },
          "swept": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Swept"
          },
          "orphan_groups": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Orphan Groups"
          },
          "entitlement_alerted": {
            "type": "boolean",
            "title": "Entitlement Alerted"
          }
        },
        "type": "object",
        "required": [
          "reaped",
          "swept",
          "orphan_groups",
          "entitlement_alerted"
        ],
        "title": "AssetSweepResult"
      },
      "AssignCouponUsersRequest": {
        "properties": {
          "user_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "User Ids"
          }
        },
        "type": "object",
        "title": "AssignCouponUsersRequest"
      },
      "AudioOutputOptions": {
        "properties": {
          "voice": {
            "type": "string",
            "title": "Voice",
            "default": "alloy"
          },
          "format": {
            "type": "string",
            "enum": [
              "wav",
              "mp3",
              "flac",
              "opus",
              "pcm16"
            ],
            "title": "Format",
            "default": "wav"
          }
        },
        "type": "object",
        "title": "AudioOutputOptions"
      },
      "AutoRechargeSetupRequest": {
        "properties": {
          "recharge_amount_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Recharge Amount Usd",
            "default": "10.00"
          },
          "threshold_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Threshold Usd",
            "default": "10.00"
          },
          "return_url": {
            "type": "string",
            "title": "Return Url"
          }
        },
        "type": "object",
        "required": [
          "return_url"
        ],
        "title": "AutoRechargeSetupRequest"
      },
      "AutoRechargeSetupResponse": {
        "properties": {
          "subscription_session_id": {
            "type": "string",
            "title": "Subscription Session Id"
          },
          "provider_subscription_id": {
            "type": "string",
            "title": "Provider Subscription Id"
          }
        },
        "type": "object",
        "required": [
          "subscription_session_id",
          "provider_subscription_id"
        ],
        "title": "AutoRechargeSetupResponse"
      },
      "AutoRechargeStatusResponse": {
        "properties": {
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "is_authorized": {
            "type": "boolean",
            "title": "Is Authorized"
          },
          "recharge_amount_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recharge Amount Usd"
          },
          "threshold_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Usd"
          },
          "provider_subscription_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Subscription Id"
          }
        },
        "type": "object",
        "required": [
          "is_active",
          "is_authorized",
          "recharge_amount_usd",
          "threshold_usd",
          "provider_subscription_id"
        ],
        "title": "AutoRechargeStatusResponse"
      },
      "AutoRechargeUpdateRequest": {
        "properties": {
          "recharge_amount_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recharge Amount Usd"
          },
          "threshold_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Usd"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          }
        },
        "type": "object",
        "title": "AutoRechargeUpdateRequest"
      },
      "AutoRouterAnalyticsOut": {
        "properties": {
          "window_hours": {
            "type": "integer",
            "title": "Window Hours"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "fallback_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Rate"
          },
          "error_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Rate"
          },
          "path_stats": {
            "items": {
              "$ref": "#/components/schemas/PathStats"
            },
            "type": "array",
            "title": "Path Stats"
          },
          "algorithm_stats": {
            "items": {
              "$ref": "#/components/schemas/AlgorithmStats"
            },
            "type": "array",
            "title": "Algorithm Stats"
          },
          "nd_failure_count": {
            "type": "integer",
            "title": "Nd Failure Count"
          }
        },
        "type": "object",
        "required": [
          "window_hours",
          "total_requests",
          "fallback_rate",
          "error_rate",
          "path_stats",
          "algorithm_stats",
          "nd_failure_count"
        ],
        "title": "AutoRouterAnalyticsOut"
      },
      "AutoRouterConfigIn": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "paths": {
            "items": {
              "$ref": "#/components/schemas/PathConfigIn"
            },
            "type": "array",
            "title": "Paths"
          }
        },
        "type": "object",
        "required": [
          "name",
          "paths"
        ],
        "title": "AutoRouterConfigIn"
      },
      "AutoRouterConfigOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "paths": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Paths"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "is_active",
          "paths",
          "created_at",
          "updated_at"
        ],
        "title": "AutoRouterConfigOut"
      },
      "AutoRouterConfigsPage": {
        "properties": {
          "configs": {
            "items": {
              "$ref": "#/components/schemas/AutoRouterConfigOut"
            },
            "type": "array",
            "title": "Configs"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "configs",
          "total"
        ],
        "title": "AutoRouterConfigsPage"
      },
      "AutoRouterMeta": {
        "properties": {
          "fallback_used": {
            "type": "boolean",
            "title": "Fallback Used",
            "default": false
          },
          "fallback_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Reason"
          }
        },
        "type": "object",
        "title": "AutoRouterMeta"
      },
      "AutoRouterSettingOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "is_override": {
            "type": "boolean",
            "title": "Is Override"
          },
          "env_default": {
            "type": "string",
            "title": "Env Default"
          }
        },
        "type": "object",
        "required": [
          "key",
          "type",
          "value",
          "is_override",
          "env_default"
        ],
        "title": "AutoRouterSettingOut"
      },
      "AutoRouterSettingsOut": {
        "properties": {
          "settings": {
            "items": {
              "$ref": "#/components/schemas/AutoRouterSettingOut"
            },
            "type": "array",
            "title": "Settings"
          }
        },
        "type": "object",
        "required": [
          "settings"
        ],
        "title": "AutoRouterSettingsOut"
      },
      "BalanceDetail": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "total_spent_usd": {
            "type": "string",
            "title": "Total Spent Usd"
          },
          "by_model": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "By Model"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "balance_usd",
          "updated_at",
          "total_spent_usd",
          "by_model"
        ],
        "title": "BalanceDetail"
      },
      "BalanceFailureOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "ts": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ts"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "cost_usd": {
            "type": "string",
            "title": "Cost Usd"
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "reference_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Type"
          },
          "replayed": {
            "type": "boolean",
            "title": "Replayed"
          },
          "replayed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replayed At"
          },
          "replayed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replayed By"
          },
          "discarded": {
            "type": "boolean",
            "title": "Discarded"
          },
          "discarded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discarded At"
          },
          "discarded_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discarded By"
          },
          "discard_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discard Reason"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "cost_usd",
          "replayed",
          "discarded"
        ],
        "title": "BalanceFailureOut"
      },
      "BalanceFailuresPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BalanceFailureOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "pending_count": {
            "type": "integer",
            "title": "Pending Count"
          },
          "total_unbilled_usd": {
            "type": "string",
            "title": "Total Unbilled Usd"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "pending_count",
          "total_unbilled_usd"
        ],
        "title": "BalanceFailuresPage"
      },
      "BalanceOut": {
        "properties": {
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd",
            "description": "Total credit balance in USD."
          },
          "reserved_usd": {
            "type": "string",
            "title": "Reserved Usd",
            "description": "Funds currently held by in-flight operations and not spendable.",
            "default": "0.0000000"
          },
          "available_usd": {
            "type": "string",
            "title": "Available Usd",
            "description": "Spendable balance: balance_usd minus reserved_usd."
          },
          "reserved_breakdown": {
            "items": {
              "$ref": "#/components/schemas/ReservationCategoryTotal"
            },
            "type": "array",
            "title": "Reserved Breakdown",
            "description": "Reserved totals per category (realtime / async / video); omits categories holding nothing. Sums to reserved_usd."
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "Last balance update (ISO 8601)."
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "balance_usd",
          "available_usd"
        ],
        "title": "BalanceOut"
      },
      "BalanceSummary": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          },
          "total_spent_usd": {
            "type": "string",
            "title": "Total Spent Usd"
          },
          "last_activity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "balance_usd",
          "total_spent_usd",
          "last_activity",
          "updated_at"
        ],
        "title": "BalanceSummary"
      },
      "BanRequest": {
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 3,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "reason"
        ],
        "title": "BanRequest"
      },
      "BanResult": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "banned": {
            "type": "boolean",
            "title": "Banned"
          },
          "keys_affected": {
            "type": "integer",
            "title": "Keys Affected"
          },
          "admin_keys_affected": {
            "type": "integer",
            "title": "Admin Keys Affected",
            "default": 0
          },
          "partial": {
            "type": "boolean",
            "title": "Partial",
            "default": false
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "banned",
          "keys_affected"
        ],
        "title": "BanResult"
      },
      "BatchRequestItem": {
        "properties": {
          "custom_id": {
            "type": "string",
            "title": "Custom Id"
          },
          "method": {
            "type": "string",
            "title": "Method",
            "default": "POST"
          },
          "url": {
            "type": "string",
            "title": "Url",
            "default": "/v1/chat/completions"
          },
          "body": {
            "additionalProperties": true,
            "type": "object",
            "title": "Body"
          }
        },
        "type": "object",
        "required": [
          "custom_id",
          "body"
        ],
        "title": "BatchRequestItem"
      },
      "BillingCurrencyResponse": {
        "properties": {
          "options": {
            "items": {
              "$ref": "#/components/schemas/CurrencyOption"
            },
            "type": "array",
            "title": "Options"
          },
          "default": {
            "type": "string",
            "title": "Default"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          }
        },
        "type": "object",
        "required": [
          "options",
          "default",
          "country"
        ],
        "title": "BillingCurrencyResponse",
        "description": "What the billing page needs to render the currency picker."
      },
      "BodyLogPolicy": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          },
          "include": {
            "type": "string",
            "enum": [
              "both",
              "request",
              "response"
            ],
            "title": "Include",
            "default": "both"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BodyLogPolicy",
        "description": "Validated form of a `body_log_policy` JSONB blob."
      },
      "Body_create_transcription": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "file": {
            "anyOf": [
              {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              },
              {
                "type": "null"
              }
            ],
            "title": "File"
          },
          "response_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "language_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language Code"
          },
          "tag_audio_events": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tag Audio Events"
          },
          "num_speakers": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 32.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Num Speakers"
          },
          "timestamps_granularity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamps Granularity"
          },
          "diarize": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Diarize"
          },
          "diarization_threshold": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 0.4,
                "minimum": 0.1
              },
              {
                "type": "null"
              }
            ],
            "title": "Diarization Threshold"
          },
          "additional_formats": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Formats"
          },
          "file_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Format"
          },
          "cloud_storage_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cloud Storage Url"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "webhook": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook"
          },
          "webhook_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Id"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "use_multi_channel": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Multi Channel"
          },
          "webhook_metadata": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Metadata"
          },
          "entity_detection": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Detection"
          },
          "no_verbatim": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "No Verbatim"
          },
          "detect_speaker_roles": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detect Speaker Roles"
          },
          "entity_redaction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Redaction"
          },
          "entity_redaction_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entity Redaction Mode"
          },
          "keyterms": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keyterms"
          },
          "with_timestamps": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "With Timestamps"
          },
          "debug_mode": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Debug Mode"
          },
          "tags": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier"
          }
        },
        "type": "object",
        "required": [
          "model"
        ],
        "title": "Body_create_transcription"
      },
      "Body_create_transcription_translate": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "default": "sarvam/saaras:v2"
          },
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt"
          },
          "tags": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_create_transcription_translate"
      },
      "Body_create_translation": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt"
          },
          "response_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "tags": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier"
          }
        },
        "type": "object",
        "required": [
          "model",
          "file"
        ],
        "title": "Body_create_translation"
      },
      "Body_upload_evidence": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "source_url": {
            "type": "string",
            "title": "Source Url"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "field_names": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field Names"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          }
        },
        "type": "object",
        "required": [
          "file",
          "source_url",
          "provider"
        ],
        "title": "Body_upload_evidence"
      },
      "BrandCatalogEntryOut": {
        "properties": {
          "brand": {
            "type": "string",
            "title": "Brand"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "model_count": {
            "type": "integer",
            "title": "Model Count"
          },
          "has_rule": {
            "type": "boolean",
            "title": "Has Rule",
            "default": false
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/BrandProviderCandidateOut"
            },
            "type": "array",
            "title": "Providers"
          }
        },
        "type": "object",
        "required": [
          "brand",
          "model_count"
        ],
        "title": "BrandCatalogEntryOut",
        "description": "One selectable brand, for the editor's dropdowns."
      },
      "BrandCatalogOut": {
        "properties": {
          "brands": {
            "items": {
              "$ref": "#/components/schemas/BrandOut"
            },
            "type": "array",
            "title": "Brands"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/BrandOut"
            },
            "type": "array",
            "title": "Providers"
          },
          "aliases": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Aliases"
          }
        },
        "type": "object",
        "required": [
          "brands",
          "providers",
          "aliases"
        ],
        "title": "BrandCatalogOut",
        "description": "Brand + provider display metadata, served by ``GET /v1/public/brands``."
      },
      "BrandOut": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "icon_url_dark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url Dark"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "display_name"
        ],
        "title": "BrandOut",
        "description": "Display metadata for one brand or routing provider."
      },
      "BrandProviderCandidateOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "active_model_count": {
            "type": "integer",
            "title": "Active Model Count"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "active_model_count"
        ],
        "title": "BrandProviderCandidateOut",
        "description": "A provider that could serve some of a brand's models, and how many."
      },
      "BrandRoutingModelOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "verdict": {
            "type": "string",
            "title": "Verdict"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "serving_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serving Provider"
          },
          "target_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Provider"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "pin_overrides_rule_key": {
            "type": "boolean",
            "title": "Pin Overrides Rule Key",
            "default": false
          },
          "attempts": {
            "type": "integer",
            "title": "Attempts",
            "default": 0
          },
          "error_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Pct"
          },
          "price_delta_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Delta Pct"
          },
          "price_changed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Changed"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "verdict"
        ],
        "title": "BrandRoutingModelOut",
        "description": "One model of the brand, and what the rule actually does to it."
      },
      "BrandRoutingPreflightOut": {
        "properties": {
          "brand": {
            "type": "string",
            "title": "Brand"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "target_provider": {
            "type": "string",
            "title": "Target Provider"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "platform_key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Label"
          },
          "traffic_pct": {
            "type": "integer",
            "title": "Traffic Pct",
            "default": 100
          },
          "model_count": {
            "type": "integer",
            "title": "Model Count",
            "default": 0
          },
          "will_route": {
            "type": "integer",
            "title": "Will Route",
            "default": 0
          },
          "excluded": {
            "type": "integer",
            "title": "Excluded",
            "default": 0
          },
          "no_row": {
            "type": "integer",
            "title": "No Row",
            "default": 0
          },
          "capability_gap": {
            "type": "integer",
            "title": "Capability Gap",
            "default": 0
          },
          "guardrail_blocked": {
            "type": "integer",
            "title": "Guardrail Blocked",
            "default": 0
          },
          "deployment_missing": {
            "type": "integer",
            "title": "Deployment Missing",
            "default": 0
          },
          "blocked_models": {
            "items": {
              "$ref": "#/components/schemas/BrandRoutingModelOut"
            },
            "type": "array",
            "title": "Blocked Models"
          },
          "attempts_to_move": {
            "type": "integer",
            "title": "Attempts To Move",
            "default": 0
          },
          "attempts_at_full": {
            "type": "integer",
            "title": "Attempts At Full",
            "default": 0
          },
          "quota_remaining_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quota Remaining Pct"
          },
          "repriced_models": {
            "type": "integer",
            "title": "Repriced Models",
            "default": 0
          },
          "max_price_delta_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Price Delta Pct"
          },
          "advisories": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Advisories"
          }
        },
        "type": "object",
        "required": [
          "brand",
          "target_provider"
        ],
        "title": "BrandRoutingPreflightOut",
        "description": "What saving this rule would do, computed before anyone saves it."
      },
      "BrandRoutingRuleIn": {
        "properties": {
          "target_provider": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Target Provider"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "excluded_models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Excluded Models"
          },
          "traffic_pct": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Traffic Pct",
            "default": 100
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "default": true
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "target_provider"
        ],
        "title": "BrandRoutingRuleIn"
      },
      "BrandRoutingRuleOut": {
        "properties": {
          "brand": {
            "type": "string",
            "title": "Brand"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "target_provider": {
            "type": "string",
            "title": "Target Provider"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "platform_key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Label"
          },
          "excluded_models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Excluded Models"
          },
          "traffic_pct": {
            "type": "integer",
            "title": "Traffic Pct",
            "default": 100
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "default": true
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "model_count": {
            "type": "integer",
            "title": "Model Count",
            "default": 0
          },
          "routed_count": {
            "type": "integer",
            "title": "Routed Count",
            "default": 0
          },
          "would_route_count": {
            "type": "integer",
            "title": "Would Route Count",
            "default": 0
          },
          "blocked_count": {
            "type": "integer",
            "title": "Blocked Count",
            "default": 0
          },
          "no_row_count": {
            "type": "integer",
            "title": "No Row Count",
            "default": 0
          },
          "attempts_total": {
            "type": "integer",
            "title": "Attempts Total",
            "default": 0
          },
          "attempts_on_target": {
            "type": "integer",
            "title": "Attempts On Target",
            "default": 0
          },
          "models": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BrandRoutingModelOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Models"
          }
        },
        "type": "object",
        "required": [
          "brand",
          "target_provider"
        ],
        "title": "BrandRoutingRuleOut"
      },
      "BreakdownResult": {
        "properties": {
          "dimension": {
            "type": "string",
            "title": "Dimension"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/BreakdownRow"
            },
            "type": "array",
            "title": "Rows"
          }
        },
        "type": "object",
        "required": [
          "dimension",
          "status",
          "rows"
        ],
        "title": "BreakdownResult"
      },
      "BreakdownRow": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "magnitude_usd": {
            "type": "string",
            "title": "Magnitude Usd"
          }
        },
        "type": "object",
        "required": [
          "key",
          "count",
          "magnitude_usd"
        ],
        "title": "BreakdownRow"
      },
      "BudgetInputConfig": {
        "properties": {
          "max_attempts": {
            "type": "integer",
            "title": "Max Attempts",
            "default": 3
          },
          "max_total_latency_ms": {
            "type": "integer",
            "title": "Max Total Latency Ms",
            "default": 60000
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "BudgetInputConfig"
      },
      "BuiltinTool": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image_generation",
              "web_search_preview",
              "web_search_preview_2025_03_11",
              "file_search",
              "computer_use_preview",
              "code_interpreter"
            ],
            "title": "Type"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "type"
        ],
        "title": "BuiltinTool",
        "description": "Represents an OpenAI built-in tool (non-function), e.g. {\"type\": \"image_generation\"}."
      },
      "BulkEmbedRequest": {
        "properties": {
          "file_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "File Ids"
          },
          "wait": {
            "type": "boolean",
            "title": "Wait",
            "default": false
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "file_ids"
        ],
        "title": "BulkEmbedRequest",
        "example": {
          "file_ids": [
            "file_123abc456def7890"
          ]
        }
      },
      "BulkEmbedResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/BulkEmbedResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "BulkEmbedResponse"
      },
      "BulkEmbedResult": {
        "properties": {
          "file_id": {
            "type": "string",
            "title": "File Id"
          },
          "embedding_status": {
            "type": "string",
            "title": "Embedding Status"
          },
          "chunk_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chunk Count"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "file_id",
          "embedding_status"
        ],
        "title": "BulkEmbedResult"
      },
      "BulkFreeCreditRequest": {
        "properties": {
          "emails": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Emails"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "INR"
          },
          "allow_multiple": {
            "type": "boolean",
            "title": "Allow Multiple",
            "default": false
          },
          "coupon_code": {
            "type": "string",
            "title": "Coupon Code"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "emails",
          "amount",
          "coupon_code"
        ],
        "title": "BulkFreeCreditRequest"
      },
      "BulkFreeCreditResponse": {
        "properties": {
          "batch_id": {
            "type": "string",
            "title": "Batch Id"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "entered_amount": {
            "type": "string",
            "title": "Entered Amount"
          },
          "fx_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fx Rate"
          },
          "amount_usd_each": {
            "type": "string",
            "title": "Amount Usd Each"
          },
          "allow_multiple": {
            "type": "boolean",
            "title": "Allow Multiple"
          },
          "summary": {
            "$ref": "#/components/schemas/BulkFreeCreditSummary"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/BulkFreeCreditResultItem"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "batch_id",
          "currency",
          "entered_amount",
          "fx_rate",
          "amount_usd_each",
          "allow_multiple",
          "summary",
          "results"
        ],
        "title": "BulkFreeCreditResponse"
      },
      "BulkFreeCreditResultItem": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "amount_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Usd"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "email",
          "status"
        ],
        "title": "BulkFreeCreditResultItem"
      },
      "BulkFreeCreditSummary": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "credited": {
            "type": "integer",
            "title": "Credited"
          },
          "created": {
            "type": "integer",
            "title": "Created"
          },
          "already_granted": {
            "type": "integer",
            "title": "Already Granted"
          },
          "invalid_email": {
            "type": "integer",
            "title": "Invalid Email"
          },
          "duplicate": {
            "type": "integer",
            "title": "Duplicate"
          },
          "create_failed": {
            "type": "integer",
            "title": "Create Failed"
          },
          "total_usd_credited": {
            "type": "string",
            "title": "Total Usd Credited"
          }
        },
        "type": "object",
        "required": [
          "total",
          "credited",
          "created",
          "already_granted",
          "invalid_email",
          "duplicate",
          "create_failed",
          "total_usd_credited"
        ],
        "title": "BulkFreeCreditSummary"
      },
      "BulkModelOverrideRequest": {
        "properties": {
          "overrides": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "additionalProperties": true,
                  "type": "object"
                }
              ]
            },
            "type": "object",
            "title": "Overrides"
          }
        },
        "type": "object",
        "title": "BulkModelOverrideRequest",
        "description": "Replace every override on this key.\n\n``overrides`` accepts both committed-file shapes so an account block pastes in\nunchanged: ``{model_key: \"arn:\u2026\"}`` (bedrock) or\n``{model_key: {\"endpoint_id\": \"ep-\u2026\", \"label\": \"\u2026\"}}`` (byteplus)."
      },
      "BulkModelOverrideResult": {
        "properties": {
          "applied": {
            "type": "integer",
            "title": "Applied"
          },
          "removed": {
            "type": "integer",
            "title": "Removed"
          },
          "rejected": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Rejected"
          }
        },
        "type": "object",
        "required": [
          "applied",
          "removed",
          "rejected"
        ],
        "title": "BulkModelOverrideResult"
      },
      "ByokMetrics": {
        "properties": {
          "period_start": {
            "type": "string",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "title": "Period End"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "byok_requests": {
            "type": "integer",
            "title": "Byok Requests"
          },
          "platform_requests": {
            "type": "integer",
            "title": "Platform Requests"
          },
          "byok_adoption_pct": {
            "type": "number",
            "title": "Byok Adoption Pct"
          },
          "byok_success": {
            "type": "integer",
            "title": "Byok Success"
          },
          "byok_fallback": {
            "type": "integer",
            "title": "Byok Fallback"
          },
          "fallback_rate_pct": {
            "type": "number",
            "title": "Fallback Rate Pct"
          },
          "total_platform_fee_usd": {
            "type": "string",
            "title": "Total Platform Fee Usd"
          },
          "byok_platform_fee_usd": {
            "type": "string",
            "title": "Byok Platform Fee Usd",
            "default": "0.00"
          },
          "total_spend_usd": {
            "type": "string",
            "title": "Total Spend Usd",
            "default": "0.00"
          },
          "byok_cost_usd": {
            "type": "string",
            "title": "Byok Cost Usd",
            "default": "0.00"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "default": 0
          },
          "byok_tokens": {
            "type": "integer",
            "title": "Byok Tokens",
            "default": 0
          },
          "platform_tokens": {
            "type": "integer",
            "title": "Platform Tokens",
            "default": 0
          },
          "top_owners": {
            "items": {
              "$ref": "#/components/schemas/ByokOwnerRow"
            },
            "type": "array",
            "title": "Top Owners"
          }
        },
        "type": "object",
        "required": [
          "period_start",
          "period_end",
          "total_requests",
          "byok_requests",
          "platform_requests",
          "byok_adoption_pct",
          "byok_success",
          "byok_fallback",
          "fallback_rate_pct",
          "total_platform_fee_usd",
          "top_owners"
        ],
        "title": "ByokMetrics"
      },
      "ByokOwnerRow": {
        "properties": {
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "fallback_count": {
            "type": "integer",
            "title": "Fallback Count"
          },
          "platform_fee_usd": {
            "type": "string",
            "title": "Platform Fee Usd"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "owner",
          "requests",
          "fallback_count",
          "platform_fee_usd"
        ],
        "title": "ByokOwnerRow"
      },
      "ByokTimeSeries": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "byok_requests": {
            "type": "integer",
            "title": "Byok Requests"
          },
          "fallback_count": {
            "type": "integer",
            "title": "Fallback Count"
          },
          "platform_fee_usd": {
            "type": "string",
            "title": "Platform Fee Usd"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "byok_requests",
          "fallback_count",
          "platform_fee_usd"
        ],
        "title": "ByokTimeSeries"
      },
      "ByokUsersPage": {
        "properties": {
          "users": {
            "items": {
              "$ref": "#/components/schemas/ByokOwnerRow"
            },
            "type": "array",
            "title": "Users"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "users",
          "total",
          "limit",
          "offset"
        ],
        "title": "ByokUsersPage"
      },
      "CashByCurrency": {
        "properties": {
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "recharges": {
            "type": "integer",
            "title": "Recharges"
          },
          "face_value": {
            "type": "number",
            "title": "Face Value"
          },
          "coupon_discount": {
            "type": "number",
            "title": "Coupon Discount"
          },
          "user_paid": {
            "type": "number",
            "title": "User Paid"
          },
          "gst_collected": {
            "type": "number",
            "title": "Gst Collected"
          }
        },
        "type": "object",
        "required": [
          "currency",
          "recharges",
          "face_value",
          "coupon_discount",
          "user_paid",
          "gst_collected"
        ],
        "title": "CashByCurrency",
        "description": "All values in major units of `currency`.\n\npayment_events.amount holds the GST-inclusive FACE value of the order \u2014\nNOT what was collected. Verified on prod: a \u20b92,000 top-up with a \u20b92,359\ncoupon records amount=\u20b92,360 (face+GST) while the card was charged \u20b91.\nOut-of-pocket is therefore amount \u2212 discount_amount."
      },
      "CashfreePaymentRequest": {
        "properties": {
          "amount": {
            "type": "number",
            "title": "Amount"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "couponCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Couponcode"
          }
        },
        "type": "object",
        "required": [
          "amount"
        ],
        "title": "CashfreePaymentRequest"
      },
      "CashfreePaymentResponse": {
        "properties": {
          "paymentSessionId": {
            "type": "string",
            "title": "Paymentsessionid"
          },
          "orderId": {
            "type": "string",
            "title": "Orderid"
          },
          "free": {
            "type": "boolean",
            "title": "Free",
            "default": false
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "INR"
          },
          "chargeAmount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chargeamount"
          },
          "gstAmount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstamount"
          },
          "fxRate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fxrate"
          },
          "creditUsd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creditusd"
          }
        },
        "type": "object",
        "required": [
          "paymentSessionId",
          "orderId"
        ],
        "title": "CashfreePaymentResponse"
      },
      "CatalogDriftResult": {
        "properties": {
          "active_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Version"
          },
          "active_version_source": {
            "type": "string",
            "title": "Active Version Source",
            "default": "system_setting"
          },
          "versions_checked": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Versions Checked"
          },
          "model_ids_checked": {
            "type": "integer",
            "title": "Model Ids Checked",
            "default": 0
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/app__routers__auto_router_catalog_drift__FindingReport"
            },
            "type": "array",
            "title": "Findings"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/VersionReport"
            },
            "type": "array",
            "title": "Versions"
          },
          "alerted": {
            "type": "boolean",
            "title": "Alerted",
            "default": false
          },
          "paging": {
            "type": "boolean",
            "title": "Paging",
            "default": false
          }
        },
        "type": "object",
        "title": "CatalogDriftResult"
      },
      "CatalogPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CatalogTemplate"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "CatalogPage",
        "description": "Envelope, not a bare list \u2014 the grid's \"Showing 9 of 100\" needs `total`."
      },
      "CatalogProposalRequest": {
        "properties": {
          "provider": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Provider"
          },
          "models": {
            "items": {
              "$ref": "#/components/schemas/ProposalModelIn"
            },
            "type": "array",
            "maxItems": 200,
            "minItems": 1,
            "title": "Models"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          },
          "source": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Source"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "models",
          "source"
        ],
        "title": "CatalogProposalRequest"
      },
      "CatalogProposalResponse": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run"
          },
          "summary": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Summary"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/ProposalOutcomeOut"
            },
            "type": "array",
            "title": "Outcomes"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "source",
          "dry_run",
          "summary",
          "outcomes"
        ],
        "title": "CatalogProposalResponse"
      },
      "CatalogTemplate": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "is_beta": {
            "type": "boolean",
            "title": "Is Beta"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "enable_count": {
            "type": "integer",
            "title": "Enable Count"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "category",
          "version",
          "is_beta",
          "system",
          "model",
          "params",
          "variables",
          "enable_count",
          "is_enabled",
          "created_at",
          "updated_at"
        ],
        "title": "CatalogTemplate"
      },
      "CategoriesResponse": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "attribution": {
            "type": "string",
            "title": "Attribution"
          },
          "categories": {
            "items": {
              "$ref": "#/components/schemas/CategoryOut"
            },
            "type": "array",
            "title": "Categories"
          }
        },
        "type": "object",
        "required": [
          "source",
          "attribution",
          "categories"
        ],
        "title": "CategoriesResponse"
      },
      "CategoryCount": {
        "properties": {
          "category": {
            "type": "string",
            "title": "Category"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "category",
          "count"
        ],
        "title": "CategoryCount"
      },
      "CategoryCounts": {
        "properties": {
          "categories": {
            "items": {
              "$ref": "#/components/schemas/CategoryCount"
            },
            "type": "array",
            "title": "Categories"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "categories",
          "total"
        ],
        "title": "CategoryCounts"
      },
      "CategoryOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "metric": {
            "type": "string",
            "title": "Metric"
          },
          "model_count": {
            "type": "integer",
            "title": "Model Count"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "metric",
          "model_count"
        ],
        "title": "CategoryOut"
      },
      "CertificationOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "generated_at": {
            "type": "string",
            "title": "Generated At"
          },
          "verdict": {
            "type": "string",
            "title": "Verdict"
          },
          "allowlisted": {
            "type": "boolean",
            "title": "Allowlisted"
          },
          "unmet": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unmet"
          },
          "criteria": {
            "items": {
              "$ref": "#/components/schemas/CriterionOut"
            },
            "type": "array",
            "title": "Criteria"
          },
          "thresholds": {
            "additionalProperties": true,
            "type": "object",
            "title": "Thresholds"
          },
          "coverage": {
            "$ref": "#/components/schemas/app__routers__pricing_admin__CoverageOut"
          },
          "sources": {
            "$ref": "#/components/schemas/SourceHealthOut"
          },
          "verification": {
            "$ref": "#/components/schemas/VerificationOut"
          },
          "changes": {
            "$ref": "#/components/schemas/ChangeHealthOut"
          },
          "slack_text": {
            "type": "string",
            "title": "Slack Text"
          },
          "notified": {
            "type": "boolean",
            "title": "Notified",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "provider",
          "generated_at",
          "verdict",
          "allowlisted",
          "unmet",
          "criteria",
          "thresholds",
          "coverage",
          "sources",
          "verification",
          "changes",
          "slack_text"
        ],
        "title": "CertificationOut"
      },
      "ChangeHealthOut": {
        "properties": {
          "window_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Window Start"
          },
          "engine": {
            "$ref": "#/components/schemas/EngineActivityOut"
          },
          "manual": {
            "$ref": "#/components/schemas/ManualActivityOut"
          },
          "queue": {
            "$ref": "#/components/schemas/ReviewQueueOut"
          }
        },
        "type": "object",
        "required": [
          "engine",
          "manual",
          "queue"
        ],
        "title": "ChangeHealthOut"
      },
      "ChangeLogOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ChangeLogRowOut"
            },
            "type": "array",
            "title": "Items"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "limit",
          "offset"
        ],
        "title": "ChangeLogOut"
      },
      "ChangeLogRowOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "run_id": {
            "type": "string",
            "format": "uuid",
            "title": "Run Id"
          },
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "field_name": {
            "type": "string",
            "title": "Field Name"
          },
          "old_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Old Value"
          },
          "new_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "New Value"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "decision": {
            "type": "string",
            "title": "Decision"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "actor": {
            "type": "string",
            "title": "Actor"
          },
          "applied_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Applied At"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "proposed_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proposed Value"
          }
        },
        "type": "object",
        "required": [
          "id",
          "run_id",
          "model_id",
          "provider",
          "field_name",
          "old_value",
          "new_value",
          "source",
          "decision",
          "reason",
          "actor",
          "applied_at",
          "created_at"
        ],
        "title": "ChangeLogRowOut"
      },
      "ChannelCreate": {
        "properties": {
          "channel_type": {
            "type": "string",
            "title": "Channel Type"
          },
          "destination": {
            "type": "string",
            "title": "Destination"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "channel_type",
          "destination"
        ],
        "title": "ChannelCreate"
      },
      "ChannelCreateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "channel_type": {
            "type": "string",
            "title": "Channel Type"
          },
          "destination": {
            "type": "string",
            "title": "Destination"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled"
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          },
          "signing_secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signing Secret"
          }
        },
        "type": "object",
        "required": [
          "id",
          "channel_type",
          "destination",
          "is_enabled"
        ],
        "title": "ChannelCreateResponse"
      },
      "ChannelResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "channel_type": {
            "type": "string",
            "title": "Channel Type"
          },
          "destination": {
            "type": "string",
            "title": "Destination"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled"
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "channel_type",
          "destination",
          "is_enabled"
        ],
        "title": "ChannelResponse"
      },
      "ChannelUpdate": {
        "properties": {
          "destination": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Destination"
          },
          "is_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Enabled"
          }
        },
        "type": "object",
        "title": "ChannelUpdate"
      },
      "ChargebackRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "minLength": 1,
            "title": "User Id"
          },
          "amount_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Amount Usd"
          },
          "reason": {
            "type": "string",
            "enum": [
              "coupon_abuse",
              "fraud",
              "duplicate_credit",
              "admin_error",
              "refund_issued"
            ],
            "title": "Reason"
          },
          "note": {
            "type": "string",
            "maxLength": 500,
            "minLength": 3,
            "title": "Note"
          },
          "reverses_payment_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reverses Payment Id"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "amount_usd",
          "reason",
          "note"
        ],
        "title": "ChargebackRequest"
      },
      "ChargebackResponse": {
        "properties": {
          "payment_id": {
            "type": "string",
            "title": "Payment Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "amount_usd": {
            "type": "string",
            "title": "Amount Usd"
          },
          "balance_before": {
            "type": "string",
            "title": "Balance Before"
          },
          "balance_after": {
            "type": "string",
            "title": "Balance After"
          },
          "overdrawn": {
            "type": "boolean",
            "title": "Overdrawn"
          }
        },
        "type": "object",
        "required": [
          "payment_id",
          "user_id",
          "amount_usd",
          "balance_before",
          "balance_after",
          "overdrawn"
        ],
        "title": "ChargebackResponse"
      },
      "ChatCompletionRequest": {
        "properties": {
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "type": "array",
            "title": "Messages"
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template"
          },
          "template_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Version"
          },
          "variables": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "weight_profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Profile"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          },
          "frequency_penalty": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": -2.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Frequency Penalty"
          },
          "presence_penalty": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": -2.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Presence Penalty"
          },
          "stop": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "reasoning_effort": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "high",
                  "medium",
                  "low",
                  "none"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Effort",
            "deprecated": true
          },
          "reasoning": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReasoningConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Tool"
                    },
                    {
                      "$ref": "#/components/schemas/ServerTool"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "tool_choice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Choice"
          },
          "response_format": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "transforms": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transforms"
          },
          "models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Models"
          },
          "plugins": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plugins"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          },
          "user": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "User",
            "deprecated": true
          },
          "modality": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "image"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Modality"
          },
          "image": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImageOptions"
              },
              {
                "type": "null"
              }
            ]
          },
          "async_mode": {
            "type": "boolean",
            "title": "Async Mode",
            "default": false
          },
          "modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "text",
                    "audio",
                    "image"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Modalities"
          },
          "audio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AudioOutputOptions"
              },
              {
                "type": "null"
              }
            ]
          },
          "timeout": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Timeout"
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "default",
                  "flex"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "cache": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "messages"
        ],
        "title": "ChatCompletionRequest",
        "example": {
          "messages": [
            {
              "content": "say hi",
              "role": "user"
            }
          ],
          "model": "anthropic/claude-haiku-4.5"
        }
      },
      "ChatCompletionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "object": {
            "type": "string",
            "title": "Object"
          },
          "created": {
            "type": "integer",
            "title": "Created"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "choices": {
            "items": {
              "$ref": "#/components/schemas/Choice"
            },
            "type": "array",
            "title": "Choices"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsageInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "system_fingerprint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Fingerprint"
          }
        },
        "type": "object",
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ],
        "title": "ChatCompletionResponse"
      },
      "Choice": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index"
          },
          "message": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Message"
              },
              {
                "type": "null"
              }
            ]
          },
          "delta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delta"
          },
          "finish_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finish Reason"
          },
          "logprobs": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logprobs"
          }
        },
        "type": "object",
        "required": [
          "index"
        ],
        "title": "Choice"
      },
      "ChurnMetrics": {
        "properties": {
          "rechargers": {
            "type": "integer",
            "title": "Rechargers"
          },
          "churned": {
            "type": "integer",
            "title": "Churned"
          },
          "churn_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Churn Pct"
          },
          "active": {
            "type": "integer",
            "title": "Active"
          },
          "horizon_days": {
            "type": "integer",
            "title": "Horizon Days"
          },
          "as_of": {
            "type": "string",
            "title": "As Of"
          }
        },
        "type": "object",
        "required": [
          "rechargers",
          "churned",
          "churn_pct",
          "active",
          "horizon_days",
          "as_of"
        ],
        "title": "ChurnMetrics",
        "description": "Recharge churn across the whole customer base (MESH-776).\n\n``churn_pct`` is ``None``, never ``0``, when nobody has ever recharged \u2014\na zero would read as perfect retention, which is the opposite of \"there is\nnothing to measure\"."
      },
      "ClassCoverageOut": {
        "properties": {
          "field_class": {
            "type": "string",
            "title": "Field Class"
          },
          "priced_fields": {
            "type": "integer",
            "title": "Priced Fields"
          },
          "sourced_fields": {
            "type": "integer",
            "title": "Sourced Fields"
          },
          "rows_with_any": {
            "type": "integer",
            "title": "Rows With Any"
          }
        },
        "type": "object",
        "required": [
          "field_class",
          "priced_fields",
          "sourced_fields",
          "rows_with_any"
        ],
        "title": "ClassCoverageOut"
      },
      "CompareRequest": {
        "properties": {
          "models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 10,
            "minItems": 1,
            "title": "Models"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "type": "array",
            "title": "Messages"
          },
          "model_overrides": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ModelOverride"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Overrides"
          },
          "comparison_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comparison Model"
          },
          "comparison_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comparison Instructions"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template"
          },
          "variables": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "skip_comparison": {
            "type": "boolean",
            "title": "Skip Comparison",
            "default": false
          },
          "cache": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "models",
          "messages"
        ],
        "title": "CompareRequest",
        "example": {
          "comparison_instructions": "Rank the answers by clarity and correctness.",
          "messages": [
            {
              "content": "Explain the difference between TCP and UDP in two sentences.",
              "role": "user"
            }
          ],
          "models": [
            "openai/gpt-4o-mini",
            "anthropic/claude-haiku-4.5",
            "google/gemini-3-flash-preview"
          ]
        }
      },
      "CompareResponse": {
        "properties": {
          "comparison_id": {
            "type": "string",
            "title": "Comparison Id",
            "description": "Unique ID for this comparison (`cmp_...`)."
          },
          "object": {
            "type": "string",
            "const": "compare.completion",
            "title": "Object",
            "default": "compare.completion"
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp (seconds) when the response was produced."
          },
          "models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Models",
            "description": "Models that were compared, in request order (deduped)."
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/ModelCompareResult"
            },
            "type": "array",
            "title": "Results",
            "description": "Per-model results, in `models` order."
          },
          "comparison": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comparison",
            "description": "Synthesized evaluation of all responses from the comparison LLM. Null when `skip_comparison` is true or fewer than two models succeeded."
          },
          "comparison_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Comparison Model",
            "description": "Model that produced `comparison`. Null when no synthesis ran."
          },
          "comparison_usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenUsage"
              },
              {
                "type": "null"
              }
            ],
            "description": "Token usage for the comparison LLM call."
          },
          "comparison_fallback_used": {
            "type": "boolean",
            "title": "Comparison Fallback Used",
            "description": "True if the primary comparison model failed and a fallback produced the synthesis.",
            "default": false
          },
          "total_latency_ms": {
            "type": "integer",
            "title": "Total Latency Ms",
            "description": "End-to-end latency for the whole compare request, in milliseconds."
          },
          "partial": {
            "type": "boolean",
            "title": "Partial",
            "description": "True if at least one model in `results` returned an error.",
            "default": false
          },
          "skip_comparison": {
            "type": "boolean",
            "title": "Skip Comparison",
            "description": "Echoes whether the comparison LLM step was skipped.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "comparison_id",
          "created",
          "models",
          "results",
          "total_latency_ms"
        ],
        "title": "CompareResponse",
        "example": {
          "comparison": "Both answers are correct; Response 1 is more precise on ordering.",
          "comparison_fallback_used": false,
          "comparison_id": "cmp_019ed1d24227774dba14",
          "comparison_model": "openai/gpt-4o-mini",
          "comparison_usage": {
            "completion_tokens": 405,
            "prompt_tokens": 245,
            "total_tokens": 650
          },
          "created": 1781636687,
          "models": [
            "openai/gpt-4o-mini",
            "anthropic/claude-haiku-4.5"
          ],
          "object": "compare.completion",
          "partial": false,
          "results": [
            {
              "content": "TCP is a connection-oriented protocol...",
              "latency_ms": 812,
              "model": "openai/gpt-4o-mini",
              "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV::openai/gpt-4o-mini",
              "response_body": {
                "choices": [
                  {
                    "finish_reason": "stop",
                    "index": 0,
                    "message": {
                      "content": "TCP is a connection-oriented protocol...",
                      "role": "assistant"
                    }
                  }
                ],
                "id": "chatcmpl-DrTNOwFsT3v79HmQwOwMgEM2IbWJl",
                "model": "gpt-4o-mini-2024-07-18",
                "object": "chat.completion",
                "usage": {
                  "completion_tokens": 47,
                  "prompt_tokens": 24,
                  "total_tokens": 71
                }
              },
              "usage": {
                "completion_tokens": 47,
                "prompt_tokens": 24,
                "total_tokens": 71
              }
            },
            {
              "content": "TCP establishes a connection and guarantees ordered, intact delivery. UDP fires packets without a connection, trading reliability for lower latency.",
              "latency_ms": 650,
              "model": "anthropic/claude-haiku-4.5",
              "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV::anthropic/claude-haiku-4.5",
              "response_body": {
                "choices": [
                  {
                    "finish_reason": "stop",
                    "index": 0,
                    "message": {
                      "content": "TCP establishes a connection and guarantees ordered, intact delivery. UDP fires packets without a connection, trading reliability for lower latency.",
                      "role": "assistant"
                    }
                  }
                ],
                "id": "chatcmpl-019ed1d24b0371a390ab",
                "model": "anthropic/claude-haiku-4.5",
                "object": "chat.completion",
                "usage": {
                  "completion_tokens": 52,
                  "prompt_tokens": 24,
                  "total_tokens": 76
                }
              },
              "usage": {
                "completion_tokens": 52,
                "prompt_tokens": 24,
                "total_tokens": 76
              }
            }
          ],
          "skip_comparison": false,
          "total_latency_ms": 9016
        }
      },
      "CompositeModelConfig": {
        "properties": {
          "text_model": {
            "type": "string",
            "title": "Text Model"
          },
          "image_model": {
            "type": "string",
            "title": "Image Model"
          },
          "vision_enabled": {
            "type": "boolean",
            "title": "Vision Enabled",
            "default": false
          },
          "identity_management": {
            "type": "boolean",
            "title": "Identity Management",
            "default": true
          },
          "refiner_system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refiner System Prompt"
          },
          "markup_percent": {
            "type": "number",
            "title": "Markup Percent",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "text_model",
          "image_model"
        ],
        "title": "CompositeModelConfig",
        "description": "Configuration for a composite (virtual) model that orchestrates a\ntext-refiner and an image-generation engine in sequence.\n\ntext_model:            RouterV model ID for the prompt-refiner LLM.\nimage_model:           RouterV model ID for the image-generation engine.\nvision_enabled:        When True and text_model supports vision, previous\n                       assistant images are forwarded to the refiner.\nidentity_management:   When True, the default Identity Manager system\n                       prompt is used (visual continuity across turns).\nrefiner_system_prompt: Override the default refiner system prompt.\nmarkup_percent:        Deprecated. Composite billing now comes from the\n                       composite model's own price row."
      },
      "CompositeTestConfig": {
        "properties": {
          "text_model": {
            "type": "string",
            "title": "Text Model"
          },
          "image_model": {
            "type": "string",
            "title": "Image Model"
          },
          "vision_enabled": {
            "type": "boolean",
            "title": "Vision Enabled",
            "default": false
          },
          "identity_management": {
            "type": "boolean",
            "title": "Identity Management",
            "default": true
          },
          "refiner_system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refiner System Prompt"
          },
          "refiner_temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refiner Temperature"
          },
          "markup_percent": {
            "type": "number",
            "title": "Markup Percent",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "text_model",
          "image_model"
        ],
        "title": "CompositeTestConfig"
      },
      "ContentPart": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image_url",
              "video_url",
              "input_audio"
            ],
            "title": "Type"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "image_url": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImageUrl"
              },
              {
                "type": "null"
              }
            ]
          },
          "video_url": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoUrl"
              },
              {
                "type": "null"
              }
            ]
          },
          "input_audio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InputAudio"
              },
              {
                "type": "null"
              }
            ]
          },
          "fps": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fps"
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "ContentPart"
      },
      "CountryBreakdown": {
        "properties": {
          "country": {
            "type": "string",
            "title": "Country"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "amount": {
            "type": "string",
            "title": "Amount"
          }
        },
        "type": "object",
        "required": [
          "country",
          "count",
          "amount"
        ],
        "title": "CountryBreakdown"
      },
      "CouponRedemption": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "payment_id": {
            "type": "string",
            "title": "Payment Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount"
          },
          "redeemed_at": {
            "type": "string",
            "title": "Redeemed At"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "payment_id",
          "provider",
          "status",
          "redeemed_at"
        ],
        "title": "CouponRedemption",
        "description": "One recorded use of a coupon, read off the payment it discounted."
      },
      "CouponStatsOut": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "active": {
            "type": "integer",
            "title": "Active"
          },
          "total_redemptions": {
            "type": "integer",
            "title": "Total Redemptions"
          },
          "total_discount_usd": {
            "type": "string",
            "title": "Total Discount Usd"
          }
        },
        "type": "object",
        "required": [
          "total",
          "active",
          "total_redemptions",
          "total_discount_usd"
        ],
        "title": "CouponStatsOut"
      },
      "CouponSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "discount_type": {
            "type": "string",
            "title": "Discount Type"
          },
          "discount_value": {
            "type": "string",
            "title": "Discount Value"
          },
          "maximum_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Maximum Amount"
          },
          "min_purchase_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Purchase Amount"
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount"
          },
          "valid_till": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Till"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "is_public": {
            "type": "boolean",
            "title": "Is Public"
          },
          "max_uses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Uses"
          },
          "used_count": {
            "type": "integer",
            "title": "Used Count"
          },
          "redemption_count": {
            "type": "integer",
            "title": "Redemption Count",
            "default": 0
          },
          "reuse_policy": {
            "type": "string",
            "title": "Reuse Policy"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "user_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "User Ids"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "created_by_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Email"
          }
        },
        "type": "object",
        "required": [
          "id",
          "code",
          "name",
          "discount_type",
          "discount_value",
          "is_active",
          "is_public",
          "used_count",
          "reuse_policy",
          "currency",
          "user_ids"
        ],
        "title": "CouponSummary"
      },
      "CouponValidateRequest": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          }
        },
        "type": "object",
        "required": [
          "code",
          "amount",
          "currency"
        ],
        "title": "CouponValidateRequest"
      },
      "CouponValidateResponse": {
        "properties": {
          "valid": {
            "type": "boolean",
            "title": "Valid"
          },
          "discount_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Type"
          },
          "discount_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Value"
          },
          "discount_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount"
          }
        },
        "type": "object",
        "required": [
          "valid"
        ],
        "title": "CouponValidateResponse"
      },
      "CreateAWSBedrockAPIKeyRequest": {
        "properties": {
          "credential_type": {
            "type": "string",
            "const": "bedrock_api_key",
            "title": "Credential Type"
          },
          "api_key": {
            "type": "string",
            "title": "Api Key"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "type": "boolean",
            "title": "Allow Fallback",
            "default": true
          },
          "team_id": {
            "type": "string",
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "credential_type",
          "api_key",
          "region",
          "team_id"
        ],
        "title": "CreateAWSBedrockAPIKeyRequest",
        "description": "Option 1: Amazon Bedrock API key (single string, region-locked).\n\nGenerate in AWS Management Console \u2192 Amazon Bedrock \u2192 API keys.\nThe key is permanently tied to the AWS region where it was created \u2014\nyou cannot use it in a different region, and the region cannot be changed.\n\nThe caller must provide the AWS region that the key belongs to."
      },
      "CreateAWSIAMRequest": {
        "properties": {
          "credential_type": {
            "type": "string",
            "const": "iam_credentials",
            "title": "Credential Type"
          },
          "access_key_id": {
            "type": "string",
            "title": "Access Key Id"
          },
          "secret_access_key": {
            "type": "string",
            "title": "Secret Access Key"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "type": "boolean",
            "title": "Allow Fallback",
            "default": true
          },
          "team_id": {
            "type": "string",
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "credential_type",
          "access_key_id",
          "secret_access_key",
          "region",
          "team_id"
        ],
        "title": "CreateAWSIAMRequest",
        "description": "Option 2: Traditional AWS IAM credentials (access key + secret + region).\n\nThe IAM user/role needs bedrock:InvokeModel and\nbedrock:InvokeModelWithResponseStream permissions."
      },
      "CreateAdminKeyRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "permissions": {
            "items": {
              "type": "string",
              "enum": [
                "alerts:read",
                "alerts:write",
                "keys:read",
                "keys:write",
                "limits:read",
                "limits:write",
                "org:read"
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Permissions"
          },
          "scope": {
            "type": "string",
            "enum": [
              "self",
              "team",
              "org"
            ]
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "Must include a UTC offset and be no more than 90 days from now. No default \u2014 every admin key expires (D5)."
          }
        },
        "type": "object",
        "required": [
          "name",
          "permissions",
          "scope",
          "expires_at"
        ],
        "title": "CreateAdminKeyRequest"
      },
      "CreateAzureFoundryProviderKeyRequest": {
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "title": "Api Key",
            "description": "Azure AI Foundry primary or secondary key"
          },
          "endpoint": {
            "type": "string",
            "minLength": 1,
            "title": "Endpoint",
            "description": "Full project endpoint URL (e.g. https://my-resource.services.ai.azure.com/api/projects/my-project)"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "type": "boolean",
            "title": "Allow Fallback",
            "default": true
          },
          "team_id": {
            "type": "string",
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "api_key",
          "endpoint",
          "team_id"
        ],
        "title": "CreateAzureFoundryProviderKeyRequest",
        "description": "Azure AI Foundry BYOK credentials.\n\nBoth values from: Azure AI Foundry portal \u2192 your project \u2192 Overview.\nEndpoint format: https://{resource}.services.ai.azure.com/api/projects/{project}"
      },
      "CreateBatchRequest": {
        "properties": {
          "requests": {
            "items": {
              "$ref": "#/components/schemas/BatchRequestItem"
            },
            "type": "array",
            "minItems": 1,
            "title": "Requests"
          },
          "completion_window": {
            "type": "string",
            "title": "Completion Window",
            "default": "24h"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "requests"
        ],
        "title": "CreateBatchRequest",
        "example": {
          "completion_window": "24h",
          "metadata": {
            "job_name": "my-batch-job"
          },
          "requests": [
            {
              "body": {
                "max_tokens": 200,
                "messages": [
                  {
                    "content": "Summarize: Small sample text...",
                    "role": "user"
                  }
                ],
                "model": "openai/gpt-4o-mini",
                "temperature": 0.2
              },
              "custom_id": "item-1",
              "method": "POST",
              "url": "/v1/chat/completions"
            },
            {
              "body": {
                "messages": [
                  {
                    "content": "Translate to French: Hello world",
                    "role": "user"
                  }
                ],
                "model": "openai/gpt-4o-mini"
              },
              "custom_id": "item-2",
              "method": "POST",
              "url": "/v1/chat/completions"
            }
          ]
        }
      },
      "CreateGCPVertexServiceAccountRequest": {
        "properties": {
          "credential_type": {
            "type": "string",
            "const": "vertex_service_account",
            "title": "Credential Type",
            "default": "vertex_service_account"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "default": "service_account"
          },
          "project_id": {
            "type": "string",
            "title": "Project Id"
          },
          "private_key_id": {
            "type": "string",
            "title": "Private Key Id"
          },
          "private_key": {
            "type": "string",
            "title": "Private Key"
          },
          "client_email": {
            "type": "string",
            "title": "Client Email"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id"
          },
          "auth_uri": {
            "type": "string",
            "title": "Auth Uri",
            "default": "https://accounts.google.com/o/oauth2/auth"
          },
          "token_uri": {
            "type": "string",
            "title": "Token Uri",
            "default": "https://oauth2.googleapis.com/token"
          },
          "auth_provider_x509_cert_url": {
            "type": "string",
            "title": "Auth Provider X509 Cert Url",
            "default": "https://www.googleapis.com/oauth2/v1/certs"
          },
          "client_x509_cert_url": {
            "type": "string",
            "title": "Client X509 Cert Url"
          },
          "universe_domain": {
            "type": "string",
            "title": "Universe Domain",
            "default": "googleapis.com"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "type": "boolean",
            "title": "Allow Fallback",
            "default": true
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "project_id",
          "private_key_id",
          "private_key",
          "client_email",
          "client_id",
          "client_x509_cert_url"
        ],
        "title": "CreateGCPVertexServiceAccountRequest",
        "description": "Google Cloud service account key for Vertex AI BYOK.\n\nThe service account must have the ``roles/aiplatform.user`` role and\n``aiplatform.endpoints.predict`` permission.\n\nProvide the full JSON key as downloaded from the GCP console or\ngcloud CLI (``gcloud iam service-accounts keys create``).  The\n``region`` field controls which Vertex AI region is used:\n\n- Omit or set to ``\"global\"`` to allow requests to run in any\n  available region (the adapter will use its default location).\n- Set to a specific region (e.g. ``\"us-central1\"``) to pin all\n  requests to that region."
      },
      "CreateGenericProviderKeyRequest": {
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "title": "Api Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "type": "boolean",
            "title": "Allow Fallback",
            "default": true
          },
          "team_id": {
            "type": "string",
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "api_key",
          "team_id"
        ],
        "title": "CreateGenericProviderKeyRequest"
      },
      "CreateIncidentRequest": {
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "title": "Title"
          },
          "type": {
            "type": "string",
            "enum": [
              "incident",
              "maintenance"
            ],
            "title": "Type",
            "default": "incident"
          },
          "severity": {
            "type": "string",
            "minLength": 1,
            "title": "Severity"
          },
          "status": {
            "type": "string",
            "enum": [
              "investigating",
              "identified",
              "monitoring",
              "resolved",
              "scheduled",
              "completed"
            ],
            "title": "Status"
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "title": "Body",
            "description": "Text of the initial timeline update."
          },
          "affected_components": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Affected Components"
          },
          "scheduled_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Start"
          },
          "scheduled_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled End"
          }
        },
        "type": "object",
        "required": [
          "title",
          "severity",
          "status",
          "body"
        ],
        "title": "CreateIncidentRequest"
      },
      "CreateIncidentUpdateRequest": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "investigating",
              "identified",
              "monitoring",
              "resolved",
              "scheduled",
              "completed"
            ],
            "title": "Status"
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "title": "Body"
          }
        },
        "type": "object",
        "required": [
          "status",
          "body"
        ],
        "title": "CreateIncidentUpdateRequest"
      },
      "CreateMemoryItemRequest": {
        "properties": {
          "item_type": {
            "type": "string",
            "title": "Item Type"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "position": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position"
          }
        },
        "type": "object",
        "required": [
          "item_type",
          "content"
        ],
        "title": "CreateMemoryItemRequest",
        "example": {
          "content": "Always respond in a concise, professional tone.",
          "item_type": "preference",
          "key": "tone",
          "position": 0
        }
      },
      "CreateMemoryRequest": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "name"
        ],
        "title": "CreateMemoryRequest",
        "example": {
          "description": "Per-user tone and style preferences.",
          "name": "User preferences",
          "slug": "mem_user_prefs"
        }
      },
      "CreateModelOverrideRequest": {
        "properties": {
          "model_key": {
            "type": "string",
            "minLength": 1,
            "title": "Model Key"
          },
          "upstream_model_id": {
            "type": "string",
            "minLength": 1,
            "title": "Upstream Model Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "model_key",
          "upstream_model_id"
        ],
        "title": "CreateModelOverrideRequest"
      },
      "CreateOpenAIProviderKeyRequest": {
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "title": "Api Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "type": "boolean",
            "title": "Allow Fallback",
            "default": true
          },
          "team_id": {
            "type": "string",
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "api_key",
          "team_id"
        ],
        "title": "CreateOpenAIProviderKeyRequest"
      },
      "CreateOrgRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "leave_current_org": {
            "type": "boolean",
            "title": "Leave Current Org",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "name",
          "slug"
        ],
        "title": "CreateOrgRequest"
      },
      "CreateProviderKeyRequest": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider",
            "default": "openrouter"
          },
          "secret_ref": {
            "type": "string",
            "title": "Secret Ref"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "secret_ref"
        ],
        "title": "CreateProviderKeyRequest"
      },
      "CreateRoleRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "scope": {
            "$ref": "#/components/schemas/AccessScope"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "name",
          "scope",
          "permissions"
        ],
        "title": "CreateRoleRequest"
      },
      "CreateTeamRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateTeamRequest"
      },
      "CreateTemplateRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "CreateTemplateRequest",
        "example": {
          "name": "Customer Support Template"
        }
      },
      "CreateThreadRequest": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "surface": {
            "type": "string",
            "title": "Surface",
            "default": "chat"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          }
        },
        "type": "object",
        "title": "CreateThreadRequest",
        "example": {
          "messages": [
            {
              "content": "Explain the CAP theorem.",
              "role": "user"
            }
          ],
          "model": "anthropic/claude-sonnet-4.5",
          "params": {
            "temperature": 0.7
          },
          "surface": "chat",
          "title": "CAP theorem explainer"
        }
      },
      "CriterionOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "observed": {
            "type": "string",
            "title": "Observed"
          },
          "threshold": {
            "type": "string",
            "title": "Threshold"
          },
          "population": {
            "type": "string",
            "title": "Population"
          },
          "rationale": {
            "type": "string",
            "title": "Rationale"
          },
          "applicable": {
            "type": "boolean",
            "title": "Applicable",
            "default": true
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "key",
          "ok",
          "observed",
          "threshold",
          "population",
          "rationale"
        ],
        "title": "CriterionOut"
      },
      "CrossProviderModelOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "providers": {
            "items": {
              "$ref": "#/components/schemas/CrossProviderRowOut"
            },
            "type": "array",
            "title": "Providers"
          },
          "weighted_row_count": {
            "type": "integer",
            "title": "Weighted Row Count"
          },
          "is_inert": {
            "type": "boolean",
            "title": "Is Inert"
          },
          "requests": {
            "type": "integer",
            "title": "Requests",
            "default": 0
          },
          "cache_invalidated": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Invalidated"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "providers",
          "weighted_row_count",
          "is_inert"
        ],
        "title": "CrossProviderModelOut"
      },
      "CrossProviderRowOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "routing_weight": {
            "type": "integer",
            "title": "Routing Weight"
          },
          "provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Model Id"
          },
          "configured_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Configured Pct"
          },
          "requests": {
            "type": "integer",
            "title": "Requests",
            "default": 0
          },
          "actual_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actual Pct"
          },
          "error_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Pct"
          },
          "drift_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drift Pct"
          },
          "is_eligible": {
            "type": "boolean",
            "title": "Is Eligible",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "provider",
          "is_default",
          "is_active",
          "routing_weight",
          "provider_model_id"
        ],
        "title": "CrossProviderRowOut",
        "description": "One (model, provider) price row plus how it actually behaved."
      },
      "CrossProviderWeightsIn": {
        "properties": {
          "weights": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "minProperties": 1,
            "title": "Weights"
          }
        },
        "type": "object",
        "required": [
          "weights"
        ],
        "title": "CrossProviderWeightsIn",
        "description": "Full weight map for one model: provider \u2192 weight. Providers omitted are zeroed."
      },
      "CurrencyBreakdown": {
        "properties": {
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "transaction_count": {
            "type": "integer",
            "title": "Transaction Count"
          },
          "total_amount_usd": {
            "type": "string",
            "title": "Total Amount Usd"
          }
        },
        "type": "object",
        "required": [
          "currency",
          "transaction_count",
          "total_amount_usd"
        ],
        "title": "CurrencyBreakdown"
      },
      "CurrencyOption": {
        "properties": {
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "gateway": {
            "type": "string",
            "title": "Gateway"
          },
          "fxRate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fxrate"
          },
          "available": {
            "type": "boolean",
            "title": "Available",
            "default": true
          },
          "gstApplicable": {
            "type": "boolean",
            "title": "Gstapplicable",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "currency",
          "gateway"
        ],
        "title": "CurrencyOption",
        "description": "One currency the customer may pay in, and what paying in it means."
      },
      "CustomDomainRow": {
        "properties": {
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "user_count": {
            "type": "integer",
            "title": "User Count"
          },
          "active_users_30d": {
            "type": "integer",
            "title": "Active Users 30D"
          },
          "api_call_users": {
            "type": "integer",
            "title": "Api Call Users"
          },
          "total_spent_usd": {
            "type": "string",
            "title": "Total Spent Usd"
          },
          "total_recharged_usd": {
            "type": "string",
            "title": "Total Recharged Usd"
          },
          "first_seen": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen"
          },
          "last_activity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity"
          }
        },
        "type": "object",
        "required": [
          "domain",
          "user_count",
          "active_users_30d",
          "api_call_users",
          "total_spent_usd",
          "total_recharged_usd",
          "first_seen",
          "last_activity"
        ],
        "title": "CustomDomainRow",
        "description": "One work-email domain with the health of the users behind it."
      },
      "CustomDomainsOut": {
        "properties": {
          "domains": {
            "items": {
              "$ref": "#/components/schemas/CustomDomainRow"
            },
            "type": "array",
            "title": "Domains"
          },
          "domain_count": {
            "type": "integer",
            "title": "Domain Count"
          },
          "user_count": {
            "type": "integer",
            "title": "User Count"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "domains",
          "domain_count",
          "user_count",
          "limit",
          "offset"
        ],
        "title": "CustomDomainsOut"
      },
      "DailyPoint": {
        "properties": {
          "day": {
            "type": "string",
            "format": "date",
            "title": "Day"
          },
          "last_value": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Last Value"
          },
          "min_value": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Min Value"
          },
          "max_value": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Max Value"
          },
          "unit": {
            "type": "string",
            "title": "Unit"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "samples": {
            "type": "integer",
            "title": "Samples"
          }
        },
        "type": "object",
        "required": [
          "day",
          "last_value",
          "min_value",
          "max_value",
          "unit",
          "source",
          "samples"
        ],
        "title": "DailyPoint"
      },
      "DailySummaryMetrics": {
        "properties": {
          "users_onboarded": {
            "type": "integer",
            "title": "Users Onboarded"
          },
          "unique_active_users": {
            "type": "integer",
            "title": "Unique Active Users"
          },
          "requests_processed": {
            "type": "integer",
            "title": "Requests Processed"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "failed_requests": {
            "type": "integer",
            "title": "Failed Requests"
          },
          "pending_requests": {
            "type": "integer",
            "title": "Pending Requests"
          },
          "success_rate": {
            "type": "string",
            "title": "Success Rate"
          },
          "failure_rate": {
            "type": "string",
            "title": "Failure Rate"
          },
          "pending_rate": {
            "type": "string",
            "title": "Pending Rate"
          },
          "server_failure_count": {
            "type": "integer",
            "title": "Server Failure Count",
            "default": 0
          },
          "client_error_count": {
            "type": "integer",
            "title": "Client Error Count",
            "default": 0
          },
          "retry_attempts": {
            "type": "integer",
            "title": "Retry Attempts",
            "default": 0
          },
          "retried_requests": {
            "type": "integer",
            "title": "Retried Requests",
            "default": 0
          },
          "retried_requests_recovered": {
            "type": "integer",
            "title": "Retried Requests Recovered",
            "default": 0
          },
          "retry_recovery_rate": {
            "type": "string",
            "title": "Retry Recovery Rate",
            "default": "0.0%"
          },
          "server_failure_rate": {
            "type": "string",
            "title": "Server Failure Rate",
            "default": "0.0%"
          },
          "client_error_rate": {
            "type": "string",
            "title": "Client Error Rate",
            "default": "0.0%"
          },
          "usage_usd": {
            "type": "number",
            "title": "Usage Usd"
          },
          "payments_received_usd": {
            "type": "number",
            "title": "Payments Received Usd"
          },
          "coupon_discounts_usd": {
            "type": "number",
            "title": "Coupon Discounts Usd"
          },
          "error_code_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Error Code Counts"
          },
          "surfaces": {
            "items": {
              "$ref": "#/components/schemas/SurfaceMetrics"
            },
            "type": "array",
            "title": "Surfaces",
            "default": []
          },
          "rejections": {
            "$ref": "#/components/schemas/PreDispatchRejections",
            "default": {
              "configured": false,
              "measured": false,
              "counts": {},
              "total": 0
            }
          },
          "rag": {
            "$ref": "#/components/schemas/RagDailyMetrics"
          },
          "latency_by_model_type": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "object",
            "title": "Latency By Model Type",
            "default": {}
          },
          "slowest_models": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Slowest Models",
            "default": []
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "start_ist": {
            "type": "string",
            "format": "date-time",
            "title": "Start Ist"
          }
        },
        "type": "object",
        "required": [
          "users_onboarded",
          "unique_active_users",
          "requests_processed",
          "successful_requests",
          "failed_requests",
          "pending_requests",
          "success_rate",
          "failure_rate",
          "pending_rate",
          "usage_usd",
          "payments_received_usd",
          "coupon_discounts_usd",
          "error_code_counts",
          "rag",
          "timestamp",
          "start_ist"
        ],
        "title": "DailySummaryMetrics"
      },
      "DashboardResponse": {
        "properties": {
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "org": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScopeMetrics"
              },
              {
                "type": "null"
              }
            ]
          },
          "team": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScopeMetrics"
              },
              {
                "type": "null"
              }
            ]
          },
          "member": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScopeMetrics"
              },
              {
                "type": "null"
              }
            ]
          },
          "key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ScopeMetrics"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "as_of",
          "org",
          "team",
          "member"
        ],
        "title": "DashboardResponse"
      },
      "DataVersionValidationOut": {
        "properties": {
          "ok": {
            "type": "boolean",
            "title": "Ok"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Errors"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings"
          }
        },
        "type": "object",
        "required": [
          "ok",
          "errors",
          "warnings"
        ],
        "title": "DataVersionValidationOut"
      },
      "DeepseekPricingSyncResponse": {
        "properties": {
          "band": {
            "type": "string",
            "title": "Band"
          },
          "utc_hour": {
            "type": "integer",
            "title": "Utc Hour"
          },
          "rows_updated": {
            "type": "integer",
            "title": "Rows Updated"
          },
          "models_missing": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Models Missing"
          },
          "already_current": {
            "type": "boolean",
            "title": "Already Current"
          }
        },
        "type": "object",
        "required": [
          "band",
          "utc_hour",
          "rows_updated",
          "models_missing",
          "already_current"
        ],
        "title": "DeepseekPricingSyncResponse"
      },
      "DeriveFromObservedResult": {
        "properties": {
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run"
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Window End"
          },
          "groups_found": {
            "type": "integer",
            "title": "Groups Found"
          },
          "groups_skipped": {
            "type": "integer",
            "title": "Groups Skipped"
          },
          "groups_truncated": {
            "type": "integer",
            "title": "Groups Truncated",
            "default": 0
          },
          "inserted": {
            "type": "integer",
            "title": "Inserted"
          },
          "superseded": {
            "type": "integer",
            "title": "Superseded"
          },
          "unchanged": {
            "type": "integer",
            "title": "Unchanged"
          },
          "metadata_updated": {
            "type": "integer",
            "title": "Metadata Updated",
            "default": 0
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped",
            "default": 0
          },
          "rejected": {
            "type": "integer",
            "title": "Rejected"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/LimitUpsertOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          }
        },
        "type": "object",
        "required": [
          "dry_run",
          "window_start",
          "window_end",
          "groups_found",
          "groups_skipped",
          "inserted",
          "superseded",
          "unchanged",
          "rejected",
          "outcomes"
        ],
        "title": "DeriveFromObservedResult"
      },
      "DiscardRequest": {
        "properties": {
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "title": "DiscardRequest"
      },
      "DiscardResult": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "discarded": {
            "type": "boolean",
            "title": "Discarded"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "cost_usd": {
            "type": "string",
            "title": "Cost Usd"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "id",
          "discarded",
          "owner",
          "cost_usd",
          "message"
        ],
        "title": "DiscardResult"
      },
      "DiscountEndedReason": {
        "type": "string",
        "enum": [
          "disabled",
          "replaced",
          "expired"
        ],
        "title": "DiscountEndedReason"
      },
      "DiscountIn": {
        "properties": {
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "discount_pct": {
            "type": "number",
            "title": "Discount Pct"
          },
          "valid_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid From"
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Until"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "discount_pct"
        ],
        "title": "DiscountIn"
      },
      "DiscountOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "platform_key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Label"
          },
          "discount_pct": {
            "type": "string",
            "title": "Discount Pct"
          },
          "valid_from": {
            "type": "string",
            "title": "Valid From"
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Until"
          },
          "ended_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "ended_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DiscountEndedReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "email",
          "model_id",
          "provider",
          "platform_key_id",
          "platform_key_label",
          "discount_pct",
          "valid_from",
          "valid_until",
          "ended_at",
          "ended_reason",
          "label",
          "created_at"
        ],
        "title": "DiscountOut"
      },
      "DiscountUpdateIn": {
        "properties": {
          "discount_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Pct"
          },
          "valid_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid From"
          },
          "valid_until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Valid Until"
          },
          "ended_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DiscountEndedReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          }
        },
        "type": "object",
        "title": "DiscountUpdateIn"
      },
      "DiscrepancyStateOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "fingerprint": {
            "type": "string",
            "title": "Fingerprint"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "check_type": {
            "type": "string",
            "title": "Check Type"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "subject_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Type"
          },
          "subject_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Ref"
          },
          "last_magnitude_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Magnitude Usd"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time",
            "title": "First Seen At"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "title": "Last Seen At"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "fingerprint",
          "status",
          "note",
          "check_type",
          "provider",
          "model",
          "subject_type",
          "subject_ref",
          "last_magnitude_usd",
          "detail",
          "first_seen_at",
          "last_seen_at",
          "updated_by",
          "updated_at"
        ],
        "title": "DiscrepancyStateOut"
      },
      "DiscrepancyStatesPage": {
        "properties": {
          "discrepancies": {
            "items": {
              "$ref": "#/components/schemas/DiscrepancyStateOut"
            },
            "type": "array",
            "title": "Discrepancies"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "open_count": {
            "type": "integer",
            "title": "Open Count"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "discrepancies",
          "total",
          "open_count",
          "limit",
          "offset"
        ],
        "title": "DiscrepancyStatesPage"
      },
      "DomainCount": {
        "properties": {
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "user_count": {
            "type": "integer",
            "title": "User Count"
          }
        },
        "type": "object",
        "required": [
          "domain",
          "user_count"
        ],
        "title": "DomainCount"
      },
      "DomainCreate": {
        "properties": {
          "provider": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Provider"
          },
          "domain": {
            "type": "string",
            "maxLength": 253,
            "minLength": 3,
            "title": "Domain"
          },
          "include_subdomains": {
            "type": "boolean",
            "title": "Include Subdomains",
            "default": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider",
          "domain"
        ],
        "title": "DomainCreate"
      },
      "DomainOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "include_subdomains": {
            "type": "boolean",
            "title": "Include Subdomains"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider",
          "domain",
          "include_subdomains"
        ],
        "title": "DomainOut"
      },
      "EffectiveLimits": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "key_rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Rpm"
          },
          "key_rpd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Rpd"
          },
          "key_tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Tpm"
          },
          "key_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Spend Cap"
          },
          "effective_rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Rpm"
          },
          "effective_rpd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Rpd"
          },
          "effective_tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Tpm"
          },
          "effective_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Spend Cap"
          },
          "org": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrgContext"
              },
              {
                "type": "null"
              }
            ]
          },
          "team": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TeamContext"
              },
              {
                "type": "null"
              }
            ]
          },
          "member": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MemberContext"
              },
              {
                "type": "null"
              }
            ]
          },
          "team_member": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TeamMemberContext"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "key_rpm",
          "key_rpd",
          "key_tpm",
          "key_spend_cap",
          "effective_rpm",
          "effective_rpd",
          "effective_tpm",
          "effective_spend_cap",
          "org",
          "team",
          "member",
          "team_member"
        ],
        "title": "EffectiveLimits",
        "description": "Final computed limits applying minimum-wins across key \u2192 member \u2192 org tiers."
      },
      "EmbeddingsRequest": {
        "properties": {
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model ID to use for embedding, e.g. `perplexity/pplx-embed-v1-4b`.",
            "examples": [
              "perplexity/pplx-embed-v1-4b",
              "openai/text-embedding-3-small"
            ]
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              {
                "items": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "type": "array"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/MultimodalEmbeddingInput"
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text(s) to embed. Accepts a string, list of strings, list of token IDs, list of token ID lists, or a list of MultimodalEmbeddingInput objects (for BytePlus multimodal embedding models)."
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding vector (model-dependent)."
          },
          "encoding_format": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Encoding Format",
            "description": "Format of the returned embedding. Defaults to `float`."
          },
          "input_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Type",
            "description": "Intended use of the embedding, e.g. `query` or `document`. Some models use this to apply asymmetric embedding."
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ProviderPreferences"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "Provider routing preferences. Pass a provider slug string (e.g. `'perplexity'`) or a `ProviderPreferences` object to control fallback and ordering behaviour."
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          },
          "user": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "User",
            "description": "Deprecated \u2014 use `safety_identifier`.",
            "deprecated": true
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions",
            "description": "Inference prompt for BytePlus multimodal embeddings. A default is generated from the input modality if not set."
          },
          "sparse_embedding": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sparse Embedding",
            "description": "Sparse vector switch for BytePlus text embeddings. Pass {\"type\": \"enabled\"} to return both dense and sparse vectors, or {\"type\": \"disabled\"} for dense only."
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "input"
        ],
        "title": "EmbeddingsRequest",
        "description": "Request body for `POST /v1/embeddings`.\n\nMirrors the OpenAI embeddings API. The `input` field accepts\nfour shapes:\n\n- **string** \u2014 a single text to embed\n- **list[string]** \u2014 a batch of texts\n- **list[int]** \u2014 a single pre-tokenised input (token IDs)\n- **list[list[int]]** \u2014 a batch of pre-tokenised inputs",
        "example": {
          "input": "Hello world",
          "model": "amazon/titan-embed-text-v2"
        }
      },
      "EngagementMetrics": {
        "properties": {
          "continuously_using_users": {
            "type": "integer",
            "title": "Continuously Using Users"
          },
          "active_last_7d": {
            "type": "integer",
            "title": "Active Last 7D"
          },
          "active_last_30d": {
            "type": "integer",
            "title": "Active Last 30D"
          },
          "users_with_errors": {
            "type": "integer",
            "title": "Users With Errors"
          },
          "errored_and_discontinued": {
            "type": "integer",
            "title": "Errored And Discontinued"
          }
        },
        "type": "object",
        "required": [
          "continuously_using_users",
          "active_last_7d",
          "active_last_30d",
          "users_with_errors",
          "errored_and_discontinued"
        ],
        "title": "EngagementMetrics",
        "description": "Lookbacks relative to now \u2014 not affected by start/end date params."
      },
      "EngineActivityOut": {
        "properties": {
          "runs_considered": {
            "type": "integer",
            "title": "Runs Considered"
          },
          "auto": {
            "type": "integer",
            "title": "Auto"
          },
          "held": {
            "type": "integer",
            "title": "Held"
          },
          "applied": {
            "type": "integer",
            "title": "Applied"
          },
          "readback_mismatches": {
            "type": "integer",
            "title": "Readback Mismatches"
          }
        },
        "type": "object",
        "required": [
          "runs_considered",
          "auto",
          "held",
          "applied",
          "readback_mismatches"
        ],
        "title": "EngineActivityOut",
        "description": "actor='engine' auto/hold rows only \u2014 what every engine-health criterion\ngrades. Never mixed with `ManualActivityOut`: admin writes share the table\n(and `set_pin` even mints its own run_id), so conflating them lets a burst\nof pin clicks read as engine health."
      },
      "ErasureRequest": {
        "properties": {
          "end_user_id": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "End User Id",
            "description": "The `user` value as it was sent on the original requests. Matched exactly \u2014 this is an identifier, not a search."
          }
        },
        "type": "object",
        "required": [
          "end_user_id"
        ],
        "title": "ErasureRequest"
      },
      "ErasureResult": {
        "properties": {
          "end_user_id_sha256": {
            "type": "string",
            "title": "End User Id Sha256",
            "description": "SHA-256 of `<org_id>:<end_user_id>`. Returned instead of the identifier so a caller can correlate this erasure in their own records without us echoing back what we just deleted."
          },
          "usage_events_cleared": {
            "type": "integer",
            "title": "Usage Events Cleared",
            "description": "Rows whose attribution was removed. The billing rows themselves survive \u2014 only `end_user_id` is nulled. Capped per call; if the cap was reached, `usage_events` appears in `pending` and the call should be repeated."
          },
          "job_rows_cleared": {
            "type": "integer",
            "title": "Job Rows Cleared",
            "description": "Rows cleared on the job tables for the surfaces that settle after the request \u2014 batch, background responses and video \u2014 each of which carries the identifier itself because its usage row is written later. Not capped: these tables are orders of magnitude smaller than usage_events.",
            "default": 0
          },
          "pending": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pending",
            "description": "Stores this call did NOT erase. Present so the response cannot be read as a complete-erasure claim when it is not one."
          },
          "reattributable_until_traffic_stops": {
            "type": "boolean",
            "title": "Reattributable Until Traffic Stops",
            "description": "Always true, and stated rather than implied. Usage rows are written ASYNCHRONOUSLY after a request finishes, so a request already in flight for this end user can re-attribute a row after this call returns. The erasure is a point in time, not a lock. Call again once traffic for the identifier has stopped; the call is idempotent.",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "end_user_id_sha256",
          "usage_events_cleared",
          "pending"
        ],
        "title": "ErasureResult"
      },
      "ErrorAnalyticsOut": {
        "properties": {
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests"
          },
          "error_rate": {
            "type": "number",
            "title": "Error Rate"
          },
          "by_category": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Category"
          },
          "by_provider": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Provider"
          },
          "by_code": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Code"
          },
          "by_model": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Model"
          },
          "top_keys": {
            "items": {
              "$ref": "#/components/schemas/ErrorKeyCount"
            },
            "type": "array",
            "title": "Top Keys"
          },
          "time_series": {
            "items": {
              "$ref": "#/components/schemas/ErrorAnalyticsPoint"
            },
            "type": "array",
            "title": "Time Series"
          }
        },
        "type": "object",
        "required": [
          "total_requests",
          "error_requests",
          "error_rate",
          "by_category",
          "by_provider",
          "by_code",
          "by_model",
          "top_keys",
          "time_series"
        ],
        "title": "ErrorAnalyticsOut",
        "description": "Admin error-tracking dashboard (MESH-366).\n\nTRUE categories/codes \u2014 ops must see the real credential/billing/quota cause\n(never the caller-facing opaque-ization). Synthetic health-check probes are\nexcluded and retried \"waste\" rows collapsed to the served row, so counts\nreflect real customer traffic."
      },
      "ErrorAnalyticsPoint": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "errors"
        ],
        "title": "ErrorAnalyticsPoint"
      },
      "ErrorCatalogOut": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version",
            "description": "Cache key / ETag \u2014 changes when the catalog changes."
          },
          "codes": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ErrorCopy"
            },
            "type": "object",
            "title": "Codes",
            "description": "Per-code copy, keyed by the specific identifier a client has (the semantic provider_code when present, else the top-level error code)."
          },
          "categories": {
            "additionalProperties": {
              "$ref": "#/components/schemas/ErrorCategoryCopy"
            },
            "type": "object",
            "title": "Categories",
            "description": "Per-category fallback copy + badge label, used when no code matches."
          },
          "default": {
            "$ref": "#/components/schemas/ErrorCopy",
            "description": "Last-resort copy when neither code nor category matches."
          }
        },
        "type": "object",
        "required": [
          "version",
          "codes",
          "categories",
          "default"
        ],
        "title": "ErrorCatalogOut"
      },
      "ErrorCategory": {
        "type": "string",
        "enum": [
          "user_input",
          "capability",
          "credential",
          "billing",
          "quota",
          "provider_down",
          "timeout"
        ],
        "title": "ErrorCategory"
      },
      "ErrorCategoryCopy": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Short human label, e.g. 'Context length exceeded'."
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "One-sentence plain-English explanation."
          },
          "action": {
            "type": "string",
            "title": "Action",
            "description": "What the caller can do about it (empty when nothing is)."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Display label (badge text) for the category."
          }
        },
        "type": "object",
        "required": [
          "title",
          "description",
          "action",
          "label"
        ],
        "title": "ErrorCategoryCopy"
      },
      "ErrorCodesOut": {
        "properties": {
          "error_codes": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Error Codes"
          }
        },
        "type": "object",
        "required": [
          "error_codes"
        ],
        "title": "ErrorCodesOut"
      },
      "ErrorCopy": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Short human label, e.g. 'Context length exceeded'."
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "One-sentence plain-English explanation."
          },
          "action": {
            "type": "string",
            "title": "Action",
            "description": "What the caller can do about it (empty when nothing is)."
          }
        },
        "type": "object",
        "required": [
          "title",
          "description",
          "action"
        ],
        "title": "ErrorCopy"
      },
      "ErrorDetail": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "param": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Param"
          },
          "details": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "provider_error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProviderError"
              },
              {
                "type": "null"
              }
            ]
          },
          "retry_after_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry After Seconds"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorDetail"
      },
      "ErrorEnvelope": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorEnvelope"
      },
      "ErrorKeyCount": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "errors"
        ],
        "title": "ErrorKeyCount"
      },
      "ErrorLogRow": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "provider_request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Request Id"
          },
          "upstream_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Status"
          },
          "provider_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Error Code"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "is_byok": {
            "type": "boolean",
            "title": "Is Byok"
          },
          "error_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Detail"
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "request_id",
          "user_id",
          "email",
          "model",
          "provider",
          "error_code",
          "provider_request_id",
          "upstream_status",
          "provider_error_code",
          "category",
          "is_byok",
          "error_detail",
          "prompt_tokens",
          "latency_ms",
          "created_at"
        ],
        "title": "ErrorLogRow"
      },
      "EventKeyDetailsOut": {
        "properties": {
          "api_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/app__routers__admin__KeySummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "byok_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdminProviderKeyOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "EventKeyDetailsOut",
        "description": "Gateway key + BYOK provider key behind a single request (either may be null)."
      },
      "EventRequestLogOut": {
        "properties": {
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "description": "How far back the request log resolves an id."
          },
          "request_headers": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestHeadersOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "NULL when the record has aged out, or the request log is unreachable \u2014 an observability read never fails the panels beside it."
          },
          "request_bodies": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestBodiesOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "NULL for any of the reasons `bodies_status` names."
          },
          "bodies_status": {
            "type": "string",
            "enum": [
              "available",
              "forbidden",
              "policy_off",
              "audit_unavailable",
              "unavailable",
              "not_stored"
            ],
            "title": "Bodies Status",
            "description": "Why `request_bodies` is what it is. `forbidden` \u2014 the caller lacks `customer:read_bodies`; the headers above are served on the weaker `customer:read`. `policy_off` \u2014 body logging is switched off platform-wide. `audit_unavailable` \u2014 the audit trail is disabled, and this read is not performed unless it can be recorded. `unavailable` \u2014 the request log could not be reached. All four mean the bodies may well exist. `not_stored` \u2014 nothing was captured for this request, or the record aged out; this surface reads with the admin override, so neither the serving key's `body_log_policy` nor the org's zero-data-retention flag can withhold a body here.",
            "default": "not_stored"
          },
          "video_task": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdminRequestVideoTaskOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The video generation task this request created. NULL for any other request. Its `video_url`/`last_frame_url` are withheld without `customer:read_bodies`."
          }
        },
        "type": "object",
        "required": [
          "request_id",
          "retention_days"
        ],
        "title": "EventRequestLogOut",
        "description": "The stored HTTP record behind one usage event, for the admin inspector.\n\nThe admin counterpart to the header/body panels on ``RequestLookupOut``, kept\nseparate because the operator already holds the usage row and needs only what\nthe request log adds to it."
      },
      "EvidenceListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/EvidenceOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "EvidenceListOut"
      },
      "EvidenceOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "field_names": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field Names"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "sha256": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sha256"
          },
          "captured_at": {
            "type": "string",
            "format": "date-time",
            "title": "Captured At"
          },
          "blob_available": {
            "type": "boolean",
            "title": "Blob Available"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "url",
          "provider",
          "model_id",
          "field_names",
          "region",
          "run_id",
          "http_status",
          "sha256",
          "captured_at",
          "blob_available"
        ],
        "title": "EvidenceOut"
      },
      "EvidenceUploadOut": {
        "properties": {
          "evidence": {
            "$ref": "#/components/schemas/EvidenceOut"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "evidence"
        ],
        "title": "EvidenceUploadOut"
      },
      "FacetValue": {
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "value",
          "count"
        ],
        "title": "FacetValue",
        "description": "One selectable filter value and how many models it would return."
      },
      "FallbackInputConfig": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          },
          "cross_provider_same_model": {
            "type": "boolean",
            "title": "Cross Provider Same Model",
            "default": false
          },
          "models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 3,
            "title": "Models"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "FallbackInputConfig"
      },
      "FileListResponse": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/FileStatusResponse"
            },
            "type": "array",
            "title": "Files"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "files",
          "total",
          "limit",
          "offset"
        ],
        "title": "FileListResponse"
      },
      "FileStatusResponse": {
        "properties": {
          "file_id": {
            "type": "string",
            "title": "File Id"
          },
          "upload_status": {
            "type": "string",
            "title": "Upload Status"
          },
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "file_type": {
            "type": "string",
            "title": "File Type"
          },
          "mime_type": {
            "type": "string",
            "title": "Mime Type"
          },
          "size_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size Bytes"
          },
          "asset_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Asset Url"
          },
          "signed_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Url"
          },
          "signed_url_expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Url Expires At"
          },
          "embedding_status": {
            "type": "string",
            "title": "Embedding Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost Usd"
          },
          "last_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error Code"
          }
        },
        "type": "object",
        "required": [
          "file_id",
          "upload_status",
          "file_name",
          "file_type",
          "mime_type",
          "size_bytes",
          "asset_url",
          "signed_url",
          "signed_url_expires_at",
          "embedding_status",
          "created_at",
          "updated_at"
        ],
        "title": "FileStatusResponse"
      },
      "FreeCreditConfigResponse": {
        "properties": {
          "default_amount_inr": {
            "type": "string",
            "title": "Default Amount Inr"
          },
          "default_currency": {
            "type": "string",
            "title": "Default Currency"
          },
          "inr_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inr Rate"
          },
          "inr_total_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inr Total Rate"
          },
          "rate_available": {
            "type": "boolean",
            "title": "Rate Available"
          }
        },
        "type": "object",
        "required": [
          "default_amount_inr",
          "default_currency",
          "inr_rate",
          "inr_total_rate",
          "rate_available"
        ],
        "title": "FreeCreditConfigResponse"
      },
      "FreeCreditGrantOut": {
        "properties": {
          "payment_id": {
            "type": "string",
            "title": "Payment Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "entered_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entered Amount"
          },
          "amount_usd": {
            "type": "string",
            "title": "Amount Usd"
          },
          "coupon_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Code"
          },
          "granted_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Granted By"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "created_by_grant": {
            "type": "boolean",
            "title": "Created By Grant"
          },
          "signed_up": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Up"
          },
          "balance_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Balance Usd"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "payment_id",
          "user_id",
          "email",
          "display_name",
          "currency",
          "entered_amount",
          "amount_usd",
          "coupon_code",
          "granted_by",
          "note",
          "created_by_grant",
          "signed_up",
          "balance_usd",
          "created_at"
        ],
        "title": "FreeCreditGrantOut"
      },
      "FreeCreditGrantsPage": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "summary": {
            "$ref": "#/components/schemas/FreeCreditGrantsSummary"
          },
          "grants": {
            "items": {
              "$ref": "#/components/schemas/FreeCreditGrantOut"
            },
            "type": "array",
            "title": "Grants"
          }
        },
        "type": "object",
        "required": [
          "total",
          "limit",
          "offset",
          "summary",
          "grants"
        ],
        "title": "FreeCreditGrantsPage"
      },
      "FreeCreditGrantsSummary": {
        "properties": {
          "total_grants": {
            "type": "integer",
            "title": "Total Grants"
          },
          "distinct_users": {
            "type": "integer",
            "title": "Distinct Users"
          },
          "signed_up_users": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed Up Users"
          },
          "total_usd_granted": {
            "type": "string",
            "title": "Total Usd Granted"
          }
        },
        "type": "object",
        "required": [
          "total_grants",
          "distinct_users",
          "signed_up_users",
          "total_usd_granted"
        ],
        "title": "FreeCreditGrantsSummary"
      },
      "FunnelMetrics": {
        "properties": {
          "registered_users": {
            "type": "integer",
            "title": "Registered Users"
          },
          "signed_in_users": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signed In Users"
          },
          "custom_email_domain_users": {
            "type": "integer",
            "title": "Custom Email Domain Users"
          },
          "credited_users": {
            "type": "integer",
            "title": "Credited Users"
          },
          "paid_money_users": {
            "type": "integer",
            "title": "Paid Money Users"
          },
          "api_call_users": {
            "type": "integer",
            "title": "Api Call Users"
          },
          "successful_api_call_users": {
            "type": "integer",
            "title": "Successful Api Call Users"
          },
          "registered_users_without_api_call": {
            "type": "integer",
            "title": "Registered Users Without Api Call"
          }
        },
        "type": "object",
        "required": [
          "registered_users",
          "signed_in_users",
          "custom_email_domain_users",
          "credited_users",
          "paid_money_users",
          "api_call_users",
          "successful_api_call_users",
          "registered_users_without_api_call"
        ],
        "title": "FunnelMetrics"
      },
      "FxRefreshResponse": {
        "properties": {
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "rate": {
            "type": "string",
            "title": "Rate"
          },
          "markup_fee": {
            "type": "string",
            "title": "Markup Fee"
          },
          "total_rate": {
            "type": "string",
            "title": "Total Rate"
          }
        },
        "type": "object",
        "required": [
          "currency",
          "rate",
          "markup_fee",
          "total_rate"
        ],
        "title": "FxRefreshResponse"
      },
      "GlobalTemplateRequest": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "writing",
                  "code",
                  "support",
                  "data",
                  "marketing",
                  "agents",
                  "productivity",
                  "research",
                  "sales",
                  "operations"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "is_beta": {
            "type": "boolean",
            "title": "Is Beta",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "GlobalTemplateRequest"
      },
      "GlobalTemplateSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "is_beta": {
            "type": "boolean",
            "title": "Is Beta"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "system",
          "messages",
          "model",
          "params",
          "variables",
          "category",
          "version",
          "is_beta",
          "created_at",
          "updated_at"
        ],
        "title": "GlobalTemplateSummary"
      },
      "GlobalTemplateUpdateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "category": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "writing",
                  "code",
                  "support",
                  "data",
                  "marketing",
                  "agents",
                  "productivity",
                  "research",
                  "sales",
                  "operations"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "is_beta": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Beta"
          }
        },
        "type": "object",
        "title": "GlobalTemplateUpdateRequest"
      },
      "GrantRoleIn": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "When the grant lapses. NULL is standing. A lapsed grant stops counting immediately (the active predicate compares against the database clock) and is closed out \u2014 revoked_by='expired', with its own audit entry \u2014 the next time the same role is granted."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "GrantRoleIn"
      },
      "GstinResponse": {
        "properties": {
          "valid": {
            "type": "boolean",
            "title": "Valid"
          },
          "gstin": {
            "type": "string",
            "title": "Gstin"
          },
          "legal_name": {
            "type": "string",
            "title": "Legal Name"
          },
          "trade_name": {
            "type": "string",
            "title": "Trade Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "business_type": {
            "type": "string",
            "title": "Business Type"
          },
          "taxpayer_type": {
            "type": "string",
            "title": "Taxpayer Type"
          },
          "registration_date": {
            "type": "string",
            "title": "Registration Date"
          },
          "cancellation_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancellation Date"
          },
          "address": {
            "type": "string",
            "title": "Address"
          }
        },
        "type": "object",
        "required": [
          "valid",
          "gstin",
          "legal_name",
          "trade_name",
          "status",
          "business_type",
          "taxpayer_type",
          "registration_date",
          "cancellation_date",
          "address"
        ],
        "title": "GstinResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HackathonStatusOut": {
        "properties": {
          "registered": {
            "type": "boolean",
            "title": "Registered"
          },
          "registered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registered At"
          }
        },
        "type": "object",
        "required": [
          "registered"
        ],
        "title": "HackathonStatusOut"
      },
      "HeadroomItem": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "declared_scope": {
            "type": "string",
            "enum": [
              "model",
              "provider",
              "none"
            ],
            "title": "Declared Scope"
          },
          "declared_known": {
            "type": "boolean",
            "title": "Declared Known"
          },
          "unknown_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unknown Reason"
          },
          "declared_sources": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Declared Sources"
          },
          "declared_rows": {
            "type": "integer",
            "title": "Declared Rows",
            "default": 0
          },
          "declared_field_scopes": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Declared Field Scopes"
          },
          "declared_rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Rpm"
          },
          "declared_tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Tpm"
          },
          "declared_rpd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Rpd"
          },
          "declared_tpd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Tpd"
          },
          "declared_max_concurrent_requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Declared Max Concurrent Requests"
          },
          "observed_known": {
            "type": "boolean",
            "title": "Observed Known",
            "default": false
          },
          "observed_peak_rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Peak Rpm"
          },
          "observed_peak_tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Peak Tpm"
          },
          "observed_buckets": {
            "type": "integer",
            "title": "Observed Buckets",
            "default": 0
          },
          "observed_requests": {
            "type": "integer",
            "title": "Observed Requests",
            "default": 0
          },
          "observed_byok_requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Byok Requests"
          },
          "observed_byok_share_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Byok Share Pct"
          },
          "headroom_rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Headroom Rpm"
          },
          "headroom_tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Headroom Tpm"
          },
          "rpm_utilisation_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Utilisation Pct"
          },
          "tpm_utilisation_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Utilisation Pct"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "model",
          "declared_scope",
          "declared_known"
        ],
        "title": "HeadroomItem"
      },
      "HeadroomReport": {
        "properties": {
          "window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Window End"
          },
          "granularity": {
            "type": "string",
            "title": "Granularity"
          },
          "pairs": {
            "type": "integer",
            "title": "Pairs"
          },
          "pairs_with_declared_limits": {
            "type": "integer",
            "title": "Pairs With Declared Limits"
          },
          "pairs_without_declared_limits": {
            "type": "integer",
            "title": "Pairs Without Declared Limits"
          },
          "caveats": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Caveats"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/HeadroomItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "window_start",
          "window_end",
          "granularity",
          "pairs",
          "pairs_with_declared_limits",
          "pairs_without_declared_limits",
          "items"
        ],
        "title": "HeadroomReport"
      },
      "HeldFieldOut": {
        "properties": {
          "field_name": {
            "type": "string",
            "title": "Field Name"
          },
          "old": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Old"
          },
          "new": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "New"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "evidence_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Evidence Ids"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "agent_recommendation": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Recommendation"
          },
          "candidates": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Candidates"
          },
          "stale_since_catalog_sync": {
            "type": "boolean",
            "title": "Stale Since Catalog Sync",
            "default": false
          },
          "verifier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VerifierFindingOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "plan_old": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plan Old"
          },
          "observed_current": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Observed Current"
          },
          "refetched": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refetched"
          },
          "refetch_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refetch Source"
          },
          "refetch_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refetch Detail"
          },
          "refetch_delta_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refetch Delta Pct"
          },
          "refetched_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refetched At"
          },
          "shadow": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ShadowOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "field_name",
          "old",
          "new",
          "reason",
          "source"
        ],
        "title": "HeldFieldOut"
      },
      "HostedToolKind": {
        "type": "string",
        "enum": [
          "code_interpreter",
          "computer_use",
          "file_search",
          "web_search"
        ],
        "title": "HostedToolKind"
      },
      "ImageBlock": {
        "properties": {
          "type": {
            "type": "string",
            "const": "image",
            "title": "Type",
            "default": "image"
          },
          "source": {
            "$ref": "#/components/schemas/ImageSource"
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "required": [
          "source"
        ],
        "title": "ImageBlock"
      },
      "ImageEmbeddingUrl": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "ImageEmbeddingUrl"
      },
      "ImageGenerationRequest": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "n": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "N",
            "default": 1
          },
          "quality": {
            "type": "string",
            "title": "Quality",
            "default": "auto"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ],
            "title": "Response Format",
            "default": "url"
          },
          "size": {
            "type": "string",
            "title": "Size",
            "default": "auto"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "output_format": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "webp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Format"
          },
          "output_compression": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Compression"
          },
          "background": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "transparent",
                  "opaque",
                  "auto"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Background"
          },
          "moderation": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "low",
                  "auto"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Moderation"
          },
          "partial_images": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 3.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Partial Images"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647.0,
                "minimum": -1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "sequential_image_generation": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "disabled"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequential Image Generation"
          },
          "sequential_image_generation_options": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequential Image Generation Options"
          },
          "guidance_scale": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 10.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Guidance Scale"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Watermark"
          },
          "optimize_prompt": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Optimize Prompt"
          },
          "optimize_prompt_options": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Optimize Prompt Options"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "prompt"
        ],
        "title": "ImageGenerationRequest",
        "example": {
          "model": "openai/gpt-image-1-mini",
          "prompt": "A children drawing of a veterinarian and a baby otter",
          "response_format": "url",
          "stream": false
        }
      },
      "ImageOptions": {
        "properties": {
          "n": {
            "type": "integer",
            "maximum": 10.0,
            "minimum": 1.0,
            "title": "N",
            "default": 1
          },
          "size": {
            "type": "string",
            "title": "Size",
            "default": "auto"
          },
          "quality": {
            "type": "string",
            "title": "Quality",
            "default": "auto"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "url",
              "b64_json"
            ],
            "title": "Response Format",
            "default": "url"
          },
          "output_format": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "png",
                  "jpeg",
                  "webp"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Format"
          },
          "output_compression": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Compression"
          },
          "background": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "transparent",
                  "opaque",
                  "auto"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Background"
          },
          "moderation": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "low",
                  "auto"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Moderation"
          },
          "partial_images": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 3.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Partial Images"
          },
          "aspect_ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Aspect Ratio"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647.0,
                "minimum": -1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "sequential_image_generation": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "disabled"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequential Image Generation"
          },
          "sequential_image_generation_options": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequential Image Generation Options"
          },
          "guidance_scale": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 10.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Guidance Scale"
          },
          "watermark": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Watermark"
          },
          "optimize_prompt": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Optimize Prompt"
          },
          "optimize_prompt_options": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Optimize Prompt Options"
          }
        },
        "type": "object",
        "title": "ImageOptions"
      },
      "ImageSource": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "base64",
              "url"
            ],
            "title": "Type"
          },
          "media_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Media Type"
          },
          "data": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "ImageSource",
        "description": "Anthropic carries images as a typed source object rather than a URL string.\n\n``base64`` names its own ``media_type``; ``url`` is a plain remote reference.\nBoth invert to an OpenAI ``image_url`` \u2014 see ``_image_block_to_url``, the\ninverse of ``_image_source`` (``app/providers/anthropic.py:100-123``)."
      },
      "ImageUrl": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "detail": {
            "type": "string",
            "enum": [
              "auto",
              "low",
              "high"
            ],
            "title": "Detail",
            "default": "auto"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "ImageUrl"
      },
      "IncidentOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "severity": {
            "type": "string",
            "title": "Severity"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "affected_components": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Affected Components"
          },
          "scheduled_start": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Start"
          },
          "scheduled_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled End"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "updates": {
            "items": {
              "$ref": "#/components/schemas/IncidentUpdateOut"
            },
            "type": "array",
            "title": "Updates"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "type",
          "severity",
          "status",
          "affected_components",
          "scheduled_start",
          "scheduled_end",
          "created_at",
          "updated_at",
          "updates"
        ],
        "title": "IncidentOut"
      },
      "IncidentUpdateOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "body": {
            "type": "string",
            "title": "Body"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "body",
          "created_at"
        ],
        "title": "IncidentUpdateOut"
      },
      "InitUploadRequest": {
        "properties": {
          "file_name": {
            "type": "string",
            "title": "File Name"
          },
          "mime_type": {
            "type": "string",
            "title": "Mime Type"
          },
          "embed": {
            "type": "boolean",
            "title": "Embed",
            "default": true
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "file_name",
          "mime_type"
        ],
        "title": "InitUploadRequest",
        "example": {
          "file_name": "project_proposal.pdf",
          "mime_type": "application/pdf"
        }
      },
      "InitUploadResponse": {
        "properties": {
          "file_id": {
            "type": "string",
            "title": "File Id"
          },
          "signed_url": {
            "type": "string",
            "title": "Signed Url"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "required_headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Required Headers"
          },
          "max_size_bytes": {
            "type": "integer",
            "title": "Max Size Bytes",
            "default": 52428800
          }
        },
        "type": "object",
        "required": [
          "file_id",
          "signed_url",
          "expires_at"
        ],
        "title": "InitUploadResponse"
      },
      "InputAudio": {
        "properties": {
          "data": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uri"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "format": {
            "type": "string",
            "enum": [
              "wav",
              "mp3",
              "aiff",
              "aac",
              "ogg",
              "flac",
              "m4a",
              "pcm16",
              "pcm24"
            ],
            "title": "Format"
          }
        },
        "type": "object",
        "required": [
          "format"
        ],
        "title": "InputAudio"
      },
      "InternalAdminRevokeKeyRequest": {
        "properties": {
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 3,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "reason"
        ],
        "title": "InternalAdminRevokeKeyRequest"
      },
      "InvitationPreview": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "team_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Name"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_name",
          "role",
          "email",
          "expires_at"
        ],
        "title": "InvitationPreview"
      },
      "InvitationResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "invited_by": {
            "type": "string",
            "title": "Invited By"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "team_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Name"
          },
          "custom_role_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Custom Role Ids",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "status",
          "invited_by",
          "expires_at",
          "created_at"
        ],
        "title": "InvitationResponse"
      },
      "InviteMemberRequest": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "default": "member"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "custom_role_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 100,
            "title": "Custom Role Ids"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "InviteMemberRequest",
        "description": "``custom_role_ids`` grants custom roles the moment the invitee joins.\n\nTyped as UUID and bounded for the same reasons as ``SetMemberRolesRequest``.\nAdditive to ``role``, never a replacement \u2014 a custom role adds permissions on\ntop of the built-in one, so an invite carrying roles still names a role."
      },
      "KeyDiscountOut": {
        "properties": {
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "discount_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Pct"
          },
          "is_pinned": {
            "type": "boolean",
            "title": "Is Pinned",
            "default": false
          }
        },
        "type": "object",
        "title": "KeyDiscountOut",
        "description": "The EXACT rate one platform key would bill this (model, provider) at.\n\nA sibling account's key-scoped row never applies, so these are listed rather\nthan summarised into one number. See DECISIONS.md."
      },
      "KeyFilterOption": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_byok": {
            "type": "boolean",
            "title": "Is Byok"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "is_byok",
          "provider"
        ],
        "title": "KeyFilterOption",
        "description": "Slim key descriptor for filter dropdowns \u2014 combines API keys and BYOK keys."
      },
      "KeyModelBreakdown": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "cost_usd": {
            "type": "number",
            "title": "Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "model",
          "requests",
          "cost_usd"
        ],
        "title": "KeyModelBreakdown"
      },
      "KeyRoutingPolicyInput": {
        "properties": {
          "retry": {
            "$ref": "#/components/schemas/RetryInputConfig"
          },
          "fallback": {
            "$ref": "#/components/schemas/FallbackInputConfig"
          },
          "budget": {
            "$ref": "#/components/schemas/BudgetInputConfig"
          },
          "weight_profile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Weight Profile"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "KeyRoutingPolicyInput",
        "description": "The user-editable subset of a per-key routing policy.\n\n``retry``, ``fallback``, and ``budget`` are editable per key, but only their BASIC\nfields (see the ``*InputConfig`` models) \u2014 advanced retry/fallback knobs are\nintentionally excluded and resolve from system defaults. ``circuit_breaker`` is a\nGLOBAL, settings-driven safety valve (per-key values are discarded by\n``resolve_routing_policy``) and stays off the form. ``fallback`` is live as of FT-244 v1:\nset ``fallback.enabled`` + ``fallback.cross_provider_same_model`` to fail a request over to\nthe same model on another provider when the primary provider errors, and/or\n``fallback.models`` to try alternate models (in order) after the same-model hops are\nexhausted. A stored blob of\n``{retry, fallback, budget}`` is a valid partial policy that ``resolve_routing_policy``\noverlays on the global defaults \u2014 omitted (advanced) fields inherit those defaults.\n\n``weight_profile`` (MESH-644) is the auto-router weight-profile this key/template\nselects for ``model=\"auto\"`` \u2014 the per-key (tier 2) and team/org-template (tier 3)\ntiers of ``app.auto_router.profile_precedence``. It rides this same ``routing_policy``\nJSONB (migration-free) but is orthogonal to retry/fallback: ``resolve_routing_policy``\nignores it, and the auto-router reads the sub-key directly without the retry kill switch.\nValidated against the known profile names at WRITE time (a typo is a 422, not a silent\nfail-soft to the default months later); blank \u21d2 unset."
      },
      "KeySuspensionResult": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "keys_affected": {
            "type": "integer",
            "title": "Keys Affected"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "keys_affected"
        ],
        "title": "KeySuspensionResult"
      },
      "KeyUsageSummary": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests"
          },
          "total_input_tokens": {
            "type": "integer",
            "title": "Total Input Tokens"
          },
          "total_output_tokens": {
            "type": "integer",
            "title": "Total Output Tokens"
          },
          "total_cost_usd": {
            "type": "number",
            "title": "Total Cost Usd"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "spend_cap_remaining_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Remaining Usd"
          },
          "model_breakdown": {
            "items": {
              "$ref": "#/components/schemas/KeyModelBreakdown"
            },
            "type": "array",
            "title": "Model Breakdown"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "owner",
          "total_requests",
          "successful_requests",
          "error_requests",
          "total_input_tokens",
          "total_output_tokens",
          "total_cost_usd",
          "spend_cap_usd",
          "spend_cap_remaining_usd",
          "model_breakdown"
        ],
        "title": "KeyUsageSummary"
      },
      "LimitUpsertOutcome": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "provider_key_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Key Id"
          },
          "credential_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Label"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "status": {
            "type": "string",
            "enum": [
              "inserted",
              "superseded",
              "unchanged",
              "metadata_updated",
              "skipped",
              "rejected"
            ],
            "title": "Status"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "skip_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skip Code"
          },
          "id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id"
          },
          "superseded_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Superseded Id"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "status"
        ],
        "title": "LimitUpsertOutcome"
      },
      "LivenessResult": {
        "properties": {
          "window_hours": {
            "type": "integer",
            "title": "Window Hours"
          },
          "config_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config Name"
          },
          "configured_strategies": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Configured Strategies"
          },
          "selected_paths": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Selected Paths"
          },
          "evidence_since": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Since"
          },
          "entries_scanned": {
            "type": "integer",
            "title": "Entries Scanned"
          },
          "strategies": {
            "items": {
              "$ref": "#/components/schemas/StrategyReport"
            },
            "type": "array",
            "title": "Strategies"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/app__routers__auto_router_liveness__FindingReport"
            },
            "type": "array",
            "title": "Findings"
          },
          "alerted": {
            "type": "boolean",
            "title": "Alerted",
            "default": false
          },
          "skipped_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skipped Reason"
          }
        },
        "type": "object",
        "required": [
          "window_hours",
          "entries_scanned"
        ],
        "title": "LivenessResult"
      },
      "MaintainResponse": {
        "properties": {
          "partition_statements_executed": {
            "type": "integer",
            "title": "Partition Statements Executed",
            "description": "Number of CREATE TABLE IF NOT EXISTS ... PARTITION OF statements executed this run \u2014 always 2 on success (current month + next month), regardless of whether either partition already existed (CREATE ... IF NOT EXISTS makes re-running harmless). Not a net-new-partitions count."
          },
          "rollup_rows_written": {
            "type": "integer",
            "title": "Rollup Rows Written",
            "description": "Number of price_observations_daily rows inserted or refreshed by the downsample upsert this run. A row count, not a count of distinct days."
          },
          "partitions_dropped": {
            "type": "integer",
            "title": "Partitions Dropped",
            "description": "Number of monthly partitions whose entire date range aged past pricing_observations_raw_days and were DROP TABLE'd this run."
          },
          "downsample_scan_used_partition_floor": {
            "type": "boolean",
            "title": "Downsample Scan Used Partition Floor",
            "description": "True when the downsample scan's lower bound tracked the oldest still-attached partition (the structural guarantee that retention can never outrun rollup). False means either zero partitions are attached (safe \u2014 nothing exists yet for phase 3 to drop either) or the partition-floor lookup failed, in which case downsample (and, via the phase-3 guard, partition_drop) was SKIPPED this run and the reason is in `errors` \u2014 this field alone can't distinguish the two; check `errors` for 'partition-floor lookup failed'."
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Errors",
            "description": "Non-fatal phase failures. Phases 1 and 2 always both run regardless of each other's outcome; phase 3 (partition_drop) runs only when phases 1+2 both succeeded, since dropping a partition destroys exactly the rows a failed downsample didn't get to preserve."
          }
        },
        "type": "object",
        "required": [
          "partition_statements_executed",
          "rollup_rows_written",
          "partitions_dropped",
          "downsample_scan_used_partition_floor"
        ],
        "title": "MaintainResponse"
      },
      "ManualActivityOut": {
        "properties": {
          "writes": {
            "type": "integer",
            "title": "Writes"
          },
          "rollbacks": {
            "type": "integer",
            "title": "Rollbacks"
          },
          "distinct_actors": {
            "type": "integer",
            "title": "Distinct Actors"
          }
        },
        "type": "object",
        "required": [
          "writes",
          "rollbacks",
          "distinct_actors"
        ],
        "title": "ManualActivityOut",
        "description": "What humans did in the same window. Reported, deliberately not graded \u2014\na provider kept correct by constant hand-correction is its own kind of\ncertification concern, and there is no defensible universal bar for it."
      },
      "MemberContext": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "name",
          "email",
          "role",
          "member_rpm_limit",
          "member_rpd_limit",
          "member_tpm_limit",
          "member_spend_cap"
        ],
        "title": "MemberContext"
      },
      "MemberCustomRole": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "scope": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "scope"
        ],
        "title": "MemberCustomRole",
        "description": "A custom role a member holds, as the member LIST reports it.\n\nDeliberately narrower than ``OrgRoleResponse``: the list renders badges, and\ncarrying every role's full permission set would multiply the payload by the\nmember count for data no row displays. The role surface serves the details."
      },
      "MemberResponse": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          },
          "default_rpm_limit": {
            "type": "integer",
            "title": "Default Rpm Limit"
          },
          "default_rpd_limit": {
            "type": "integer",
            "title": "Default Rpd Limit"
          },
          "default_tpm_limit": {
            "type": "integer",
            "title": "Default Tpm Limit"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "custom_roles": {
            "items": {
              "$ref": "#/components/schemas/MemberCustomRole"
            },
            "type": "array",
            "title": "Custom Roles",
            "default": []
          },
          "team_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Role"
          },
          "team_member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Member Rpm Limit"
          },
          "team_member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Member Rpd Limit"
          },
          "team_member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Member Tpm Limit"
          },
          "team_member_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Member Spend Cap"
          },
          "access_via_org_admin": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Via Org Admin"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "role",
          "member_rpm_limit",
          "member_rpd_limit",
          "member_tpm_limit",
          "member_spend_cap",
          "default_rpm_limit",
          "default_rpd_limit",
          "default_tpm_limit",
          "created_at"
        ],
        "title": "MemberResponse"
      },
      "MemberRolesResponse": {
        "properties": {
          "roles": {
            "items": {
              "$ref": "#/components/schemas/OrgRoleResponse"
            },
            "type": "array",
            "title": "Roles"
          }
        },
        "type": "object",
        "required": [
          "roles"
        ],
        "title": "MemberRolesResponse"
      },
      "MemoryCountsResponse": {
        "properties": {
          "memories": {
            "type": "integer",
            "title": "Memories",
            "default": 0
          },
          "items": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Items",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          },
          "expired_items": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Expired Items",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          },
          "memories_with": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Memories With",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          }
        },
        "type": "object",
        "title": "MemoryCountsResponse",
        "description": "Org-wide totals behind the dashboard's type rail (MESH-467).\n\nThree different things get counted, because the rail and its subtitle answer\nthree different questions and conflating them is how a nav badge starts\nlying:\n\n  * ``items``          \u2014 rows of each type the caller can see.\n  * ``expired_items``  \u2014 of those, how many are past ``expires_at``. Still\n                         inside ``items``: retention lapses on read, so the\n                         row is here to be seen and revived until the\n                         sweeper hard-deletes it. Guardrails are always 0 \u2014\n                         they never carry a deadline.\n  * ``memories_with``  \u2014 how many MEMORIES hold at least one item of the\n                         type, i.e. the length of the list the rail's own\n                         view will render.\n\n``memories`` is the total the \"All memories\" row shows. It counts memories,\nnot items, which is why it is a separate field rather than a fourth key in\n``items``."
      },
      "MemoryDetail": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "owner_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Email"
          },
          "can_inject": {
            "type": "boolean",
            "title": "Can Inject",
            "default": true
          },
          "item_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Item Counts",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          },
          "expired_item_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Expired Item Counts",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          },
          "retention_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retention Days"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/MemoryItemSummary"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "org_id",
          "team_id",
          "slug",
          "name",
          "description",
          "is_active",
          "created_at",
          "updated_at",
          "items"
        ],
        "title": "MemoryDetail"
      },
      "MemoryItemSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "memory_id": {
            "type": "string",
            "title": "Memory Id"
          },
          "item_type": {
            "type": "string",
            "title": "Item Type"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "position": {
            "type": "integer",
            "title": "Position"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "memory_id",
          "item_type",
          "key",
          "content",
          "position",
          "created_at",
          "updated_at"
        ],
        "title": "MemoryItemSummary"
      },
      "MemorySummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "owner_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Email"
          },
          "can_inject": {
            "type": "boolean",
            "title": "Can Inject",
            "default": true
          },
          "item_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Item Counts",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          },
          "expired_item_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Expired Item Counts",
            "default": {
              "preference": 0,
              "guardrail": 0,
              "fact": 0
            }
          },
          "retention_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retention Days"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "org_id",
          "team_id",
          "slug",
          "name",
          "description",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "MemorySummary"
      },
      "MemoryUsageKeyRow": {
        "properties": {
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "injected_tokens_est": {
            "type": "integer",
            "title": "Injected Tokens Est"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "requests",
          "injected_tokens_est"
        ],
        "title": "MemoryUsageKeyRow"
      },
      "MemoryUsageResponse": {
        "properties": {
          "window_days": {
            "type": "integer",
            "title": "Window Days"
          },
          "tracked_since": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tracked Since"
          },
          "memories": {
            "items": {
              "$ref": "#/components/schemas/MemoryUsageRow"
            },
            "type": "array",
            "title": "Memories",
            "default": []
          },
          "embed_requests": {
            "type": "integer",
            "title": "Embed Requests",
            "default": 0
          },
          "embed_cost_usd": {
            "type": "string",
            "title": "Embed Cost Usd",
            "default": "0"
          }
        },
        "type": "object",
        "required": [
          "window_days"
        ],
        "title": "MemoryUsageResponse"
      },
      "MemoryUsageRow": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "requests": {
            "type": "integer",
            "title": "Requests",
            "default": 0
          },
          "injected_tokens_est": {
            "type": "integer",
            "title": "Injected Tokens Est",
            "default": 0
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "per_key": {
            "items": {
              "$ref": "#/components/schemas/MemoryUsageKeyRow"
            },
            "type": "array",
            "title": "Per Key",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "slug"
        ],
        "title": "MemoryUsageRow",
        "description": "Usage for one memID, as used by the caller's own API keys.\n\n``injected_tokens_est`` is doubly an estimate. It is OUR tokenizer's count of\nthe block we prepended \u2014 no provider reports the split between that block and\nthe rest of the prompt \u2014 AND, when a request attached several memIDs, this\nmemory's equal share of that one block rather than its measured contribution.\nWhich is why there is deliberately no dollar figure beside it: calling an\nestimate a charge on a billing-adjacent surface is how numbers get quoted\nback at you in a support ticket."
      },
      "Message": {
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "tool"
            ],
            "title": "Role"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/ContentPart"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "tool_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Call Id"
          },
          "tool_calls": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ToolCall"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Calls"
          },
          "reasoning_details": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Details"
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "Message"
      },
      "MetadataIn": {
        "properties": {
          "provider_slug": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Provider Slug"
          },
          "source": {
            "type": "string",
            "enum": [
              "openrouter",
              "admin"
            ],
            "title": "Source"
          },
          "source_surfaces": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "maxItems": 8
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Surfaces",
            "description": "Which of the source's surfaces contributed, e.g. ['api', 'page']. Lets a NULL meaning 'the rich surface never listed this provider' be told apart from a NULL the rich surface published as a real omission. Free-form on purpose: a new source brings its own surface names."
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "mesh_provider": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Mesh Provider"
          },
          "captured_at": {
            "type": "string",
            "format": "date-time",
            "title": "Captured At"
          },
          "trains_on_prompts": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trains On Prompts"
          },
          "retains_prompts": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retains Prompts"
          },
          "data_retention_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 36500.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Retention Days"
          },
          "byok_supported": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Byok Supported"
          },
          "moderation_required": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Moderation Required"
          },
          "requires_user_ids": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requires User Ids"
          },
          "sends_client_ip": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sends Client Ip"
          },
          "headquarters": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Headquarters"
          },
          "datacenter_countries": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "maxItems": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Datacenter Countries"
          },
          "serving_regions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "maxItems": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Serving Regions"
          },
          "privacy_policy_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Privacy Policy Url"
          },
          "terms_of_service_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Terms Of Service Url"
          },
          "status_page_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Page Url"
          },
          "model_count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Count"
          },
          "free_model_count": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Free Model Count"
          },
          "daily_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Daily Tokens"
          },
          "monthly_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly Tokens"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider_slug",
          "source",
          "captured_at"
        ],
        "title": "MetadataIn",
        "description": "One registry row as an admin asserts it.\n\nEvery fact field defaults to None = UNKNOWN. Omitting a field records that\nwe do not know it; it never records a \"no\"."
      },
      "MetadataListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MetadataOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "MetadataListOut"
      },
      "MetadataOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider_slug": {
            "type": "string",
            "title": "Provider Slug"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_surfaces": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Surfaces"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "mesh_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mesh Provider"
          },
          "captured_at": {
            "type": "string",
            "format": "date-time",
            "title": "Captured At"
          },
          "trains_on_prompts": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trains On Prompts"
          },
          "retains_prompts": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retains Prompts"
          },
          "data_retention_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Retention Days"
          },
          "byok_supported": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Byok Supported"
          },
          "moderation_required": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Moderation Required"
          },
          "requires_user_ids": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requires User Ids"
          },
          "sends_client_ip": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sends Client Ip"
          },
          "headquarters": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Headquarters"
          },
          "datacenter_countries": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Datacenter Countries"
          },
          "serving_regions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serving Regions"
          },
          "privacy_policy_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Privacy Policy Url"
          },
          "terms_of_service_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Terms Of Service Url"
          },
          "status_page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Page Url"
          },
          "model_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Count"
          },
          "free_model_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Free Model Count"
          },
          "daily_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Daily Tokens"
          },
          "monthly_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Monthly Tokens"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider_slug",
          "source",
          "source_surfaces",
          "source_url",
          "display_name",
          "mesh_provider",
          "captured_at",
          "trains_on_prompts",
          "retains_prompts",
          "data_retention_days",
          "byok_supported",
          "moderation_required",
          "requires_user_ids",
          "sends_client_ip",
          "headquarters",
          "datacenter_countries",
          "serving_regions",
          "privacy_policy_url",
          "terms_of_service_url",
          "status_page_url",
          "model_count",
          "free_model_count",
          "daily_tokens",
          "monthly_tokens",
          "notes",
          "created_at",
          "updated_at"
        ],
        "title": "MetadataOut"
      },
      "MetadataUpdateRequest": {
        "properties": {
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "metadata"
        ],
        "title": "MetadataUpdateRequest"
      },
      "MirrorSweepResponse": {
        "properties": {
          "claimed": {
            "type": "integer",
            "title": "Claimed"
          },
          "mirrored": {
            "type": "integer",
            "title": "Mirrored"
          }
        },
        "type": "object",
        "required": [
          "claimed",
          "mirrored"
        ],
        "title": "MirrorSweepResponse"
      },
      "Modality": {
        "type": "string",
        "enum": [
          "text",
          "image",
          "audio",
          "video",
          "embedding"
        ],
        "title": "Modality"
      },
      "ModelAliasIn": {
        "properties": {
          "alias": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Alias",
            "description": "Caller-sent name to map."
          },
          "model_id": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Model Id",
            "description": "Canonical target model id."
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          }
        },
        "type": "object",
        "required": [
          "alias",
          "model_id"
        ],
        "title": "ModelAliasIn"
      },
      "ModelAliasOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "alias": {
            "type": "string",
            "title": "Alias"
          },
          "display_alias": {
            "type": "string",
            "title": "Display Alias"
          },
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "alias",
          "display_alias",
          "model_id",
          "notes",
          "created_by",
          "created_at"
        ],
        "title": "ModelAliasOut"
      },
      "ModelBreakdown": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests",
            "default": 0
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "platform_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Fee Usd"
          }
        },
        "type": "object",
        "required": [
          "model",
          "requests",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost_usd"
        ],
        "title": "ModelBreakdown"
      },
      "ModelCompareResult": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Model ID this result is for."
          },
          "response_body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Body",
            "description": "Full upstream chat-completion response (raw provider body, including `choices` and `usage`). Null when the call failed."
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content",
            "description": "Assistant message text extracted from `response_body`. Null on error."
          },
          "latency_ms": {
            "type": "integer",
            "title": "Latency Ms",
            "description": "Wall-clock latency for this model's call, in milliseconds."
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Human-readable error message when the call failed, else null."
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code",
            "description": "Machine-readable error code when the call failed, else null."
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TokenUsage"
              },
              {
                "type": "null"
              }
            ],
            "description": "Token usage for this model's call."
          },
          "request_id": {
            "type": "string",
            "title": "Request Id",
            "description": "Per-model sub-request ID (`<request_id>::<model>`)."
          }
        },
        "type": "object",
        "required": [
          "model",
          "latency_ms",
          "request_id"
        ],
        "title": "ModelCompareResult",
        "description": "Outcome of a single fan-out model call."
      },
      "ModelDeprecation": {
        "properties": {
          "deprecated_on": {
            "type": "string",
            "format": "date",
            "title": "Deprecated On",
            "description": "Date the deprecation was announced."
          },
          "sunset_on": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "format": "date",
            "title": "Sunset On",
            "description": "Date the model stops being served; null = not yet announced."
          },
          "replacement_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replacement Model Id",
            "description": "The model to migrate to, when one is recommended."
          }
        },
        "type": "object",
        "required": [
          "deprecated_on"
        ],
        "title": "ModelDeprecation",
        "description": "A customer-facing retirement notice for the whole model.\n\nNot ``pricing.deprecated_date``, which marks one soft-deleted price row."
      },
      "ModelFiltersOut": {
        "properties": {
          "brands": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Brands"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers"
          }
        },
        "type": "object",
        "required": [
          "brands",
          "providers"
        ],
        "title": "ModelFiltersOut",
        "description": "Distinct filter values for the admin models table dropdowns."
      },
      "ModelIn": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "brand": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "default": true
          },
          "model_type": {
            "type": "string",
            "enum": [
              "text",
              "embedding",
              "image",
              "audio",
              "video",
              "tts",
              "stt"
            ],
            "title": "Model Type",
            "default": "text"
          },
          "input_modalities": {
            "items": {
              "$ref": "#/components/schemas/Modality"
            },
            "type": "array",
            "title": "Input Modalities",
            "default": [
              "text"
            ]
          },
          "output_modalities": {
            "items": {
              "$ref": "#/components/schemas/Modality"
            },
            "type": "array",
            "title": "Output Modalities",
            "default": [
              "text"
            ]
          },
          "composite_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompositeModelConfig"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "name"
        ],
        "title": "ModelIn"
      },
      "ModelOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "brand": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "is_free": {
            "type": "boolean",
            "title": "Is Free"
          },
          "pricing": {
            "$ref": "#/components/schemas/ModelPricing"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking"
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api"
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api"
          },
          "supports_realtime": {
            "type": "boolean",
            "title": "Supports Realtime",
            "default": false
          },
          "supports_embeddings": {
            "type": "boolean",
            "title": "Supports Embeddings",
            "default": false
          },
          "supports_tools": {
            "type": "boolean",
            "title": "Supports Tools",
            "default": false
          },
          "supports_structured_output": {
            "type": "boolean",
            "title": "Supports Structured Output",
            "default": false
          },
          "supports_system_prompt": {
            "type": "boolean",
            "title": "Supports System Prompt",
            "default": true
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching",
            "default": false
          },
          "supports_flex": {
            "type": "boolean",
            "title": "Supports Flex",
            "default": false
          },
          "supports_background_response": {
            "type": "boolean",
            "title": "Supports Background Response",
            "default": false
          },
          "supports_video_generation": {
            "type": "boolean",
            "title": "Supports Video Generation",
            "default": false
          },
          "supports_image_edit": {
            "type": "boolean",
            "title": "Supports Image Edit",
            "default": false
          },
          "supports_image_inpaint": {
            "type": "boolean",
            "title": "Supports Image Inpaint",
            "default": false
          },
          "supports_image_outpaint": {
            "type": "boolean",
            "title": "Supports Image Outpaint",
            "default": false
          },
          "supports_image_mix": {
            "type": "boolean",
            "title": "Supports Image Mix",
            "default": false
          },
          "supports_image_reframe": {
            "type": "boolean",
            "title": "Supports Image Reframe",
            "default": false
          },
          "supports_image_upscale": {
            "type": "boolean",
            "title": "Supports Image Upscale",
            "default": false
          },
          "supports_image_remove_background": {
            "type": "boolean",
            "title": "Supports Image Remove Background",
            "default": false
          },
          "supports_image_reference": {
            "type": "boolean",
            "title": "Supports Image Reference",
            "default": false
          },
          "supports_video_first_frame": {
            "type": "boolean",
            "title": "Supports Video First Frame",
            "default": false
          },
          "supports_video_last_frame": {
            "type": "boolean",
            "title": "Supports Video Last Frame",
            "default": false
          },
          "supports_video_reference_image": {
            "type": "boolean",
            "title": "Supports Video Reference Image",
            "default": false
          },
          "supports_video_reference_video": {
            "type": "boolean",
            "title": "Supports Video Reference Video",
            "default": false
          },
          "supports_video_reference_audio": {
            "type": "boolean",
            "title": "Supports Video Reference Audio",
            "default": false
          },
          "supports_video_negative_prompt": {
            "type": "boolean",
            "title": "Supports Video Negative Prompt",
            "default": false
          },
          "max_prompt_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Prompt Chars"
          },
          "supports_generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Generate Audio"
          },
          "image_operations": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Image Operations",
            "default": []
          },
          "model_type": {
            "type": "string",
            "title": "Model Type"
          },
          "input_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Input Modalities"
          },
          "output_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Output Modalities"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "standard_context_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standard Context Threshold"
          },
          "realtime_session_max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Session Max Tokens"
          },
          "realtime_max_concurrent_per_owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Max Concurrent Per Owner"
          },
          "is_composite": {
            "type": "boolean",
            "title": "Is Composite",
            "default": false
          },
          "composite_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Composite Models"
          },
          "deprecation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelDeprecation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the model is deprecated. It stays usable until `sunset_on`. Unrelated to `pricing.deprecated_date`."
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "context_length",
          "is_free",
          "pricing",
          "supports_thinking",
          "supports_completions_api",
          "supports_responses_api",
          "model_type",
          "input_modalities",
          "output_modalities"
        ],
        "title": "ModelOut"
      },
      "ModelOverride": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "system_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System Prompt"
          }
        },
        "type": "object",
        "required": [
          "model"
        ],
        "title": "ModelOverride",
        "description": "Per-model parameter overrides applied on top of the request-level defaults."
      },
      "ModelOverrideOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "model_key": {
            "type": "string",
            "title": "Model Key"
          },
          "model_key_kind": {
            "type": "string",
            "title": "Model Key Kind"
          },
          "upstream_model_id": {
            "type": "string",
            "title": "Upstream Model Id"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "is_orphaned": {
            "type": "boolean",
            "title": "Is Orphaned"
          }
        },
        "type": "object",
        "required": [
          "id",
          "model_key",
          "model_key_kind",
          "upstream_model_id",
          "is_active",
          "label",
          "notes",
          "created_at",
          "is_orphaned"
        ],
        "title": "ModelOverrideOut"
      },
      "ModelPriceIn": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "default": "openrouter"
          },
          "provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Model Id"
          },
          "routing_weight": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Weight"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "prompt_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Usd Per 1M"
          },
          "completion_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Usd Per 1M"
          },
          "is_free": {
            "type": "boolean",
            "title": "Is Free",
            "default": false
          },
          "discount_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Pct"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking",
            "default": false
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api",
            "default": true
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api",
            "default": false
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching",
            "default": false
          },
          "supports_flex": {
            "type": "boolean",
            "title": "Supports Flex",
            "default": false
          },
          "supports_video_generation": {
            "type": "boolean",
            "title": "Supports Video Generation",
            "default": false
          },
          "supports_image_edit": {
            "type": "boolean",
            "title": "Supports Image Edit",
            "default": false
          },
          "supports_image_inpaint": {
            "type": "boolean",
            "title": "Supports Image Inpaint",
            "default": false
          },
          "supports_image_outpaint": {
            "type": "boolean",
            "title": "Supports Image Outpaint",
            "default": false
          },
          "supports_image_mix": {
            "type": "boolean",
            "title": "Supports Image Mix",
            "default": false
          },
          "supports_image_reframe": {
            "type": "boolean",
            "title": "Supports Image Reframe",
            "default": false
          },
          "supports_image_upscale": {
            "type": "boolean",
            "title": "Supports Image Upscale",
            "default": false
          },
          "supports_image_remove_background": {
            "type": "boolean",
            "title": "Supports Image Remove Background",
            "default": false
          },
          "supports_image_reference": {
            "type": "boolean",
            "title": "Supports Image Reference",
            "default": false
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "tool_pricing": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/ToolPrice"
                },
                "propertyNames": {
                  "$ref": "#/components/schemas/HostedToolKind"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Pricing"
          }
        },
        "type": "object",
        "required": [
          "model_id"
        ],
        "title": "ModelPriceIn"
      },
      "ModelPriceOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "routing_weight": {
            "type": "integer",
            "title": "Routing Weight",
            "default": 0
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "prompt_usd_per_1m": {
            "type": "string",
            "title": "Prompt Usd Per 1M"
          },
          "completion_usd_per_1m": {
            "type": "string",
            "title": "Completion Usd Per 1M"
          },
          "is_free": {
            "type": "boolean",
            "title": "Is Free"
          },
          "upstream_prompt_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Prompt Usd Per 1M"
          },
          "upstream_completion_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Completion Usd Per 1M"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking"
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api"
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api"
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching"
          },
          "supports_flex": {
            "type": "boolean",
            "title": "Supports Flex",
            "default": false
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "pricing_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Unit"
          },
          "image_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Input Cost"
          },
          "image_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost"
          },
          "audio_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Input Cost"
          },
          "audio_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Output Cost"
          },
          "request_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Cost"
          },
          "provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Model Id"
          },
          "input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Cost"
          },
          "output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Cost"
          },
          "modality": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Modality"
          },
          "input_modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Modalities"
          },
          "output_modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Modalities"
          },
          "supports_tools": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Tools"
          },
          "supports_structured_output": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Structured Output"
          },
          "supports_system_prompt": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports System Prompt"
          },
          "supports_embeddings": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Embeddings"
          },
          "supports_background_response": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Background Response"
          },
          "supports_video_generation": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Generation"
          },
          "supports_video_first_frame": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video First Frame"
          },
          "supports_video_last_frame": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Last Frame"
          },
          "supports_video_reference_image": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Reference Image"
          },
          "supports_video_reference_video": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Reference Video"
          },
          "supports_video_reference_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Reference Audio"
          },
          "supports_video_negative_prompt": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Negative Prompt"
          },
          "max_prompt_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Prompt Chars"
          },
          "supports_generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Generate Audio"
          },
          "supports_image_edit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Edit"
          },
          "supports_image_inpaint": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Inpaint"
          },
          "supports_image_outpaint": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Outpaint"
          },
          "supports_image_mix": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Mix"
          },
          "supports_image_reframe": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Reframe"
          },
          "supports_image_upscale": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Upscale"
          },
          "supports_image_remove_background": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Remove Background"
          },
          "supports_image_reference": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Reference"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "standard_context_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standard Context Threshold"
          },
          "long_context_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Input Cost"
          },
          "long_context_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Output Cost"
          },
          "cache_read_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Input Cost"
          },
          "cache_read_audio_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Audio Input Cost"
          },
          "cache_write_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write Input Cost"
          },
          "cache_write_1h_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write 1H Input Cost"
          },
          "long_context_cache_read_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Read Input Cost"
          },
          "long_context_cache_write_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Write Input Cost"
          },
          "cache_hit_price_per_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Hit Price Per Token"
          },
          "batch_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Input Cost"
          },
          "batch_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Output Cost"
          },
          "flex_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Input Cost"
          },
          "flex_cache_read_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Cache Read Input Cost"
          },
          "flex_cache_write_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Cache Write Input Cost"
          },
          "flex_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Output Cost"
          },
          "flex_long_context_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Input Cost"
          },
          "flex_long_context_cache_read_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Cache Read Input Cost"
          },
          "flex_long_context_cache_write_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Cache Write Input Cost"
          },
          "flex_long_context_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Output Cost"
          },
          "flex_upstream_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Upstream Input Cost"
          },
          "flex_upstream_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Upstream Output Cost"
          },
          "training_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Training Cost"
          },
          "fine_tuned_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Input Cost"
          },
          "fine_tuned_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Output Cost"
          },
          "image_output_size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Size"
          },
          "transcription_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcription Cost"
          },
          "output_with_audio_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output With Audio Cost"
          },
          "output_with_video_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output With Video Cost"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "deprecated_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated Date"
          },
          "responses_provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responses Provider Model Id"
          },
          "supports_realtime": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Realtime"
          },
          "realtime_session_max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Session Max Tokens"
          },
          "realtime_max_concurrent_per_owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Max Concurrent Per Owner"
          },
          "audio_input_price_per_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Input Price Per Token"
          },
          "audio_output_price_per_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Output Price Per Token"
          },
          "cached_audio_input_price_per_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Audio Input Price Per Token"
          },
          "cached_text_input_price_per_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Text Input Price Per Token"
          },
          "reasoning_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Output Cost"
          },
          "image_output_cost_512": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 512"
          },
          "image_output_cost_1k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 1K"
          },
          "image_output_cost_2k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 2K"
          },
          "image_output_cost_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 4K"
          },
          "video_output_cost_360p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 360P"
          },
          "video_output_cost_480p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 480P"
          },
          "video_output_cost_540p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 540P"
          },
          "video_output_cost_720p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 720P"
          },
          "video_output_cost_768p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 768P"
          },
          "video_output_cost_1080p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 1080P"
          },
          "video_output_cost_1440p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 1440P"
          },
          "video_output_cost_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 4K"
          },
          "video_output_with_video_cost_360p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 360P"
          },
          "video_output_with_video_cost_480p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 480P"
          },
          "video_output_with_video_cost_540p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 540P"
          },
          "video_output_with_video_cost_720p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 720P"
          },
          "video_output_with_video_cost_768p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 768P"
          },
          "video_output_with_video_cost_1080p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 1080P"
          },
          "video_output_with_video_cost_1440p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 1440P"
          },
          "video_output_with_video_cost_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 4K"
          },
          "video_output_with_audio_cost_360p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 360P"
          },
          "video_output_with_audio_cost_480p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 480P"
          },
          "video_output_with_audio_cost_540p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 540P"
          },
          "video_output_with_audio_cost_720p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 720P"
          },
          "video_output_with_audio_cost_768p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 768P"
          },
          "video_output_with_audio_cost_1080p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 1080P"
          },
          "video_output_with_audio_cost_1440p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 1440P"
          },
          "video_output_with_audio_cost_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 4K"
          },
          "price_matrix": {
            "title": "Price Matrix"
          },
          "tool_pricing": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Pricing"
          },
          "tool_pricing_valid": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Pricing Valid"
          },
          "key_discounts": {
            "items": {
              "$ref": "#/components/schemas/KeyDiscountOut"
            },
            "type": "array",
            "title": "Key Discounts",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "is_default",
          "is_active",
          "priority",
          "prompt_usd_per_1m",
          "completion_usd_per_1m",
          "is_free",
          "upstream_prompt_usd_per_1m",
          "upstream_completion_usd_per_1m",
          "supports_thinking",
          "supports_completions_api",
          "supports_responses_api",
          "supports_batching",
          "updated_at"
        ],
        "title": "ModelPriceOut"
      },
      "ModelPriceProposalApplyIn": {
        "properties": {
          "approvals": {
            "items": {
              "$ref": "#/components/schemas/ModelPriceProposalKey"
            },
            "type": "array",
            "title": "Approvals"
          }
        },
        "type": "object",
        "required": [
          "approvals"
        ],
        "title": "ModelPriceProposalApplyIn"
      },
      "ModelPriceProposalKey": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider"
        ],
        "title": "ModelPriceProposalKey"
      },
      "ModelPriceUpdateIn": {
        "properties": {
          "prompt_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Usd Per 1M"
          },
          "completion_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Usd Per 1M"
          },
          "is_free": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Free"
          },
          "is_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Default"
          },
          "routing_weight": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Weight"
          },
          "provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Model Id"
          },
          "supports_thinking": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Thinking"
          },
          "supports_completions_api": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Completions Api"
          },
          "supports_responses_api": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Responses Api"
          },
          "supports_batching": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Batching"
          },
          "supports_flex": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Flex"
          },
          "supports_video_generation": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Video Generation"
          },
          "supports_image_edit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Edit"
          },
          "supports_image_inpaint": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Inpaint"
          },
          "supports_image_outpaint": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Outpaint"
          },
          "supports_image_mix": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Mix"
          },
          "supports_image_reframe": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Reframe"
          },
          "supports_image_upscale": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Upscale"
          },
          "supports_image_remove_background": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Remove Background"
          },
          "supports_image_reference": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Image Reference"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "platform_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Key Id"
          },
          "tool_pricing": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/ToolPrice"
                },
                "propertyNames": {
                  "$ref": "#/components/schemas/HostedToolKind"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Pricing"
          }
        },
        "type": "object",
        "title": "ModelPriceUpdateIn"
      },
      "ModelPricing": {
        "properties": {
          "pricing_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Unit"
          },
          "prompt_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Usd Per 1M"
          },
          "completion_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Usd Per 1M"
          },
          "input_usd_per_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Usd Per Unit"
          },
          "output_usd_per_unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Usd Per Unit"
          },
          "image_output_usd_per_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Usd Per Image"
          },
          "request_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Usd"
          },
          "long_context_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Input Usd Per 1M"
          },
          "long_context_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Output Usd Per 1M"
          },
          "cache_read_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Input Usd Per 1M"
          },
          "cache_write_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write Input Usd Per 1M"
          },
          "cache_write_1h_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write 1H Input Usd Per 1M"
          },
          "cache_read_audio_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Audio Input Usd Per 1M"
          },
          "long_context_cache_read_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Read Input Usd Per 1M"
          },
          "long_context_cache_write_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Write Input Usd Per 1M"
          },
          "batch_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Input Usd Per 1M"
          },
          "batch_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Output Usd Per 1M"
          },
          "flex_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Input Usd Per 1M"
          },
          "flex_cache_read_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Cache Read Input Usd Per 1M"
          },
          "flex_cache_write_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Cache Write Input Usd Per 1M"
          },
          "flex_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Output Usd Per 1M"
          },
          "flex_long_context_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Input Usd Per 1M"
          },
          "flex_long_context_cache_read_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Cache Read Input Usd Per 1M"
          },
          "flex_long_context_cache_write_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Cache Write Input Usd Per 1M"
          },
          "flex_long_context_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flex Long Context Output Usd Per 1M"
          },
          "training_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Training Usd Per 1M"
          },
          "fine_tuned_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Input Usd Per 1M"
          },
          "fine_tuned_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Output Usd Per 1M"
          },
          "audio_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Input Usd Per 1M"
          },
          "audio_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Output Usd Per 1M"
          },
          "transcription_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcription Usd Per 1M"
          },
          "cached_audio_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Audio Input Usd Per 1M"
          },
          "cached_text_input_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Text Input Usd Per 1M"
          },
          "cache_hit_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Hit Usd Per 1M"
          },
          "output_with_audio_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output With Audio Usd Per 1M"
          },
          "output_with_video_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output With Video Usd Per 1M"
          },
          "image_input_usd_per_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Input Usd Per Image"
          },
          "image_output_size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Size"
          },
          "image_output_usd_per_image_512": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Usd Per Image 512"
          },
          "image_output_usd_per_image_1k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Usd Per Image 1K"
          },
          "image_output_usd_per_image_2k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Usd Per Image 2K"
          },
          "image_output_usd_per_image_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Usd Per Image 4K"
          },
          "video_output_usd_per_unit_360p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 360P"
          },
          "video_output_usd_per_unit_480p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 480P"
          },
          "video_output_usd_per_unit_540p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 540P"
          },
          "video_output_usd_per_unit_720p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 720P"
          },
          "video_output_usd_per_unit_768p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 768P"
          },
          "video_output_usd_per_unit_1080p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 1080P"
          },
          "video_output_usd_per_unit_1440p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 1440P"
          },
          "video_output_usd_per_unit_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Usd Per Unit 4K"
          },
          "video_output_with_video_usd_per_unit_360p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 360P"
          },
          "video_output_with_video_usd_per_unit_480p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 480P"
          },
          "video_output_with_video_usd_per_unit_540p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 540P"
          },
          "video_output_with_video_usd_per_unit_720p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 720P"
          },
          "video_output_with_video_usd_per_unit_768p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 768P"
          },
          "video_output_with_video_usd_per_unit_1080p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 1080P"
          },
          "video_output_with_video_usd_per_unit_1440p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 1440P"
          },
          "video_output_with_video_usd_per_unit_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Usd Per Unit 4K"
          },
          "video_output_with_audio_usd_per_unit_360p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 360P"
          },
          "video_output_with_audio_usd_per_unit_480p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 480P"
          },
          "video_output_with_audio_usd_per_unit_540p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 540P"
          },
          "video_output_with_audio_usd_per_unit_720p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 720P"
          },
          "video_output_with_audio_usd_per_unit_768p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 768P"
          },
          "video_output_with_audio_usd_per_unit_1080p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 1080P"
          },
          "video_output_with_audio_usd_per_unit_1440p": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 1440P"
          },
          "video_output_with_audio_usd_per_unit_4k": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Usd Per Unit 4K"
          },
          "reasoning_output_usd_per_1m": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Output Usd Per 1M"
          },
          "price_matrix": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Matrix"
          },
          "tool_pricing": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Pricing"
          },
          "effective_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective Date"
          },
          "deprecated_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated Date"
          },
          "discount_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Pct",
            "description": "The largest discount active for this caller on this model, as a percentage. Where a discount is tied to one of several upstream accounts, which account serves is chosen by routing, so a given request may be billed less of a discount than this \u2014 or none."
          },
          "discounted": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelPricing"
              },
              {
                "type": "null"
              }
            ],
            "description": "The rates above with `discount_pct` applied \u2014 the best price this caller may be billed, not a guaranteed one (see `discount_pct`). Absent when no discount is active. A request served on the caller's own BYOK provider key is billed without the gateway discount, so these are the platform-served rates, and a provider-scoped discount is resolved against the model's default provider. `tool_pricing` is omitted because hosted-tool fees are charged after the discount."
          }
        },
        "type": "object",
        "title": "ModelPricing"
      },
      "ModelProviderOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "icon_url_dark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url Dark"
          },
          "is_free": {
            "type": "boolean",
            "title": "Is Free"
          },
          "pricing": {
            "$ref": "#/components/schemas/ModelPricing"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "standard_context_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standard Context Threshold"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking",
            "default": false
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api",
            "default": true
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api",
            "default": false
          },
          "supports_embeddings": {
            "type": "boolean",
            "title": "Supports Embeddings",
            "default": false
          },
          "supports_tools": {
            "type": "boolean",
            "title": "Supports Tools",
            "default": false
          },
          "supports_structured_output": {
            "type": "boolean",
            "title": "Supports Structured Output",
            "default": false
          },
          "supports_system_prompt": {
            "type": "boolean",
            "title": "Supports System Prompt",
            "default": true
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching",
            "default": false
          },
          "supports_flex": {
            "type": "boolean",
            "title": "Supports Flex",
            "default": false
          },
          "supports_background_response": {
            "type": "boolean",
            "title": "Supports Background Response",
            "default": false
          },
          "supports_video_generation": {
            "type": "boolean",
            "title": "Supports Video Generation",
            "default": false
          },
          "supports_video_first_frame": {
            "type": "boolean",
            "title": "Supports Video First Frame",
            "default": false
          },
          "supports_video_last_frame": {
            "type": "boolean",
            "title": "Supports Video Last Frame",
            "default": false
          },
          "supports_video_reference_image": {
            "type": "boolean",
            "title": "Supports Video Reference Image",
            "default": false
          },
          "supports_video_reference_video": {
            "type": "boolean",
            "title": "Supports Video Reference Video",
            "default": false
          },
          "supports_video_reference_audio": {
            "type": "boolean",
            "title": "Supports Video Reference Audio",
            "default": false
          },
          "supports_video_negative_prompt": {
            "type": "boolean",
            "title": "Supports Video Negative Prompt",
            "default": false
          },
          "max_prompt_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Prompt Chars"
          },
          "supports_generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Generate Audio"
          },
          "supports_realtime": {
            "type": "boolean",
            "title": "Supports Realtime",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "provider",
          "is_free",
          "pricing"
        ],
        "title": "ModelProviderOut",
        "description": "One upstream provider that can serve a model, with that provider's price.\n\nA model usually has several ``model_pricing`` rows \u2014 one per provider that\ncan serve it \u2014 and the rates differ between them. ``GET /v1/models`` only\never publishes the DEFAULT row (the price a bare ``model`` string bills at),\nso this is the only place the alternatives are visible.\n\nDeliberately narrower than ``ModelOut``: it carries the customer-facing\nprice and capability flags of one row and nothing about how we reach the\nupstream \u2014 ``provider_model_id`` (our upstream model string), the platform\nkey pin, routing weights and the ``upstream_*`` costs (our margin) are all\nleft out."
      },
      "ModelRegistryOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "brand": {
            "type": "string",
            "title": "Brand"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled"
          },
          "model_type": {
            "type": "string",
            "title": "Model Type"
          },
          "input_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Input Modalities"
          },
          "output_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Output Modalities"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "prices": {
            "items": {
              "$ref": "#/components/schemas/ModelPriceOut"
            },
            "type": "array",
            "title": "Prices",
            "default": []
          },
          "max_discount_pct": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Discount Pct"
          },
          "user_discounts": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "User Discounts",
            "default": {}
          },
          "composite_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompositeModelConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "deprecated_on": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated On"
          },
          "sunset_on": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sunset On"
          },
          "replacement_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replacement Model Id"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "name",
          "brand",
          "context_length",
          "description",
          "is_enabled",
          "model_type",
          "input_modalities",
          "output_modalities",
          "created_at",
          "updated_at"
        ],
        "title": "ModelRegistryOut"
      },
      "ModelRequestOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "requester_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requester Name"
          },
          "model_name": {
            "type": "string",
            "title": "Model Name"
          },
          "use_case": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Case"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "org_id",
          "team_id",
          "email",
          "requester_name",
          "model_name",
          "use_case",
          "status",
          "created_at"
        ],
        "title": "ModelRequestOut"
      },
      "ModelResult": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "status"
        ],
        "title": "ModelResult"
      },
      "ModelStandingItem": {
        "properties": {
          "category": {
            "type": "string",
            "title": "Category"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "score": {
            "type": "number",
            "title": "Score"
          },
          "out_of": {
            "type": "integer",
            "title": "Out Of"
          }
        },
        "type": "object",
        "required": [
          "category",
          "label",
          "rank",
          "score",
          "out_of"
        ],
        "title": "ModelStandingItem"
      },
      "ModelStandingResponse": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "available_on_mesh": {
            "type": "boolean",
            "title": "Available On Mesh"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "attribution": {
            "type": "string",
            "title": "Attribution"
          },
          "rankings": {
            "items": {
              "$ref": "#/components/schemas/ModelStandingItem"
            },
            "type": "array",
            "title": "Rankings"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "name",
          "available_on_mesh",
          "source",
          "attribution",
          "rankings"
        ],
        "title": "ModelStandingResponse"
      },
      "ModelUpdateIn": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Enabled"
          },
          "model_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text",
                  "embedding",
                  "image",
                  "audio",
                  "video",
                  "tts",
                  "stt"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Type"
          },
          "input_modalities": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Modality"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Modalities"
          },
          "output_modalities": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/Modality"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Modalities"
          },
          "composite_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompositeModelConfig"
              },
              {
                "type": "null"
              }
            ]
          },
          "deprecated_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated On"
          },
          "sunset_on": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sunset On"
          },
          "replacement_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Replacement Model Id"
          }
        },
        "type": "object",
        "title": "ModelUpdateIn"
      },
      "ModelUsageRow": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "model",
          "requests",
          "successful_requests",
          "total_tokens",
          "total_cost_usd"
        ],
        "title": "ModelUsageRow"
      },
      "ModelsPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ModelOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "brands": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Brands"
          },
          "facets": {
            "additionalProperties": {
              "items": {
                "$ref": "#/components/schemas/FacetValue"
              },
              "type": "array"
            },
            "type": "object",
            "title": "Facets",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset",
          "brands"
        ],
        "title": "ModelsPage",
        "description": "Paginated envelope returned by ``GET /v1/models/search``."
      },
      "ModerationImageUrl": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Image URL or base64 data URL (data:image/{fmt};base64,{b64})."
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "ModerationImageUrl"
      },
      "ModerationInputItem": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image_url"
            ],
            "title": "Type"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "image_url": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModerationImageUrl"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "ModerationInputItem",
        "description": "A single multimodal moderation input object (OpenAI format)."
      },
      "ModerationRequest": {
        "properties": {
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/ModerationInputItem"
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text, list of texts, or list of multimodal (text/image_url) items."
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Moderation model to use. Defaults to omni-moderation-latest.",
            "default": "omni-moderation-latest"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "input"
        ],
        "title": "ModerationRequest",
        "description": "Request body for ``POST /v1/moderations`` (OpenAI-compatible).",
        "example": {
          "input": [
            {
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgo..."
              },
              "type": "image_url"
            }
          ],
          "model": "omni-moderation-latest"
        }
      },
      "MovingAveragePoint": {
        "properties": {
          "bucket_index": {
            "type": "integer",
            "title": "Bucket Index"
          },
          "bucket_start": {
            "type": "string",
            "title": "Bucket Start"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "ma_usd": {
            "type": "string",
            "title": "Ma Usd"
          }
        },
        "type": "object",
        "required": [
          "bucket_index",
          "bucket_start",
          "label",
          "ma_usd"
        ],
        "title": "MovingAveragePoint"
      },
      "MultimodalEmbeddingInput": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image_url",
              "video_url"
            ],
            "title": "Type"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "image_url": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImageEmbeddingUrl"
              },
              {
                "type": "null"
              }
            ]
          },
          "video_url": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoEmbeddingUrl"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "MultimodalEmbeddingInput",
        "description": "A single item in a BytePlus multimodal embeddings input list.\n\nBytePlus /embeddings/multimodal accepts a list of typed content objects\ninstead of plain strings. All items in one request are vectorized together\nas a single unit (e.g. one image + one text \u2192 one combined vector)."
      },
      "MyInvitationOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "invited_by": {
            "type": "string",
            "title": "Invited By"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "team_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Name"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "org_name",
          "role",
          "invited_by",
          "expires_at",
          "created_at"
        ],
        "title": "MyInvitationOut"
      },
      "MyOrgResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "role",
          "is_active"
        ],
        "title": "MyOrgResponse",
        "description": "One organisation the caller belongs to, as the org switcher needs it.\n\n`role` is that membership row's role, never the token's `org_metadata.role`:\nthe claim names ONE org, so copying it would report the caller as owner of\nevery org in the list."
      },
      "ObservationPoint": {
        "properties": {
          "observed_at": {
            "type": "string",
            "format": "date-time",
            "title": "Observed At"
          },
          "value": {
            "type": "string",
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Value"
          },
          "unit": {
            "type": "string",
            "title": "Unit"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "verified": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified"
          }
        },
        "type": "object",
        "required": [
          "observed_at",
          "value",
          "unit",
          "source",
          "source_detail",
          "verified"
        ],
        "title": "ObservationPoint"
      },
      "OnboardingStatusOut": {
        "properties": {
          "onboarded": {
            "type": "boolean",
            "title": "Onboarded"
          }
        },
        "type": "object",
        "required": [
          "onboarded"
        ],
        "title": "OnboardingStatusOut"
      },
      "OpenBalanceLiability": {
        "properties": {
          "open_usd": {
            "type": "string",
            "title": "Open Usd"
          },
          "open_accounts": {
            "type": "integer",
            "title": "Open Accounts"
          },
          "overdrawn_usd": {
            "type": "string",
            "title": "Overdrawn Usd"
          },
          "overdrawn_accounts": {
            "type": "integer",
            "title": "Overdrawn Accounts"
          },
          "net_usd": {
            "type": "string",
            "title": "Net Usd"
          },
          "as_of": {
            "type": "string",
            "title": "As Of"
          }
        },
        "type": "object",
        "required": [
          "open_usd",
          "open_accounts",
          "overdrawn_usd",
          "overdrawn_accounts",
          "net_usd",
          "as_of"
        ],
        "title": "OpenBalanceLiability",
        "description": "Unspent credit across the whole book \u2014 the liability side (MESH-733).\n\n``open_usd`` and ``overdrawn_usd`` are reported SEPARATELY rather than as\none signed sum, because they are not the same quantity and netting them\nunderstates both. Balances may go slightly negative (a request that settles\nabove its estimate), and a negative balance is a receivable, not a liability\n\u2014 we do not owe that customer service, they owe us. A single ``SUM`` would\nquietly subtract those receivables from what we owe and report a smaller\nobligation than exists. ``net_usd`` is still given for anyone who wants the\nraw figure, but it is not the headline."
      },
      "OrgContext": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "org_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpm Limit"
          },
          "org_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpd Limit"
          },
          "org_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Tpm Limit"
          },
          "org_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Spend Cap"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_name",
          "org_rpm_limit",
          "org_rpd_limit",
          "org_tpm_limit",
          "org_spend_cap"
        ],
        "title": "OrgContext"
      },
      "OrgPermission": {
        "type": "string",
        "enum": [
          "keys:read",
          "keys:write",
          "members:read",
          "members:write",
          "billing:read",
          "billing:pay",
          "usage:read",
          "provider_keys:read",
          "provider_keys:write",
          "limits:read",
          "limits:write",
          "alerts:read",
          "alerts:write",
          "org:read",
          "org:write",
          "teams:read",
          "teams:write"
        ],
        "title": "OrgPermission",
        "description": "What a member of an organisation may do.\n\nThe enum VALUES are the wire format \u2014 they appear in 403 messages and in the\ndashboard's gating. Renaming one is a breaking change for the dashboard;\nadding one is not."
      },
      "OrgResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "org_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpm Limit"
          },
          "org_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpd Limit"
          },
          "org_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Tpm Limit"
          },
          "org_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Spend Cap"
          },
          "default_rpm_limit": {
            "type": "integer",
            "title": "Default Rpm Limit"
          },
          "default_rpd_limit": {
            "type": "integer",
            "title": "Default Rpd Limit"
          },
          "default_tpm_limit": {
            "type": "integer",
            "title": "Default Tpm Limit"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "requires_token_refresh": {
            "type": "boolean",
            "title": "Requires Token Refresh",
            "default": false
          },
          "default_api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Api Version"
          },
          "default_pii_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Pii Policy"
          },
          "default_body_log_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Body Log Policy"
          },
          "default_body_log_policy_enforced": {
            "type": "boolean",
            "title": "Default Body Log Policy Enforced",
            "default": false
          },
          "default_pii_policy_enforced": {
            "type": "boolean",
            "title": "Default Pii Policy Enforced",
            "default": false
          },
          "zero_data_retention": {
            "type": "boolean",
            "title": "Zero Data Retention",
            "default": false
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "org_rpm_limit",
          "org_rpd_limit",
          "org_tpm_limit",
          "org_spend_cap",
          "default_rpm_limit",
          "default_rpd_limit",
          "default_tpm_limit",
          "created_at"
        ],
        "title": "OrgResponse"
      },
      "OrgRoleResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "scope": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "scope",
          "permissions",
          "created_at",
          "updated_at"
        ],
        "title": "OrgRoleResponse",
        "description": "One custom role, in the shape the role CRUD surface returns it.\n\nDeclared here rather than imported from the roles router: that module is a\nsibling slice, and a cross-router import for a response model would couple\nthe two surfaces in the wrong direction."
      },
      "OwnerUsageRow": {
        "properties": {
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "is_internal": {
            "type": "boolean",
            "title": "Is Internal",
            "default": false
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "owner",
          "requests",
          "successful_requests",
          "total_tokens",
          "total_cost_usd"
        ],
        "title": "OwnerUsageRow"
      },
      "PageCreate": {
        "properties": {
          "provider": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Provider"
          },
          "url_template": {
            "type": "string",
            "maxLength": 2048,
            "minLength": 8,
            "title": "Url Template"
          },
          "region": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "accept_language": {
            "type": "string",
            "maxLength": 32,
            "title": "Accept Language",
            "default": "en-US"
          },
          "source_type": {
            "type": "string",
            "enum": [
              "webpage",
              "api"
            ],
            "title": "Source Type",
            "default": "webpage"
          },
          "priority": {
            "type": "integer",
            "maximum": 32767.0,
            "minimum": 0.0,
            "title": "Priority",
            "default": 100
          },
          "origin": {
            "type": "string",
            "enum": [
              "admin",
              "agent_proposed"
            ],
            "title": "Origin",
            "default": "admin"
          },
          "is_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Default",
            "description": "Omit to let the server decide: the row becomes default only when the provider has no active source of any kind yet. A newly created row never silently displaces an existing default \u2014 pass true/false to override explicitly."
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider",
          "url_template"
        ],
        "title": "PageCreate"
      },
      "PageOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "url_template": {
            "type": "string",
            "title": "Url Template"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "accept_language": {
            "type": "string",
            "title": "Accept Language"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "priority": {
            "type": "integer",
            "title": "Priority"
          },
          "origin": {
            "type": "string",
            "title": "Origin"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider",
          "url_template",
          "region",
          "notes",
          "active",
          "accept_language",
          "source_type",
          "is_default",
          "priority",
          "origin",
          "created_at",
          "updated_at"
        ],
        "title": "PageOut"
      },
      "PageProposalListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PageProposalOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "PageProposalListOut"
      },
      "PageProposalOut": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "evidence_id": {
            "type": "string",
            "format": "uuid",
            "title": "Evidence Id"
          },
          "uploaded_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uploaded By"
          },
          "first_seen": {
            "type": "string",
            "format": "date-time",
            "title": "First Seen"
          },
          "times_cited": {
            "type": "integer",
            "title": "Times Cited"
          }
        },
        "type": "object",
        "required": [
          "url",
          "provider",
          "model_id",
          "evidence_id",
          "uploaded_by",
          "first_seen",
          "times_cited"
        ],
        "title": "PageProposalOut"
      },
      "PageUpdate": {
        "properties": {
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "accept_language": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Accept Language"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 32767.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "is_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Default"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PageUpdate",
        "description": "provider/url_template/region/source_type are IMMUTABLE: verdicts already\nattached to this page recorded its URL and its kind, and repointing the row\nwould silently re-attribute them. Delete and recreate instead."
      },
      "PathConfigIn": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "weight": {
            "type": "integer",
            "title": "Weight"
          },
          "algorithms": {
            "items": {
              "$ref": "#/components/schemas/AlgorithmConfigIn"
            },
            "type": "array",
            "title": "Algorithms"
          }
        },
        "type": "object",
        "required": [
          "name",
          "weight",
          "algorithms"
        ],
        "title": "PathConfigIn"
      },
      "PathStats": {
        "properties": {
          "path_name": {
            "type": "string",
            "title": "Path Name"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "avg_routing_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Routing Ms"
          },
          "avg_response_latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Response Latency Ms"
          },
          "fallback_count": {
            "type": "integer",
            "title": "Fallback Count"
          },
          "error_count": {
            "type": "integer",
            "title": "Error Count"
          }
        },
        "type": "object",
        "required": [
          "path_name",
          "total_requests",
          "avg_routing_ms",
          "avg_response_latency_ms",
          "fallback_count",
          "error_count"
        ],
        "title": "PathStats"
      },
      "PaymentEventOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "payment_id": {
            "type": "string",
            "title": "Payment Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order Id"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "original_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Amount"
          },
          "original_amount_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Amount Display"
          },
          "amount_usd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Usd"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "credited_amount_raw": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credited Amount Raw"
          },
          "credited_amount_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credited Amount Display"
          },
          "coupon_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Code"
          },
          "coupon_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Name"
          },
          "discount_amount_raw": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount Raw"
          },
          "discount_amount_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount Display"
          },
          "discount_amount_usd_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount Usd Display"
          },
          "fx_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fx Rate"
          },
          "payer_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Name"
          },
          "payer_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payer Email"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "payment_id",
          "provider",
          "order_id",
          "currency",
          "amount",
          "amount_usd",
          "status",
          "created_at"
        ],
        "title": "PaymentEventOut"
      },
      "PaymentOut": {
        "properties": {
          "received": {
            "type": "boolean",
            "title": "Received"
          },
          "coupon": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon"
          }
        },
        "type": "object",
        "required": [
          "received"
        ],
        "title": "PaymentOut"
      },
      "PaymentReconcileResult": {
        "properties": {
          "window_start": {
            "type": "string",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "title": "Window End"
          },
          "payments_checked": {
            "type": "integer",
            "title": "Payments Checked"
          },
          "missing_credit_rows": {
            "type": "integer",
            "title": "Missing Credit Rows"
          },
          "amount_mismatch_rows": {
            "type": "integer",
            "title": "Amount Mismatch Rows"
          },
          "total_at_risk_usd": {
            "type": "string",
            "title": "Total At Risk Usd"
          },
          "issues_found": {
            "type": "integer",
            "title": "Issues Found"
          }
        },
        "type": "object",
        "required": [
          "window_start",
          "window_end",
          "payments_checked",
          "missing_credit_rows",
          "amount_mismatch_rows",
          "total_at_risk_usd",
          "issues_found"
        ],
        "title": "PaymentReconcileResult"
      },
      "PaymentRequest": {
        "properties": {
          "userId": {
            "type": "string",
            "title": "Userid"
          },
          "paymentId": {
            "type": "string",
            "title": "Paymentid"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "orderId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Orderid"
          },
          "couponCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Couponcode"
          },
          "couponDiscountAmount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupondiscountamount"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount"
          },
          "ipAddress": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ipaddress"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "gstAmount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstamount"
          }
        },
        "type": "object",
        "required": [
          "userId",
          "paymentId",
          "provider"
        ],
        "title": "PaymentRequest"
      },
      "PaymentSummary": {
        "properties": {
          "revenue": {
            "type": "string",
            "title": "Revenue"
          },
          "coupon_discounts": {
            "type": "string",
            "title": "Coupon Discounts",
            "default": "0.0000"
          },
          "free_credit_usd": {
            "type": "string",
            "title": "Free Credit Usd",
            "default": "0.0000"
          },
          "platform_fee_usd": {
            "type": "string",
            "title": "Platform Fee Usd",
            "default": "0.0000"
          },
          "transactions": {
            "type": "integer",
            "title": "Transactions",
            "default": 0
          },
          "avg_transaction_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Transaction Usd"
          },
          "cached_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached At"
          }
        },
        "type": "object",
        "required": [
          "revenue"
        ],
        "title": "PaymentSummary",
        "description": "Revenue metrics for a single date window (all figures scoped to the\nrequested ``start_date``/``end_date``; all-time when neither is set)."
      },
      "PaymentTopUserRow": {
        "properties": {
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "payments": {
            "type": "integer",
            "title": "Payments"
          },
          "total_paid_usd": {
            "type": "string",
            "title": "Total Paid Usd"
          }
        },
        "type": "object",
        "required": [
          "owner",
          "payments",
          "total_paid_usd"
        ],
        "title": "PaymentTopUserRow",
        "description": "A top-paying user.\n\nDeliberately NOT ``OwnerUsageRow``, which this endpoint used to borrow. That\nis a *usage* shape: its ``requests`` carried a payment count and its\n``total_cost_usd`` carried money paid, so anyone tracing a figure on the\ndashboard back to its source of truth landed on usage cost instead of\npayments. The values were right; the names were not (MESH-583).\n\n``successful_requests`` and ``total_tokens`` are gone rather than renamed \u2014\nthe former was ``count(id)`` a second time (\"all payments are successful\")\nand the latter was always None."
      },
      "PaymentTransactionOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "payment_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payment Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order Id"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "amount_raw": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Raw"
          },
          "amount_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Display"
          },
          "original_amount_raw": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Amount Raw"
          },
          "original_amount_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Amount Display"
          },
          "amount_usd_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Usd Display"
          },
          "coupon_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Code"
          },
          "discount_amount_raw": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount Raw"
          },
          "discount_amount_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount Display"
          },
          "discount_amount_usd_display": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discount Amount Usd Display"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "provider",
          "order_id",
          "currency",
          "amount_raw",
          "amount_display",
          "amount_usd_display",
          "status",
          "created_at"
        ],
        "title": "PaymentTransactionOut"
      },
      "PaymentTransactionsPage": {
        "properties": {
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/PaymentTransactionOut"
            },
            "type": "array",
            "title": "Transactions"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "transactions",
          "total",
          "limit",
          "offset"
        ],
        "title": "PaymentTransactionsPage"
      },
      "PendingImporterPaymentOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "payment_id": {
            "type": "string",
            "title": "Payment Id"
          },
          "order_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order Id"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "payment_id",
          "order_id",
          "created_at"
        ],
        "title": "PendingImporterPaymentOut"
      },
      "PendingModelOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/ProviderRowOut"
            },
            "type": "array",
            "title": "Rows"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "rows"
        ],
        "title": "PendingModelOut"
      },
      "PendingOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PendingModelOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total_models": {
            "type": "integer",
            "title": "Total Models"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total_models"
        ],
        "title": "PendingOut"
      },
      "PermissionCatalogueResponse": {
        "properties": {
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "org_roles": {
            "additionalProperties": {
              "$ref": "#/components/schemas/RoleGrant"
            },
            "type": "object",
            "title": "Org Roles"
          },
          "team_roles": {
            "additionalProperties": {
              "$ref": "#/components/schemas/RoleGrant"
            },
            "type": "object",
            "title": "Team Roles"
          },
          "team_scoped_roles": {
            "additionalProperties": {
              "$ref": "#/components/schemas/RoleGrant"
            },
            "type": "object",
            "title": "Team Scoped Roles"
          }
        },
        "type": "object",
        "required": [
          "permissions",
          "org_roles",
          "team_roles",
          "team_scoped_roles"
        ],
        "title": "PermissionCatalogueResponse",
        "description": "The permission vocabulary and the built-in role matrix.\n\n`team_roles` and `team_scoped_roles` are different questions about the same\nrole name, so both are published \u2014 see the handler."
      },
      "PermissionsResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "org_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Role"
          },
          "scope": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "teams": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TeamPermissions"
            },
            "type": "object",
            "title": "Teams"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_role",
          "scope",
          "permissions",
          "teams"
        ],
        "title": "PermissionsResponse",
        "description": "The caller's effective authority in the acting org.\n\nThe `teams` map is the half a client cannot derive: it holds role NAMES from\nthe token, and the expansion lives only in `org_permissions.py` so the two\ncopies cannot drift."
      },
      "PiiPolicy": {
        "properties": {
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "default": false
          },
          "mode": {
            "type": "string",
            "const": "mask",
            "title": "Mode",
            "default": "mask"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Categories"
          },
          "on_error": {
            "type": "string",
            "enum": [
              "block",
              "allow"
            ],
            "title": "On Error",
            "default": "block"
          },
          "mask_format": {
            "type": "string",
            "maxLength": 64,
            "title": "Mask Format",
            "default": "[{category}]"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "PiiPolicy",
        "description": "Validated form of a `pii_policy` JSONB blob."
      },
      "PinIn": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "pinned": {
            "type": "boolean",
            "title": "Pinned"
          },
          "reason": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 3,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "pinned",
          "reason"
        ],
        "title": "PinIn",
        "description": "Set (`pinned=true`) or clear (`pinned=false`) a row's sticky-revoke pin.\n\n`reason` is REQUIRED \u2014 a pin flip changes what the engine may ever write to\na live price row, so the audit trail must say why. Same validator style as\nAmendIn: whitespace-only is rejected, not just empty."
      },
      "PinOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "pinned": {
            "type": "boolean",
            "title": "Pinned"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "changed": {
            "type": "boolean",
            "title": "Changed"
          },
          "cleared_holds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Cleared Holds",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "pinned",
          "status",
          "changed"
        ],
        "title": "PinOut"
      },
      "PinnableProviderOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "The slug to store as `fixed_provider`, e.g. `bedrock`."
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name",
            "description": "Human-readable name (`AWS Bedrock` for `bedrock`). Null for a provider our mapping does not know yet \u2014 render the raw slug then."
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url",
            "description": "Absolute logo URL, or null."
          },
          "icon_url_dark": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url Dark",
            "description": "Logo for dark backgrounds. Only set for marks that would be invisible otherwise; fall back to `icon_url`."
          },
          "model_count": {
            "type": "integer",
            "title": "Model Count",
            "description": "How many LISTED models this provider prices \u2014 the same set `GET /v1/models` shows you. A model hidden from the catalogue but still priced stays callable by id and is not counted here."
          }
        },
        "type": "object",
        "required": [
          "provider",
          "model_count"
        ],
        "title": "PinnableProviderOut",
        "description": "One provider an API key's `fixed_provider` may name."
      },
      "PlatformKeyProviderRoutingOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/PlatformKeyRoutingRowOut"
            },
            "type": "array",
            "title": "Keys"
          },
          "weighted_key_count": {
            "type": "integer",
            "title": "Weighted Key Count"
          },
          "single_weighted_override": {
            "type": "boolean",
            "title": "Single Weighted Override"
          },
          "picked_total": {
            "type": "integer",
            "title": "Picked Total",
            "default": 0
          },
          "served_total": {
            "type": "integer",
            "title": "Served Total",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "provider",
          "keys",
          "weighted_key_count",
          "single_weighted_override"
        ],
        "title": "PlatformKeyProviderRoutingOut"
      },
      "PlatformKeyRoutingRowOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_platform_default": {
            "type": "boolean",
            "title": "Is Platform Default"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "routing_weight": {
            "type": "integer",
            "title": "Routing Weight"
          },
          "configured_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Configured Pct"
          },
          "picked": {
            "type": "integer",
            "title": "Picked",
            "default": 0
          },
          "picked_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Picked Pct"
          },
          "served": {
            "type": "integer",
            "title": "Served",
            "default": 0
          },
          "served_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Served Pct"
          },
          "error_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Pct"
          },
          "dominant_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dominant Error Code"
          },
          "pinned_models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Pinned Models"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "is_platform_default",
          "is_active",
          "routing_weight"
        ],
        "title": "PlatformKeyRoutingRowOut",
        "description": "One platform key, its configured share, and what actually happened to it."
      },
      "PlatformKeyWeightsIn": {
        "properties": {
          "weights": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "minProperties": 1,
            "title": "Weights"
          }
        },
        "type": "object",
        "required": [
          "weights"
        ],
        "title": "PlatformKeyWeightsIn",
        "description": "Full weight map for one provider: platform key id \u2192 weight. Keys omitted are zeroed."
      },
      "PnlBreakdownRow": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "revenue_usd": {
            "type": "string",
            "title": "Revenue Usd"
          },
          "provider_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Cost Usd"
          },
          "margin_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Usd"
          },
          "margin_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Pct"
          }
        },
        "type": "object",
        "required": [
          "key",
          "requests",
          "revenue_usd",
          "provider_cost_usd",
          "margin_usd",
          "margin_pct"
        ],
        "title": "PnlBreakdownRow"
      },
      "PnlSummary": {
        "properties": {
          "revenue_usd": {
            "type": "string",
            "title": "Revenue Usd"
          },
          "openrouter_revenue_usd": {
            "type": "string",
            "title": "Openrouter Revenue Usd"
          },
          "provider_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Cost Usd"
          },
          "margin_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Usd"
          },
          "margin_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Pct"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          }
        },
        "type": "object",
        "required": [
          "revenue_usd",
          "openrouter_revenue_usd",
          "provider_cost_usd",
          "margin_usd",
          "margin_pct",
          "total_requests"
        ],
        "title": "PnlSummary"
      },
      "PnlTimePoint": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "revenue_usd": {
            "type": "string",
            "title": "Revenue Usd"
          },
          "provider_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Cost Usd"
          },
          "margin_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Usd"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "revenue_usd",
          "provider_cost_usd",
          "margin_usd"
        ],
        "title": "PnlTimePoint"
      },
      "PolicyCreate": {
        "properties": {
          "threshold_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Usd"
          },
          "threshold_pct": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Pct"
          },
          "channel_id": {
            "type": "string",
            "title": "Channel Id"
          },
          "alert_type": {
            "type": "string",
            "title": "Alert Type",
            "default": "low_balance"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "channel_id"
        ],
        "title": "PolicyCreate"
      },
      "PolicyResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "alert_type": {
            "type": "string",
            "title": "Alert Type"
          },
          "threshold_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Usd"
          },
          "threshold_pct": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Pct"
          },
          "channel_id": {
            "type": "string",
            "title": "Channel Id"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled"
          }
        },
        "type": "object",
        "required": [
          "id",
          "alert_type",
          "threshold_usd",
          "threshold_pct",
          "channel_id",
          "is_enabled"
        ],
        "title": "PolicyResponse"
      },
      "PolicyUpdate": {
        "properties": {
          "threshold_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Usd"
          },
          "threshold_pct": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Threshold Pct"
          },
          "channel_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel Id"
          },
          "is_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Enabled"
          }
        },
        "type": "object",
        "title": "PolicyUpdate"
      },
      "PollResult": {
        "properties": {
          "checked": {
            "type": "integer",
            "title": "Checked"
          },
          "synced": {
            "type": "integer",
            "title": "Synced"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          }
        },
        "type": "object",
        "required": [
          "checked",
          "synced",
          "errors"
        ],
        "title": "PollResult"
      },
      "PreDispatchRejections": {
        "properties": {
          "configured": {
            "type": "boolean",
            "title": "Configured",
            "default": false
          },
          "measured": {
            "type": "boolean",
            "title": "Measured",
            "default": false
          },
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Counts",
            "default": {}
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "true_success_rate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "True Success Rate"
          }
        },
        "type": "object",
        "title": "PreDispatchRejections",
        "description": "Requests refused before a usage_events row exists.\n\n``measured`` is tri-state on purpose. A Prometheus query error must NOT be\nrendered as zero \u2014 reporting \"0 rejections\" when we simply could not look\nwould recreate exactly the blindness this section exists to remove."
      },
      "PriceHistoryOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "field_name": {
            "type": "string",
            "title": "Field Name"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "raw_window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Raw Window Start"
          },
          "observations": {
            "items": {
              "$ref": "#/components/schemas/ObservationPoint"
            },
            "type": "array",
            "title": "Observations"
          },
          "daily": {
            "items": {
              "$ref": "#/components/schemas/DailyPoint"
            },
            "type": "array",
            "title": "Daily"
          },
          "applied_changes": {
            "items": {
              "$ref": "#/components/schemas/AppliedChange"
            },
            "type": "array",
            "title": "Applied Changes"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "field_name",
          "region",
          "raw_window_start",
          "observations",
          "daily",
          "applied_changes",
          "truncated"
        ],
        "title": "PriceHistoryOut"
      },
      "ProbeCallOut": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "provider_request_id": {
            "type": "string",
            "title": "Provider Request Id",
            "default": ""
          },
          "prompt_tokens": {
            "type": "integer",
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "type": "integer",
            "title": "Completion Tokens"
          },
          "cached_tokens": {
            "type": "integer",
            "title": "Cached Tokens"
          },
          "cache_write_tokens": {
            "type": "integer",
            "title": "Cache Write Tokens"
          },
          "reasoning_tokens": {
            "type": "integer",
            "title": "Reasoning Tokens"
          },
          "upstream_cost_usd": {
            "type": "string",
            "title": "Upstream Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "label",
          "request_id",
          "prompt_tokens",
          "completion_tokens",
          "cached_tokens",
          "cache_write_tokens",
          "reasoning_tokens",
          "upstream_cost_usd"
        ],
        "title": "ProbeCallOut",
        "description": "One metered call the probe fired \u2014 the provenance a reviewer needs to\nbelieve the number: our request id, the provider's own request id, the exact\ntoken breakdown, and what the provider charged for it."
      },
      "ProbeCandidateOut": {
        "properties": {
          "field_name": {
            "type": "string",
            "title": "Field Name"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_detail": {
            "type": "string",
            "title": "Source Detail"
          },
          "unit": {
            "type": "string",
            "title": "Unit"
          },
          "reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning"
          }
        },
        "type": "object",
        "required": [
          "field_name",
          "value",
          "source",
          "source_detail",
          "unit"
        ],
        "title": "ProbeCandidateOut"
      },
      "ProbeIn": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 6,
            "minItems": 1,
            "title": "Fields"
          },
          "reason": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 3,
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "fields",
          "reason"
        ],
        "title": "ProbeIn",
        "description": "MESH-489 R5b: reverify (model_id, provider) prices with a LIVE metered probe.\n\n`fields` is bounded (max 6) because each requested field can add a metered\ncall, and `reason` is REQUIRED for the same audit motive as PinIn \u2014 this\nendpoint spends real money on the platform's own credentials, so the log\nline must say who asked and why."
      },
      "ProbeOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "refused": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refused"
          },
          "applied": {
            "type": "boolean",
            "title": "Applied",
            "default": false
          },
          "shapes_run": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Shapes Run",
            "default": []
          },
          "measured": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Measured",
            "default": {}
          },
          "candidates": {
            "items": {
              "$ref": "#/components/schemas/ProbeCandidateOut"
            },
            "type": "array",
            "title": "Candidates",
            "default": []
          },
          "calls": {
            "items": {
              "$ref": "#/components/schemas/ProbeCallOut"
            },
            "type": "array",
            "title": "Calls",
            "default": []
          },
          "spend_usd": {
            "type": "string",
            "title": "Spend Usd",
            "default": "0"
          },
          "budget_charged_usd": {
            "type": "string",
            "title": "Budget Charged Usd",
            "default": "0"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "reason"
        ],
        "title": "ProbeOut"
      },
      "ProgressStepOut": {
        "properties": {
          "seq": {
            "type": "integer",
            "title": "Seq"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          }
        },
        "type": "object",
        "required": [
          "seq",
          "kind"
        ],
        "title": "ProgressStepOut"
      },
      "PronunciationDictionaryLocator": {
        "properties": {
          "pronunciation_dictionary_id": {
            "type": "string",
            "title": "Pronunciation Dictionary Id"
          },
          "version_id": {
            "type": "string",
            "title": "Version Id"
          }
        },
        "type": "object",
        "required": [
          "pronunciation_dictionary_id",
          "version_id"
        ],
        "title": "PronunciationDictionaryLocator"
      },
      "ProposalModelIn": {
        "properties": {
          "provider_model_id": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Provider Model Id"
          },
          "canonical_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Canonical Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "modality": {
            "type": "string",
            "enum": [
              "text",
              "embedding"
            ],
            "title": "Modality",
            "default": "text"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "upstream_prompt_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Prompt Usd Per 1M"
          },
          "upstream_completion_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Completion Usd Per 1M"
          },
          "upstream_cache_read_usd_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Cache Read Usd Per 1M"
          },
          "is_vision": {
            "type": "boolean",
            "title": "Is Vision",
            "default": false
          },
          "is_audio": {
            "type": "boolean",
            "title": "Is Audio",
            "default": false
          },
          "is_video": {
            "type": "boolean",
            "title": "Is Video",
            "default": false
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking",
            "default": false
          },
          "supports_structured_output": {
            "type": "boolean",
            "title": "Supports Structured Output",
            "default": false
          },
          "supports_tools": {
            "type": "boolean",
            "title": "Supports Tools",
            "default": false
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api",
            "default": true
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "provider_model_id"
        ],
        "title": "ProposalModelIn",
        "description": "One proposed entry, mirroring app/catalog/types.CatalogModel."
      },
      "ProposalOutcomeOut": {
        "properties": {
          "native_id": {
            "type": "string",
            "title": "Native Id"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "outcome": {
            "type": "string",
            "title": "Outcome"
          }
        },
        "type": "object",
        "required": [
          "native_id",
          "outcome"
        ],
        "title": "ProposalOutcomeOut"
      },
      "ProviderBreakdown": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "transaction_count": {
            "type": "integer",
            "title": "Transaction Count"
          },
          "total_amount_usd": {
            "type": "string",
            "title": "Total Amount Usd"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "transaction_count",
          "total_amount_usd"
        ],
        "title": "ProviderBreakdown"
      },
      "ProviderError": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "provider"
        ],
        "title": "ProviderError",
        "description": "The upstream provider's own words, when `message` is theirs.\n\nPresent exactly when the error message was forwarded from the provider;\nabsent when the gateway served its own sentence (the provider said nothing,\nor the failure is about the gateway's platform credentials). `status` is the\nprovider's HTTP status when one was recorded."
      },
      "ProviderKeyOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "secret_ref": {
            "type": "string",
            "title": "Secret Ref"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "allow_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallback"
          },
          "provider_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Config"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "creator_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator Name"
          },
          "creator_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator Email"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          },
          "secret_reachable": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Reachable"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "provider",
          "secret_ref",
          "label",
          "is_active",
          "created_at"
        ],
        "title": "ProviderKeyOut"
      },
      "ProviderKeyStatsItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "credential_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Type"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "allow_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallback"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "deleted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          },
          "total_fallbacks": {
            "type": "integer",
            "title": "Total Fallbacks"
          },
          "platform_fee_usd": {
            "type": "string",
            "title": "Platform Fee Usd"
          },
          "provider_cost_usd": {
            "type": "string",
            "title": "Provider Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "provider",
          "credential_type",
          "region",
          "project_id",
          "is_active",
          "allow_fallback",
          "created_at",
          "deleted_at",
          "total_requests",
          "successful_requests",
          "error_requests",
          "total_tokens",
          "total_fallbacks",
          "platform_fee_usd",
          "provider_cost_usd"
        ],
        "title": "ProviderKeyStatsItem"
      },
      "ProviderLimitIn": {
        "properties": {
          "provider": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Provider"
          },
          "provider_key_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Key Id"
          },
          "credential_label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Label"
          },
          "model": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          },
          "tpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpd Limit"
          },
          "max_concurrent_requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Concurrent Requests"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "reviewed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed At"
          },
          "reviewed_by": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed By"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "override_reviewed": {
            "type": "boolean",
            "title": "Override Reviewed",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "provider",
          "source"
        ],
        "title": "ProviderLimitIn",
        "description": "One declared ceiling. Every numeric field is optional, but at least one must\nbe set \u2014 a row with no limits carries no information.\n\nTypes are permissive on purpose (no ``gt=0`` constraints): validation runs\nper entry in ``validate_entry`` so one bad entry is rejected on its own\ninstead of 422-ing the whole batch."
      },
      "ProviderLimitOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "provider_key_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Key Id"
          },
          "credential_label": {
            "type": "string",
            "title": "Credential Label"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          },
          "tpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpd Limit"
          },
          "max_concurrent_requests": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Concurrent Requests"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "confidence": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Confidence"
          },
          "reviewed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed At"
          },
          "reviewed_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewed By"
          },
          "effective_from": {
            "type": "string",
            "format": "date-time",
            "title": "Effective From"
          },
          "effective_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective To"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "is_current": {
            "type": "boolean",
            "title": "Is Current"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider",
          "provider_key_id",
          "credential_label",
          "model",
          "rpm_limit",
          "tpm_limit",
          "rpd_limit",
          "tpd_limit",
          "max_concurrent_requests",
          "tier",
          "source",
          "source_url",
          "confidence",
          "reviewed_at",
          "reviewed_by",
          "effective_from",
          "effective_to",
          "notes",
          "is_current"
        ],
        "title": "ProviderLimitOut"
      },
      "ProviderLimitsListResult": {
        "properties": {
          "count": {
            "type": "integer",
            "title": "Count"
          },
          "include_expired": {
            "type": "boolean",
            "title": "Include Expired"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ProviderLimitOut"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "count",
          "include_expired",
          "items"
        ],
        "title": "ProviderLimitsListResult"
      },
      "ProviderLimitsUpsertRequest": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/ProviderLimitIn"
            },
            "type": "array",
            "maxItems": 500,
            "minItems": 1,
            "title": "Entries"
          },
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run",
            "default": false
          },
          "full_replace": {
            "type": "boolean",
            "title": "Full Replace",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "entries"
        ],
        "title": "ProviderLimitsUpsertRequest"
      },
      "ProviderLimitsUpsertResult": {
        "properties": {
          "dry_run": {
            "type": "boolean",
            "title": "Dry Run"
          },
          "full_replace": {
            "type": "boolean",
            "title": "Full Replace",
            "default": false
          },
          "inserted": {
            "type": "integer",
            "title": "Inserted"
          },
          "superseded": {
            "type": "integer",
            "title": "Superseded"
          },
          "unchanged": {
            "type": "integer",
            "title": "Unchanged"
          },
          "metadata_updated": {
            "type": "integer",
            "title": "Metadata Updated",
            "default": 0
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped",
            "default": 0
          },
          "rejected": {
            "type": "integer",
            "title": "Rejected"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/LimitUpsertOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          }
        },
        "type": "object",
        "required": [
          "dry_run",
          "inserted",
          "superseded",
          "unchanged",
          "rejected",
          "outcomes"
        ],
        "title": "ProviderLimitsUpsertResult"
      },
      "ProviderModelsOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Model Ids",
            "description": "The LISTED models this provider serves, sorted \u2014 the same set `GET /v1/models` shows you, so the two agree. A model requested outside what the provider serves is refused with 400 `model_not_available_on_pinned_provider` rather than rerouted."
          }
        },
        "type": "object",
        "required": [
          "provider",
          "model_ids"
        ],
        "title": "ProviderModelsOut",
        "description": "The models one provider serves."
      },
      "ProviderPerfRollupResult": {
        "properties": {
          "granularity": {
            "type": "string",
            "title": "Granularity"
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Window End"
          },
          "rows_written": {
            "type": "integer",
            "title": "Rows Written"
          },
          "buckets_covered": {
            "type": "integer",
            "title": "Buckets Covered"
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers"
          },
          "models_touched": {
            "type": "integer",
            "title": "Models Touched"
          },
          "gauge_series_set": {
            "type": "integer",
            "title": "Gauge Series Set"
          },
          "skipped_locked": {
            "type": "boolean",
            "title": "Skipped Locked",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "granularity",
          "window_start",
          "window_end",
          "rows_written",
          "buckets_covered",
          "providers",
          "models_touched",
          "gauge_series_set"
        ],
        "title": "ProviderPerfRollupResult"
      },
      "ProviderPreferences": {
        "properties": {
          "order": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Order",
            "description": "Preferred provider order, e.g. ['perplexity', 'openai']."
          },
          "allow_fallbacks": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallbacks",
            "description": "Whether to fall back to other providers if the first is unavailable."
          },
          "require_parameters": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Require Parameters",
            "description": "Only use providers that support all requested parameters."
          },
          "data_collection": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "allow",
                  "deny"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Data Collection",
            "description": "Control whether the provider may use the request for training."
          }
        },
        "type": "object",
        "title": "ProviderPreferences",
        "description": "Provider routing preferences."
      },
      "ProviderRowOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "pricing_unit": {
            "type": "string",
            "title": "Pricing Unit"
          },
          "sync_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sync Status"
          },
          "sync_pinned": {
            "type": "boolean",
            "title": "Sync Pinned"
          },
          "input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Cost"
          },
          "output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Cost"
          },
          "held_fields": {
            "items": {
              "$ref": "#/components/schemas/HeldFieldOut"
            },
            "type": "array",
            "title": "Held Fields"
          },
          "flagged_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flagged At"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "pricing_unit",
          "sync_status",
          "sync_pinned",
          "input_cost",
          "output_cost",
          "held_fields",
          "flagged_at",
          "run_id"
        ],
        "title": "ProviderRowOut"
      },
      "ProviderSourcesOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/SourceRowOut"
            },
            "type": "array",
            "title": "Rows"
          },
          "wired_sources": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Wired Sources"
          },
          "has_webpage": {
            "type": "boolean",
            "title": "Has Webpage"
          },
          "has_api": {
            "type": "boolean",
            "title": "Has Api"
          },
          "webpage_count": {
            "type": "integer",
            "title": "Webpage Count"
          },
          "api_count": {
            "type": "integer",
            "title": "Api Count"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "rows",
          "wired_sources",
          "has_webpage",
          "has_api",
          "webpage_count",
          "api_count"
        ],
        "title": "ProviderSourcesOut"
      },
      "ProviderUsageRow": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "requests",
          "successful_requests",
          "total_tokens",
          "total_cost_usd"
        ],
        "title": "ProviderUsageRow"
      },
      "PublicIncidentsResponse": {
        "properties": {
          "active": {
            "items": {
              "$ref": "#/components/schemas/IncidentOut"
            },
            "type": "array",
            "title": "Active"
          },
          "recent": {
            "items": {
              "$ref": "#/components/schemas/IncidentOut"
            },
            "type": "array",
            "title": "Recent"
          }
        },
        "type": "object",
        "required": [
          "active",
          "recent"
        ],
        "title": "PublicIncidentsResponse"
      },
      "PublicModelOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "brand": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "is_free": {
            "type": "boolean",
            "title": "Is Free"
          },
          "pricing": {
            "$ref": "#/components/schemas/ModelPricing"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking"
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api"
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api"
          },
          "supports_realtime": {
            "type": "boolean",
            "title": "Supports Realtime",
            "default": false
          },
          "supports_embeddings": {
            "type": "boolean",
            "title": "Supports Embeddings",
            "default": false
          },
          "supports_tools": {
            "type": "boolean",
            "title": "Supports Tools",
            "default": false
          },
          "supports_structured_output": {
            "type": "boolean",
            "title": "Supports Structured Output",
            "default": false
          },
          "supports_system_prompt": {
            "type": "boolean",
            "title": "Supports System Prompt",
            "default": true
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching",
            "default": false
          },
          "supports_flex": {
            "type": "boolean",
            "title": "Supports Flex",
            "default": false
          },
          "supports_background_response": {
            "type": "boolean",
            "title": "Supports Background Response",
            "default": false
          },
          "supports_video_generation": {
            "type": "boolean",
            "title": "Supports Video Generation",
            "default": false
          },
          "supports_image_edit": {
            "type": "boolean",
            "title": "Supports Image Edit",
            "default": false
          },
          "supports_image_inpaint": {
            "type": "boolean",
            "title": "Supports Image Inpaint",
            "default": false
          },
          "supports_image_outpaint": {
            "type": "boolean",
            "title": "Supports Image Outpaint",
            "default": false
          },
          "supports_image_mix": {
            "type": "boolean",
            "title": "Supports Image Mix",
            "default": false
          },
          "supports_image_reframe": {
            "type": "boolean",
            "title": "Supports Image Reframe",
            "default": false
          },
          "supports_image_upscale": {
            "type": "boolean",
            "title": "Supports Image Upscale",
            "default": false
          },
          "supports_image_remove_background": {
            "type": "boolean",
            "title": "Supports Image Remove Background",
            "default": false
          },
          "supports_image_reference": {
            "type": "boolean",
            "title": "Supports Image Reference",
            "default": false
          },
          "supports_video_first_frame": {
            "type": "boolean",
            "title": "Supports Video First Frame",
            "default": false
          },
          "supports_video_last_frame": {
            "type": "boolean",
            "title": "Supports Video Last Frame",
            "default": false
          },
          "supports_video_reference_image": {
            "type": "boolean",
            "title": "Supports Video Reference Image",
            "default": false
          },
          "supports_video_reference_video": {
            "type": "boolean",
            "title": "Supports Video Reference Video",
            "default": false
          },
          "supports_video_reference_audio": {
            "type": "boolean",
            "title": "Supports Video Reference Audio",
            "default": false
          },
          "supports_video_negative_prompt": {
            "type": "boolean",
            "title": "Supports Video Negative Prompt",
            "default": false
          },
          "max_prompt_chars": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Prompt Chars"
          },
          "supports_generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Generate Audio"
          },
          "image_operations": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Image Operations",
            "default": []
          },
          "model_type": {
            "type": "string",
            "title": "Model Type"
          },
          "input_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Input Modalities"
          },
          "output_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Output Modalities"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "standard_context_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standard Context Threshold"
          },
          "realtime_session_max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Session Max Tokens"
          },
          "realtime_max_concurrent_per_owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Max Concurrent Per Owner"
          },
          "is_composite": {
            "type": "boolean",
            "title": "Is Composite",
            "default": false
          },
          "composite_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Composite Models"
          },
          "deprecation": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ModelDeprecation"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the model is deprecated. It stays usable until `sunset_on`. Unrelated to `pricing.deprecated_date`."
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "context_length",
          "is_free",
          "pricing",
          "supports_thinking",
          "supports_completions_api",
          "supports_responses_api",
          "model_type",
          "input_modalities",
          "output_modalities"
        ],
        "title": "PublicModelOut",
        "description": "Public (unauthenticated) view of a model.\n\nCurrently identical to ``ModelOut``. ``provider`` (the internal routing slug)\nis already excluded on the base model, so the public marketing catalog never\nreveals upstream routing details; ``provider_model_id`` is likewise never part\nof ``ModelOut``. Kept as a distinct type so the public surface can diverge\nwithout touching the authenticated schema."
      },
      "RagDailyMetrics": {
        "properties": {
          "files_uploaded": {
            "type": "integer",
            "title": "Files Uploaded"
          },
          "files_ready": {
            "type": "integer",
            "title": "Files Ready"
          },
          "files_failed": {
            "type": "integer",
            "title": "Files Failed"
          },
          "embeddings_completed": {
            "type": "integer",
            "title": "Embeddings Completed"
          },
          "embeddings_failed": {
            "type": "integer",
            "title": "Embeddings Failed"
          },
          "embeddings_pending": {
            "type": "integer",
            "title": "Embeddings Pending"
          },
          "embed_tokens": {
            "type": "integer",
            "title": "Embed Tokens"
          },
          "embed_cost_usd": {
            "type": "number",
            "title": "Embed Cost Usd"
          },
          "search_queries": {
            "type": "integer",
            "title": "Search Queries"
          },
          "search_errors": {
            "type": "integer",
            "title": "Search Errors"
          },
          "rag_error_code_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Rag Error Code Counts"
          }
        },
        "type": "object",
        "required": [
          "files_uploaded",
          "files_ready",
          "files_failed",
          "embeddings_completed",
          "embeddings_failed",
          "embeddings_pending",
          "embed_tokens",
          "embed_cost_usd",
          "search_queries",
          "search_errors",
          "rag_error_code_counts"
        ],
        "title": "RagDailyMetrics"
      },
      "RagStats": {
        "properties": {
          "total_files": {
            "type": "integer",
            "title": "Total Files"
          },
          "total_size_bytes": {
            "type": "integer",
            "title": "Total Size Bytes"
          },
          "total_users": {
            "type": "integer",
            "title": "Total Users"
          },
          "status_breakdown": {
            "$ref": "#/components/schemas/RagStatusBreakdown"
          },
          "files_ready": {
            "type": "integer",
            "title": "Files Ready"
          },
          "files_embedded": {
            "type": "integer",
            "title": "Files Embedded"
          }
        },
        "type": "object",
        "required": [
          "total_files",
          "total_size_bytes",
          "total_users",
          "status_breakdown",
          "files_ready",
          "files_embedded"
        ],
        "title": "RagStats"
      },
      "RagStatusBreakdown": {
        "properties": {
          "upload_pending": {
            "type": "integer",
            "title": "Upload Pending"
          },
          "upload_ready": {
            "type": "integer",
            "title": "Upload Ready"
          },
          "upload_failed": {
            "type": "integer",
            "title": "Upload Failed"
          },
          "embed_pending": {
            "type": "integer",
            "title": "Embed Pending"
          },
          "embed_queued": {
            "type": "integer",
            "title": "Embed Queued"
          },
          "embed_processing": {
            "type": "integer",
            "title": "Embed Processing"
          },
          "embed_ready": {
            "type": "integer",
            "title": "Embed Ready"
          },
          "embed_failed": {
            "type": "integer",
            "title": "Embed Failed"
          }
        },
        "type": "object",
        "required": [
          "upload_pending",
          "upload_ready",
          "upload_failed",
          "embed_pending",
          "embed_queued",
          "embed_processing",
          "embed_ready",
          "embed_failed"
        ],
        "title": "RagStatusBreakdown"
      },
      "RaiseRequestBody": {
        "properties": {
          "thread_id": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Thread Id"
          },
          "summary": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Summary"
          },
          "source": {
            "type": "string",
            "enum": [
              "assistant_button",
              "assistant_tool"
            ],
            "title": "Source"
          },
          "transcript": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcript"
          },
          "page_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Url"
          }
        },
        "type": "object",
        "required": [
          "thread_id",
          "summary",
          "source"
        ],
        "title": "RaiseRequestBody"
      },
      "RaiseRequestResponse": {
        "properties": {
          "reference": {
            "type": "string",
            "title": "Reference"
          },
          "thread_id": {
            "type": "string",
            "title": "Thread Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "reference",
          "thread_id",
          "status"
        ],
        "title": "RaiseRequestResponse"
      },
      "RankedModel": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "creator": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator"
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "intelligence_index": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intelligence Index"
          },
          "benchmarks": {
            "additionalProperties": {
              "type": "number"
            },
            "type": "object",
            "title": "Benchmarks"
          },
          "price_1m_input": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price 1M Input"
          },
          "price_1m_output": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price 1M Output"
          },
          "median_output_tps": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Median Output Tps"
          },
          "median_ttft_s": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Median Ttft S"
          },
          "available_on_mesh": {
            "type": "boolean",
            "title": "Available On Mesh"
          },
          "release_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Release Date"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "model_id",
          "name",
          "creator",
          "score",
          "intelligence_index",
          "benchmarks",
          "price_1m_input",
          "price_1m_output",
          "median_output_tps",
          "median_ttft_s",
          "available_on_mesh",
          "release_date"
        ],
        "title": "RankedModel"
      },
      "RankingPage": {
        "properties": {
          "category": {
            "type": "string",
            "title": "Category"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "metric": {
            "type": "string",
            "title": "Metric"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "attribution": {
            "type": "string",
            "title": "Attribution"
          },
          "as_of": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "As Of"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "returned": {
            "type": "integer",
            "title": "Returned"
          },
          "models": {
            "items": {
              "$ref": "#/components/schemas/RankedModel"
            },
            "type": "array",
            "title": "Models"
          }
        },
        "type": "object",
        "required": [
          "category",
          "label",
          "metric",
          "source",
          "attribution",
          "as_of",
          "total",
          "returned",
          "models"
        ],
        "title": "RankingPage"
      },
      "RankingsSyncResponse": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "attribution": {
            "type": "string",
            "title": "Attribution"
          },
          "total_stored": {
            "type": "integer",
            "title": "Total Stored"
          },
          "total_matched": {
            "type": "integer",
            "title": "Total Matched"
          },
          "modalities": {
            "additionalProperties": true,
            "type": "object",
            "title": "Modalities"
          }
        },
        "type": "object",
        "required": [
          "source",
          "attribution",
          "total_stored",
          "total_matched",
          "modalities"
        ],
        "title": "RankingsSyncResponse"
      },
      "RateMetric": {
        "properties": {
          "current": {
            "type": "integer",
            "title": "Current"
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit"
          },
          "is_default_limit": {
            "type": "boolean",
            "title": "Is Default Limit"
          },
          "pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pct"
          },
          "resets_in_seconds": {
            "type": "integer",
            "title": "Resets In Seconds"
          }
        },
        "type": "object",
        "required": [
          "current",
          "limit",
          "is_default_limit",
          "pct",
          "resets_in_seconds"
        ],
        "title": "RateMetric",
        "description": "Current usage for one rate-limit dimension."
      },
      "ReasoningConfig": {
        "properties": {
          "effort": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "max",
                  "xhigh",
                  "high",
                  "medium",
                  "low",
                  "minimal",
                  "none"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Effort"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 128000.0,
                "minimum": 1024.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "exclude": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "context": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "all_turns",
                  "current_turn"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          },
          "mode": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "standard",
                  "pro"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Mode"
          }
        },
        "type": "object",
        "title": "ReasoningConfig",
        "description": "Structured ``reasoning`` object (supersedes ``reasoning_effort``).\n\n``effort`` and ``max_tokens`` are mutually exclusive: effort is the\nOpenAI/Grok dial, max_tokens the Anthropic/Gemini/Qwen thinking budget.\n``exclude`` reasons internally but omits the content from the response.\n``enabled: true`` alone means \"reason at defaults\"; ``false`` disables.\n``context``/``mode`` are gpt-5.x-only passthroughs."
      },
      "RechargeMetrics": {
        "properties": {
          "money_recharges": {
            "type": "integer",
            "title": "Money Recharges"
          },
          "money_recharge_users": {
            "type": "integer",
            "title": "Money Recharge Users"
          },
          "money_recharges_with_coupon": {
            "type": "integer",
            "title": "Money Recharges With Coupon"
          },
          "cash_by_currency": {
            "items": {
              "$ref": "#/components/schemas/CashByCurrency"
            },
            "type": "array",
            "title": "Cash By Currency"
          },
          "wallet_credit_usd": {
            "type": "number",
            "title": "Wallet Credit Usd"
          },
          "coupon_discount_usd": {
            "type": "number",
            "title": "Coupon Discount Usd"
          },
          "net_cash_revenue_usd": {
            "type": "number",
            "title": "Net Cash Revenue Usd"
          },
          "grant_recharges": {
            "type": "integer",
            "title": "Grant Recharges"
          },
          "grant_users": {
            "type": "integer",
            "title": "Grant Users"
          },
          "grant_credited_usd": {
            "type": "number",
            "title": "Grant Credited Usd"
          }
        },
        "type": "object",
        "required": [
          "money_recharges",
          "money_recharge_users",
          "money_recharges_with_coupon",
          "cash_by_currency",
          "wallet_credit_usd",
          "coupon_discount_usd",
          "net_cash_revenue_usd",
          "grant_recharges",
          "grant_users",
          "grant_credited_usd"
        ],
        "title": "RechargeMetrics"
      },
      "ReconciliationFindingOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "check_type": {
            "type": "string",
            "title": "Check Type"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "subject_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Type"
          },
          "subject_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject Ref"
          },
          "expected_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Usd"
          },
          "actual_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actual Usd"
          },
          "magnitude_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Magnitude Usd"
          },
          "detail": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "run_id",
          "check_type",
          "provider",
          "model",
          "subject_type",
          "subject_ref",
          "expected_usd",
          "actual_usd",
          "magnitude_usd",
          "detail",
          "created_at"
        ],
        "title": "ReconciliationFindingOut"
      },
      "ReconciliationFindingsPage": {
        "properties": {
          "findings": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationFindingOut"
            },
            "type": "array",
            "title": "Findings"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "findings",
          "total",
          "limit",
          "offset"
        ],
        "title": "ReconciliationFindingsPage"
      },
      "ReconciliationOut": {
        "properties": {
          "compared": {
            "type": "integer",
            "title": "Compared"
          },
          "agreed": {
            "type": "integer",
            "title": "Agreed"
          },
          "disagreed": {
            "type": "integer",
            "title": "Disagreed"
          },
          "agreement_pct": {
            "type": "number",
            "title": "Agreement Pct"
          }
        },
        "type": "object",
        "required": [
          "compared",
          "agreed",
          "disagreed",
          "agreement_pct"
        ],
        "title": "ReconciliationOut"
      },
      "ReconciliationRunDetail": {
        "properties": {
          "run": {
            "$ref": "#/components/schemas/ReconciliationRunOut"
          },
          "findings": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationFindingOut"
            },
            "type": "array",
            "title": "Findings"
          },
          "findings_total": {
            "type": "integer",
            "title": "Findings Total"
          },
          "findings_limit": {
            "type": "integer",
            "title": "Findings Limit"
          },
          "findings_offset": {
            "type": "integer",
            "title": "Findings Offset"
          }
        },
        "type": "object",
        "required": [
          "run",
          "findings",
          "findings_total",
          "findings_limit",
          "findings_offset"
        ],
        "title": "ReconciliationRunDetail"
      },
      "ReconciliationRunOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "job": {
            "type": "string",
            "title": "Job"
          },
          "window_start": {
            "type": "string",
            "format": "date-time",
            "title": "Window Start"
          },
          "window_end": {
            "type": "string",
            "format": "date-time",
            "title": "Window End"
          },
          "flagged_count": {
            "type": "integer",
            "title": "Flagged Count"
          },
          "summary": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "open_count": {
            "type": "integer",
            "title": "Open Count",
            "default": 0
          },
          "open_magnitude_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Magnitude Usd"
          }
        },
        "type": "object",
        "required": [
          "id",
          "job",
          "window_start",
          "window_end",
          "flagged_count",
          "summary",
          "created_at"
        ],
        "title": "ReconciliationRunOut"
      },
      "ReconciliationRunsPage": {
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationRunOut"
            },
            "type": "array",
            "title": "Runs"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "runs",
          "total",
          "limit",
          "offset"
        ],
        "title": "ReconciliationRunsPage"
      },
      "RefReport": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source"
          },
          "location": {
            "type": "string",
            "title": "Location"
          }
        },
        "type": "object",
        "required": [
          "source",
          "location"
        ],
        "title": "RefReport"
      },
      "RejectionFilter": {
        "properties": {
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "since": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Since"
          },
          "until": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Until"
          },
          "key_id": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Id"
          },
          "failure_stage": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Stage"
          },
          "limit": {
            "type": "integer",
            "maximum": 200.0,
            "minimum": 1.0,
            "title": "Limit",
            "default": 50
          },
          "offset": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Offset",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "org_id"
        ],
        "title": "RejectionFilter",
        "description": "Mirrors UsageFilter's shape for the fields that apply to a refusal.\n\nNo `model` or `status`: nothing was routed, and the status is implied."
      },
      "RejectionOut": {
        "properties": {
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Id"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "failure_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Stage"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "request_id",
          "created_at",
          "key_id",
          "model",
          "failure_stage",
          "error_code",
          "status_code",
          "path",
          "latency_ms"
        ],
        "title": "RejectionOut"
      },
      "RejectionsPage": {
        "properties": {
          "rejections": {
            "items": {
              "$ref": "#/components/schemas/RejectionOut"
            },
            "type": "array",
            "title": "Rejections"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "by_stage": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Stage",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "rejections",
          "total",
          "limit",
          "offset"
        ],
        "title": "RejectionsPage"
      },
      "RequestBodiesOut": {
        "properties": {
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "captured_at": {
            "type": "string",
            "title": "Captured At",
            "description": "When the gateway wrote this record."
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "description": "True when the response was an SSE stream, in which case `response.text` is the frame transcript rather than a JSON body \u2014 unless the transcript was large enough to be held outside the record, when `response.content` carries a reference to it instead.",
            "default": false
          },
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "description": "How far back this endpoint resolves a request id. Bodies have no separate window \u2014 they are readable for as long as the request is."
          },
          "policy_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Policy Source",
            "description": "Which tier granted access: `inline` (the serving key's own policy), `org_default`, or `admin_override` \u2014 an operator read, which is not governed by either."
          },
          "request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StoredBody"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the caller sent. Where PII redaction was enabled this is the REDACTED copy \u2014 the raw body was never stored. Null when the policy asked for responses only, or when nothing was stored for this request."
          },
          "response": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StoredBody"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the gateway returned."
          }
        },
        "type": "object",
        "required": [
          "request_id",
          "captured_at",
          "retention_days"
        ],
        "title": "RequestBodiesOut",
        "description": "The bodies of one request, as the gateway received and returned them."
      },
      "RequestHeadersOut": {
        "properties": {
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "captured_at": {
            "type": "string",
            "title": "Captured At",
            "description": "When the gateway wrote this record."
          },
          "method": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Method"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          },
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "description": "How far back this endpoint can resolve a request id."
          },
          "request": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Request",
            "description": "Headers the caller sent. A credential's name is reported with a `[redacted]` value \u2014 its presence is visible, its value never stored. The client-IP forwarding chain is not reported."
          },
          "response": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Response",
            "description": "Headers the gateway returned \u2014 not the upstream provider's set, which is never exposed."
          }
        },
        "type": "object",
        "required": [
          "request_id",
          "captured_at",
          "retention_days"
        ],
        "title": "RequestHeadersOut",
        "description": "The headers of one request, as the gateway received and returned them."
      },
      "RequestLookupOut": {
        "properties": {
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "outcome": {
            "type": "string",
            "title": "Outcome",
            "description": "'success' | 'error' when a model was reached, 'rejected' when a gate refused the request before any model was called, 'pending' while the request's own usage row has not landed yet, and 'unknown' once it is too old to still be arriving \u2014 the attempts are reported either way."
          },
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "description": "How far back this endpoint can resolve a request id."
          },
          "ambiguous": {
            "type": "boolean",
            "title": "Ambiguous",
            "description": "The id addressed more than one request, so `attempts` is omitted rather than guessed at. Only possible for requests made before the gateway began minting the id itself.",
            "default": false
          },
          "event": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsageEventOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The request itself: the attempt that served it."
          },
          "attempts": {
            "items": {
              "$ref": "#/components/schemas/UsageEventOut"
            },
            "type": "array",
            "title": "Attempts",
            "description": "Every attempt including retried failures, oldest first."
          },
          "attempt_count": {
            "type": "integer",
            "title": "Attempt Count",
            "default": 0
          },
          "retry_count": {
            "type": "integer",
            "title": "Retry Count",
            "description": "attempt_count - 1.",
            "default": 0
          },
          "related_events": {
            "items": {
              "$ref": "#/components/schemas/UsageEventOut"
            },
            "type": "array",
            "title": "Related Events",
            "description": "Other billed rows this request produced (e.g. a memory embedding)."
          },
          "matches": {
            "items": {
              "$ref": "#/components/schemas/UsageEventOut"
            },
            "type": "array",
            "title": "Matches",
            "description": "Populated only when `ambiguous`."
          },
          "rejection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RejectionOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Populated only when `outcome` is 'rejected'."
          },
          "routing_chain": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RoutingChainOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The per-attempt waterfall (MESH-863). NULL when the request took one attempt, so there is nothing to draw."
          },
          "request_headers": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestHeadersOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The HTTP headers of the request, as the gateway received and returned them (MESH-835). NULL when the request log no longer holds the record, or is unreachable \u2014 the rest of the payload answers regardless."
          },
          "request_bodies": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestBodiesOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The request and response BODIES, when the key or its org has opted in to storing them (MESH-856). NULL by default: body logging is off unless enabled, cannot be enabled under zero data retention, and expires on its own retention window before the rest of this payload does."
          },
          "video_task": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RequestVideoTaskOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The video generation task this request created, with its current status and result. NULL for any other request."
          }
        },
        "type": "object",
        "required": [
          "request_id",
          "outcome",
          "retention_days"
        ],
        "title": "RequestLookupOut",
        "description": "Everything we can say about one request id (MESH-768).\n\nCarries ``UsageEventOut``, never ``UsageEventDetailOut`` \u2014 `error_detail`,\n`provider_error_code`, `provider_request_id`, `upstream_status`,\n`provider_requested` and `ip_address` exist only on the admin subclass, so no\nprovider internal can reach a customer through this shape."
      },
      "RequestVideoTaskOut": {
        "properties": {
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "queued | running | succeeded | failed | expired | cancelled."
          },
          "video_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Url",
            "description": "Signed URL of the generated video. Expires."
          },
          "last_frame_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Frame Url"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration",
            "description": "Requested length, in seconds."
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "billed_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Seconds"
          },
          "billed_resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Resolution"
          },
          "settled": {
            "type": "boolean",
            "title": "Settled",
            "description": "Usage for the task has been billed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "task_id",
          "status",
          "settled",
          "created_at"
        ],
        "title": "RequestVideoTaskOut",
        "description": "Customer-safe view of a video task: error text scrubbed, no provider fields."
      },
      "ResearchSessionDetailOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Fields"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "outcome": {
            "type": "string",
            "title": "Outcome"
          },
          "llm_calls": {
            "type": "integer",
            "title": "Llm Calls"
          },
          "tokens": {
            "type": "integer",
            "title": "Tokens"
          },
          "steps_count": {
            "type": "integer",
            "title": "Steps Count"
          },
          "started_at": {
            "type": "string",
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/ResearchStepOut"
            },
            "type": "array",
            "title": "Steps"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "provider",
          "outcome",
          "llm_calls",
          "tokens",
          "steps_count",
          "started_at",
          "steps"
        ],
        "title": "ResearchSessionDetailOut"
      },
      "ResearchSessionListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ResearchSessionRowOut"
            },
            "type": "array",
            "title": "Items"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "limit",
          "offset"
        ],
        "title": "ResearchSessionListOut"
      },
      "ResearchSessionRowOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Fields"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "outcome": {
            "type": "string",
            "title": "Outcome"
          },
          "llm_calls": {
            "type": "integer",
            "title": "Llm Calls"
          },
          "tokens": {
            "type": "integer",
            "title": "Tokens"
          },
          "steps_count": {
            "type": "integer",
            "title": "Steps Count"
          },
          "started_at": {
            "type": "string",
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "provider",
          "outcome",
          "llm_calls",
          "tokens",
          "steps_count",
          "started_at"
        ],
        "title": "ResearchSessionRowOut",
        "description": "List row \u2014 deliberately WITHOUT `steps`: a trajectory can hold up to 500\nentries, so the blob is fetched only by the detail endpoint. `steps_count` is\ncomputed server-side with jsonb_array_length."
      },
      "ResearchStepOut": {
        "properties": {
          "seq": {
            "type": "integer",
            "title": "Seq"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "summary": {
            "type": "string",
            "title": "Summary"
          },
          "at": {
            "type": "string",
            "title": "At"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          },
          "urls": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Urls"
          },
          "evidence_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evidence Id"
          },
          "field_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field Name"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Value"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "drop_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Drop Reason"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          }
        },
        "type": "object",
        "required": [
          "seq",
          "kind",
          "summary",
          "at"
        ],
        "title": "ResearchStepOut",
        "description": "One entry of a session's ordered trajectory. Every string here is\nagent-authored or page-derived \u2014 the admin client renders all of it as PLAIN\nTEXT and validates `url`/`urls` with `isHttpUrl` before linking."
      },
      "ReservationCategoryTotal": {
        "properties": {
          "kind": {
            "type": "string",
            "title": "Kind",
            "description": "Reservation category: \"realtime\", \"async\", \"video\", or \"inference\" (the short-lived hold on a synchronous request still in flight)."
          },
          "reserved_usd": {
            "type": "string",
            "title": "Reserved Usd",
            "description": "Total funds held for this category, in USD."
          }
        },
        "type": "object",
        "required": [
          "kind",
          "reserved_usd"
        ],
        "title": "ReservationCategoryTotal"
      },
      "ReservationItem": {
        "properties": {
          "kind": {
            "type": "string",
            "title": "Kind",
            "description": "Reservation category: \"async\" or \"video\"."
          },
          "reference_id": {
            "type": "string",
            "title": "Reference Id",
            "description": "Operation identifier (video task_id / response_id)."
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model the operation runs against."
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "Current operation status."
          },
          "amount_usd": {
            "type": "string",
            "title": "Amount Usd",
            "description": "Funds held for this operation, in USD."
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At",
            "description": "When the operation was created (ISO 8601)."
          }
        },
        "type": "object",
        "required": [
          "kind",
          "reference_id",
          "amount_usd"
        ],
        "title": "ReservationItem"
      },
      "ResolutionOut": {
        "properties": {
          "runs_with_telemetry": {
            "type": "integer",
            "title": "Runs With Telemetry"
          },
          "resolved": {
            "type": "integer",
            "title": "Resolved"
          },
          "unresolved": {
            "type": "integer",
            "title": "Unresolved"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "unresolved_ratio": {
            "type": "number",
            "title": "Unresolved Ratio"
          }
        },
        "type": "object",
        "required": [
          "runs_with_telemetry",
          "resolved",
          "unresolved",
          "total",
          "unresolved_ratio"
        ],
        "title": "ResolutionOut"
      },
      "ResponsesFunctionTool": {
        "properties": {
          "type": {
            "type": "string",
            "const": "function",
            "title": "Type",
            "default": "function"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "parameters": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          },
          "strict": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strict"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "ResponsesFunctionTool",
        "description": "Custom function tool in the Responses API flat format.\n\nThe Responses API uses a flat structure (name/description/parameters at top\nlevel) unlike Chat Completions which nests them under a \"function\" key:\n\n  Responses API:   {\"type\": \"function\", \"name\": \"add\", \"parameters\": {...}}\n  Chat Completions: {\"type\": \"function\", \"function\": {\"name\": \"add\", ...}}"
      },
      "ResponsesRequest": {
        "properties": {
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {},
                "type": "array"
              }
            ],
            "title": "Input"
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "default",
                  "flex"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template"
          },
          "variables": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": false
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "reasoning": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning"
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ResponsesFunctionTool"
                    },
                    {
                      "$ref": "#/components/schemas/BuiltinTool"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "tool_choice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Choice"
          },
          "response_format": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "plugins": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Plugins"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          },
          "user": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "User",
            "deprecated": true
          },
          "previous_response_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Response Id"
          },
          "instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instructions"
          },
          "thinking": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thinking"
          },
          "caching": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Caching"
          },
          "store": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store"
          },
          "background": {
            "type": "boolean",
            "title": "Background",
            "default": false
          },
          "include": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Include"
          },
          "expire_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expire At"
          },
          "max_tool_calls": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 10.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tool Calls"
          },
          "context_management": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Management"
          },
          "text": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text"
          },
          "timeout": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Timeout"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "input"
        ],
        "title": "ResponsesRequest",
        "example": {
          "input": "Explain quantum computing in one sentence.",
          "model": "openai/gpt-5-pro",
          "stream": false
        }
      },
      "RetryInputConfig": {
        "properties": {
          "max_retries": {
            "type": "integer",
            "title": "Max Retries",
            "default": 0
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "RetryInputConfig"
      },
      "RevenueTimeSeries": {
        "properties": {
          "date": {
            "type": "string",
            "title": "Date"
          },
          "amount": {
            "type": "string",
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          }
        },
        "type": "object",
        "required": [
          "date",
          "amount",
          "currency"
        ],
        "title": "RevenueTimeSeries"
      },
      "ReviewIn": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "action": {
            "type": "string",
            "pattern": "^(approve|reject)$",
            "title": "Action"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Fields",
            "default": []
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "action"
        ],
        "title": "ReviewIn"
      },
      "ReviewOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Fields"
          },
          "skipped_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Skipped Fields",
            "default": []
          },
          "stale_fields": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Stale Fields",
            "default": []
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "action",
          "fields",
          "status"
        ],
        "title": "ReviewOut"
      },
      "ReviewQueueOut": {
        "properties": {
          "pinned_rows": {
            "type": "integer",
            "title": "Pinned Rows"
          },
          "open_holds": {
            "type": "integer",
            "title": "Open Holds"
          },
          "open_hold_rows": {
            "type": "integer",
            "title": "Open Hold Rows"
          },
          "oldest_open_hold_age_days": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oldest Open Hold Age Days"
          },
          "stale_open_holds": {
            "type": "integer",
            "title": "Stale Open Holds"
          }
        },
        "type": "object",
        "required": [
          "pinned_rows",
          "open_holds",
          "open_hold_rows",
          "stale_open_holds"
        ],
        "title": "ReviewQueueOut"
      },
      "ReviveExpiredResponse": {
        "properties": {
          "revived": {
            "type": "integer",
            "title": "Revived",
            "default": 0
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "retention_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retention Days"
          }
        },
        "type": "object",
        "title": "ReviveExpiredResponse",
        "description": "Outcome of a memID-wide revive.\n\n``expires_at`` is the deadline every revived item now carries \u2014 null when the\nmemory keeps items forever. ``retention_days`` echoes the policy that was\napplied, unchanged: reviving does not rewrite it, so the caller can see that\nthe same window is now counting from today."
      },
      "RevokeAdminKeyRequest": {
        "properties": {
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "title": "RevokeAdminKeyRequest"
      },
      "RoleCatalogEntry": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "role",
          "description",
          "permissions"
        ],
        "title": "RoleCatalogEntry"
      },
      "RoleGrant": {
        "properties": {
          "scope": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "scope",
          "permissions"
        ],
        "title": "RoleGrant",
        "description": "What one built-in role holds, and how far those grants reach."
      },
      "RoleListResponse": {
        "properties": {
          "roles": {
            "items": {
              "$ref": "#/components/schemas/RoleResponse"
            },
            "type": "array",
            "title": "Roles"
          }
        },
        "type": "object",
        "required": [
          "roles"
        ],
        "title": "RoleListResponse"
      },
      "RoleResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "scope": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "scope",
          "permissions",
          "created_at",
          "updated_at"
        ],
        "title": "RoleResponse"
      },
      "RollbackIn": {
        "properties": {
          "change_id": {
            "type": "string",
            "format": "uuid",
            "title": "Change Id"
          },
          "pin": {
            "type": "boolean",
            "title": "Pin",
            "default": true
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "change_id"
        ],
        "title": "RollbackIn"
      },
      "RotateAdminKeyRequest": {
        "properties": {
          "grace_hours": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Hours"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "Same rules as create: a UTC offset, in the future, no more than 90 days out. Omit to inherit the predecessor's own lifetime \u2014 never the cap (D5)."
          }
        },
        "type": "object",
        "title": "RotateAdminKeyRequest"
      },
      "RouterSelectRequest": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "type": "array",
            "minItems": 1,
            "title": "Messages"
          },
          "api_type": {
            "type": "string",
            "enum": [
              "completions",
              "responses",
              "embeddings"
            ],
            "title": "Api Type",
            "default": "completions"
          },
          "exclude_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Models"
          },
          "candidate_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Candidate Models"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "messages"
        ],
        "title": "RouterSelectRequest"
      },
      "RouterSelectResponse": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model"
          },
          "auto_router": {
            "$ref": "#/components/schemas/AutoRouterMeta"
          },
          "reasoning_effort": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "high",
                  "medium",
                  "low",
                  "none"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Effort"
          }
        },
        "type": "object",
        "required": [
          "model",
          "auto_router"
        ],
        "title": "RouterSelectResponse"
      },
      "RoutingChainOut": {
        "properties": {
          "hops": {
            "items": {
              "$ref": "#/components/schemas/RoutingHopOut"
            },
            "type": "array",
            "title": "Hops"
          },
          "attempt_count": {
            "type": "integer",
            "title": "Attempt Count"
          },
          "retry_count": {
            "type": "integer",
            "title": "Retry Count",
            "description": "attempt_count - 1."
          },
          "fallback_count": {
            "type": "integer",
            "title": "Fallback Count",
            "description": "Hops that changed provider, model, or credential \u2014 a retry of the same pair on the same key is not a fallback."
          },
          "failed_attempt_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed Attempt Latency Ms",
            "description": "Upstream time spent on attempts that did not serve \u2014 retries included, so it is NOT the same as fallback time. NULL when nothing was retried, or when no failed attempt recorded a duration; 0 is a measurement."
          },
          "total_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Ms",
            "description": "The request's own latency."
          }
        },
        "type": "object",
        "required": [
          "hops",
          "attempt_count",
          "retry_count",
          "fallback_count"
        ],
        "title": "RoutingChainOut",
        "description": "The per-attempt waterfall for one request, plus the figures drawn beside it."
      },
      "RoutingDataVersionDetailOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "editable": {
            "type": "boolean",
            "title": "Editable"
          },
          "classifier_system_prompt": {
            "type": "string",
            "title": "Classifier System Prompt"
          },
          "benchmarks": {
            "additionalProperties": {
              "items": {},
              "type": "array"
            },
            "type": "object",
            "title": "Benchmarks"
          },
          "brand_premium": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Premium"
          },
          "brand_standard": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Standard"
          },
          "brand_responses_premium": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Responses Premium"
          },
          "brand_responses_standard": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Responses Standard"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "active",
          "editable",
          "classifier_system_prompt",
          "benchmarks",
          "brand_premium",
          "brand_standard",
          "brand_responses_premium",
          "brand_responses_standard"
        ],
        "title": "RoutingDataVersionDetailOut"
      },
      "RoutingDataVersionOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "editable": {
            "type": "boolean",
            "title": "Editable",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "active"
        ],
        "title": "RoutingDataVersionOut"
      },
      "RoutingDataVersionWriteIn": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "classifier_system_prompt": {
            "type": "string",
            "title": "Classifier System Prompt"
          },
          "benchmarks": {
            "additionalProperties": {
              "items": {},
              "type": "array"
            },
            "type": "object",
            "title": "Benchmarks"
          },
          "brand_premium": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Premium"
          },
          "brand_standard": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Standard"
          },
          "brand_responses_premium": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Responses Premium"
          },
          "brand_responses_standard": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Brand Responses Standard"
          }
        },
        "type": "object",
        "required": [
          "name",
          "source",
          "classifier_system_prompt",
          "benchmarks",
          "brand_premium",
          "brand_standard",
          "brand_responses_premium",
          "brand_responses_standard"
        ],
        "title": "RoutingDataVersionWriteIn"
      },
      "RoutingDataVersionsOut": {
        "properties": {
          "versions": {
            "items": {
              "$ref": "#/components/schemas/RoutingDataVersionOut"
            },
            "type": "array",
            "title": "Versions"
          },
          "active": {
            "type": "string",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "versions",
          "active"
        ],
        "title": "RoutingDataVersionsOut"
      },
      "RoutingHopOut": {
        "properties": {
          "attempt_no": {
            "type": "integer",
            "title": "Attempt No"
          },
          "kind": {
            "type": "string",
            "title": "Kind",
            "description": "'initial' | 'retry' (same provider and model) | 'provider_fallback' | 'model_fallback'. A rotation onto a different platform credential reads as 'retry' \u2014 which credential served is internal."
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "The upstream this hop was attempted against \u2014 see `served` for which hop ended the request. Present on failed hops too, so a fallback's abandoned primary is named. Treat as unstable: whether the upstream is exposed at all is under review."
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Category"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms",
            "description": "This hop's upstream time. Exact on a failed hop. On the SERVING hop it is derived (the request's provider time less every failed attempt's) and is therefore an upper bound: it still includes any backoff waited between attempts, which no stored column separates."
          },
          "served": {
            "type": "boolean",
            "title": "Served",
            "description": "True on the one hop the request ended on."
          },
          "byok_fallback": {
            "type": "boolean",
            "title": "Byok Fallback",
            "description": "This attempt began on the caller's own credential and completed on ours (X-BYOK-Fallback-Triggered).",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "attempt_no",
          "kind",
          "provider",
          "model",
          "status",
          "served"
        ],
        "title": "RoutingHopOut",
        "description": "One attempt in a request's routing chain (MESH-863), oldest first.\n\n``kind`` is what the customer is actually asking when a request was slow: was\nthe same upstream retried, did we move to another one, or was the model\nswapped. Rendering those identically hides the answer.\n\nA BYOK credential fallback is a fifth event but NOT a ``kind``: it happens\ninside a single attempt, so it can coincide with any of them. It rides on\n``byok_fallback`` instead, or a hop that both changed provider and fell back\nfrom the caller's credential could only report one of the two."
      },
      "RoutingPolicyTemplateCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "policy": {
            "$ref": "#/components/schemas/KeyRoutingPolicyInput"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          }
        },
        "type": "object",
        "required": [
          "name",
          "policy"
        ],
        "title": "RoutingPolicyTemplateCreate"
      },
      "RoutingPolicyTemplateOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "policy": {
            "additionalProperties": true,
            "type": "object",
            "title": "Policy"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "is_global": {
            "type": "boolean",
            "title": "Is Global"
          },
          "keys_count": {
            "type": "integer",
            "title": "Keys Count"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "policy",
          "is_default",
          "is_global",
          "keys_count",
          "created_at",
          "updated_at"
        ],
        "title": "RoutingPolicyTemplateOut"
      },
      "RoutingPolicyTemplateUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/KeyRoutingPolicyInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Default"
          }
        },
        "type": "object",
        "title": "RoutingPolicyTemplateUpdate"
      },
      "RoutingPolicyTemplatesPage": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RoutingPolicyTemplateOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "RoutingPolicyTemplatesPage"
      },
      "RunProgressOut": {
        "properties": {
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Kind"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Id"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Id"
          },
          "step": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProgressStepOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "steps_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Steps Total"
          },
          "llm_calls": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Llm Calls"
          },
          "tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens"
          }
        },
        "type": "object",
        "required": [
          "active"
        ],
        "title": "RunProgressOut",
        "description": "The live frame, or `active=false` when nothing is running.\n\nNever 404s on \"no run in flight\" \u2014 that is the normal state, and an admin page\npolling this should render \"idle\", not an error."
      },
      "SaveVersionRequest": {
        "properties": {
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          }
        },
        "type": "object",
        "title": "SaveVersionRequest",
        "description": "A new immutable snapshot of a template's behavioral content. A field\nleft unset carries over from `latest_version_id` \u2014 changing just `system`\ndoesn't require resending `messages`."
      },
      "ScopeMetrics": {
        "properties": {
          "rpm": {
            "$ref": "#/components/schemas/RateMetric"
          },
          "rpd": {
            "$ref": "#/components/schemas/RateMetric"
          },
          "tpm": {
            "$ref": "#/components/schemas/RateMetric"
          }
        },
        "type": "object",
        "required": [
          "rpm",
          "rpd",
          "tpm"
        ],
        "title": "ScopeMetrics",
        "description": "Rate limits for an org / team / member scope."
      },
      "SearchRequest": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query"
          },
          "top_k": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": 1.0,
            "title": "Top K",
            "default": 5
          },
          "file_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Ids",
            "description": "Restrict to these file IDs"
          },
          "filter": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter",
            "description": "Match on any metadata key/value pairs"
          },
          "date_from": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date From",
            "description": "Unix timestamp \u2014 only chunks created after this"
          },
          "date_to": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date To",
            "description": "Unix timestamp \u2014 only chunks created before this"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "query"
        ],
        "title": "SearchRequest",
        "example": {
          "query": "climate change impact on agriculture"
        }
      },
      "SearchResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/SearchResult"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "results"
        ],
        "title": "SearchResponse"
      },
      "SearchResult": {
        "properties": {
          "score": {
            "type": "number",
            "title": "Score"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "parent_text": {
            "type": "string",
            "title": "Parent Text"
          },
          "file_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Id"
          },
          "file_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Name"
          },
          "file_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Type"
          },
          "mime_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mime Type"
          },
          "chunk_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chunk Index"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "score",
          "text",
          "parent_text",
          "file_id",
          "file_name",
          "file_type",
          "mime_type",
          "chunk_index",
          "created_at",
          "metadata"
        ],
        "title": "SearchResult"
      },
      "ServerTool": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type"
          }
        },
        "additionalProperties": true,
        "type": "object",
        "required": [
          "type"
        ],
        "title": "ServerTool",
        "description": "A provider-HOSTED tool \u2014 the provider runs it, we do not call back to the caller.\n\nThe shape is ``{\"type\": \"<vendor>:<tool>\"}`` with vendor-specific extras alongside;\n``openrouter:web_search`` is the one in use today, and is what\n``app/schemas/responses.py`` documents as the preferred replacement for the deprecated\n``plugins`` field. Chat previously pinned ``tools[].type`` to ``Literal[\"function\"]``,\nso that documented form 422'd here while working on the responses surface (MESH-948).\n\n``extra=\"allow\"`` because each hosted tool carries its own options (search depth,\nresult count, \u2026) and this gateway does not own their schemas \u2014 it forwards them.\n``type`` deliberately excludes ``\"function\"``: a function tool must match ``Tool`` so a\nmalformed one still gets ``Tool``'s field errors rather than silently validating here\nas an unknown hosted tool and being forwarded as nonsense."
      },
      "ServingOut": {
        "properties": {
          "serving": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Serving",
            "description": "True = the row was billable at `at`; False = it was not; NULL = unknown. NULL is a real answer here, not a missing one: activation history is only partially audited (see `note`), and guessing is exactly the failure this field exists to prevent."
          },
          "evidence": {
            "type": "string",
            "title": "Evidence",
            "description": "change_log = an audited is_active transition at-or-before `at` (or the old_value of the first one after it) decided this \u2014 the confident answer. current_row = no transition exists in the ledger, so the live flag was carried back; INFERRED, because row creation is not audited. unknown = no evidence either way."
          },
          "changed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Changed At",
            "description": "applied_at of the is_active transition in effect at `at`, when one exists."
          },
          "run_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Run Id"
          },
          "actor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Actor",
            "description": "Who flipped the row's activation state."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "e.g. admin_api_patch_active, admin_api_deactivate, admin_api_replace."
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note",
            "description": "Why the evidence is what it is, when it is not conclusive."
          }
        },
        "type": "object",
        "required": [
          "serving",
          "evidence",
          "changed_at",
          "run_id",
          "actor",
          "reason"
        ],
        "title": "ServingOut",
        "description": "Axis 2: was this row BILLABLE at `at` \u2014 answered independently of, and\nnever inferred from, the price axis."
      },
      "SetMemberRolesRequest": {
        "properties": {
          "role_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 100,
            "title": "Role Ids"
          }
        },
        "type": "object",
        "required": [
          "role_ids"
        ],
        "title": "SetMemberRolesRequest",
        "description": "The complete set of custom roles the member should hold.\n\n``role_ids`` is typed as UUID so every id is parsed once, here: comparing a\nraw request string against ``str(row.id)`` misses on any of the three\nnon-canonical spellings ``uuid.UUID`` accepts and 404s a legitimate caller.\n\nBounded because the list reaches an ``IN`` clause and a multi-row INSERT\nverbatim. Far above any real catalogue \u2014 it refuses a pathological request,\nnot a large one."
      },
      "ShadowOut": {
        "properties": {
          "window_hours": {
            "type": "integer",
            "title": "Window Hours"
          },
          "event_count": {
            "type": "integer",
            "title": "Event Count"
          },
          "cost_at_current": {
            "type": "string",
            "title": "Cost At Current"
          },
          "cost_at_proposed": {
            "type": "string",
            "title": "Cost At Proposed"
          },
          "delta_usd": {
            "type": "string",
            "title": "Delta Usd"
          },
          "delta_pct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delta Pct"
          },
          "no_traffic": {
            "type": "boolean",
            "title": "No Traffic",
            "default": false
          },
          "capped": {
            "type": "boolean",
            "title": "Capped",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "window_hours",
          "event_count",
          "cost_at_current",
          "cost_at_proposed",
          "delta_usd"
        ],
        "title": "ShadowOut",
        "description": "The money impact of one held field, as surfaced on /admin/pricing/pending.\n\nMoney crosses the wire as STRINGS (repo convention \u2014 never float)."
      },
      "SignedUrlOut": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "expires_in_s": {
            "type": "integer",
            "title": "Expires In S"
          }
        },
        "type": "object",
        "required": [
          "url",
          "expires_in_s"
        ],
        "title": "SignedUrlOut"
      },
      "SignupCompleteRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "dub_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dub Id"
          },
          "method": {
            "type": "string",
            "title": "Method",
            "default": "unknown"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email"
        ],
        "title": "SignupCompleteRequest"
      },
      "SourceHealthOut": {
        "properties": {
          "sources": {
            "items": {
              "$ref": "#/components/schemas/SourceStatusOut"
            },
            "type": "array",
            "title": "Sources"
          },
          "resolution": {
            "$ref": "#/components/schemas/ResolutionOut"
          },
          "feed_snapshot_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Feed Snapshot At"
          },
          "feed_snapshot_warning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Feed Snapshot Warning"
          },
          "feed_models": {
            "type": "integer",
            "title": "Feed Models",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "sources",
          "resolution"
        ],
        "title": "SourceHealthOut"
      },
      "SourceRowOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "url_template": {
            "type": "string",
            "title": "Url Template"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "priority": {
            "type": "integer",
            "title": "Priority"
          },
          "origin": {
            "type": "string",
            "title": "Origin"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "never_verified": {
            "type": "boolean",
            "title": "Never Verified"
          },
          "disagrees": {
            "type": "boolean",
            "title": "Disagrees"
          }
        },
        "type": "object",
        "required": [
          "id",
          "url_template",
          "source_type",
          "region",
          "is_default",
          "priority",
          "origin",
          "active",
          "notes",
          "never_verified",
          "disagrees"
        ],
        "title": "SourceRowOut"
      },
      "SourceStatusOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "wired": {
            "type": "boolean",
            "title": "Wired"
          },
          "deterministic": {
            "type": "boolean",
            "title": "Deterministic"
          },
          "last_observation_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Observation At"
          },
          "observations": {
            "type": "integer",
            "title": "Observations",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "wired",
          "deterministic"
        ],
        "title": "SourceStatusOut"
      },
      "SourcesListOut": {
        "properties": {
          "providers": {
            "items": {
              "$ref": "#/components/schemas/ProviderSourcesOut"
            },
            "type": "array",
            "title": "Providers"
          }
        },
        "type": "object",
        "required": [
          "providers"
        ],
        "title": "SourcesListOut"
      },
      "SpeechRequest": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "default": "eleven_flash_v2_5"
          },
          "input": {
            "type": "string",
            "title": "Input"
          },
          "voice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream",
            "default": true
          },
          "response_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "language_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language Code"
          },
          "voice_settings": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VoiceSettings"
              },
              {
                "type": "null"
              }
            ]
          },
          "pronunciation_dictionary_locators": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PronunciationDictionaryLocator"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pronunciation Dictionary Locators"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "previous_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Text"
          },
          "next_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Text"
          },
          "previous_request_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Request Ids"
          },
          "next_request_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Request Ids"
          },
          "apply_text_normalization": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Apply Text Normalization"
          },
          "apply_language_text_normalization": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Apply Language Text Normalization"
          },
          "use_pvc_as_ivc": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Pvc As Ivc"
          },
          "enable_logging": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enable Logging"
          },
          "optimize_streaming_latency": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Optimize Streaming Latency"
          },
          "speaker": {
            "type": "string",
            "title": "Speaker",
            "default": "anushka"
          },
          "target_language_code": {
            "type": "string",
            "title": "Target Language Code",
            "default": "hi-IN"
          },
          "pitch": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pitch"
          },
          "pace": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pace"
          },
          "loudness": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Loudness"
          },
          "speech_sample_rate": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Speech Sample Rate"
          },
          "enable_preprocessing": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enable Preprocessing"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "input"
        ],
        "title": "SpeechRequest",
        "example": {
          "input": "Hello, this is a test of the text-to-speech API.",
          "model": "sarvam/bulbul:v3",
          "speaker": "ritu",
          "stream": false
        }
      },
      "SpendBucketPoint": {
        "properties": {
          "bucket_index": {
            "type": "integer",
            "title": "Bucket Index"
          },
          "bucket_start": {
            "type": "string",
            "title": "Bucket Start"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "cost_usd": {
            "type": "string",
            "title": "Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "bucket_index",
          "bucket_start",
          "label",
          "cost_usd"
        ],
        "title": "SpendBucketPoint"
      },
      "SpendByMember": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "total_requests",
          "total_cost_usd"
        ],
        "title": "SpendByMember"
      },
      "SpendByTeam": {
        "properties": {
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "total_requests",
          "total_cost_usd"
        ],
        "title": "SpendByTeam",
        "description": "`team_id` is null for the org's unteamed usage, which is real spend and\nwould silently vanish from the total if the bucket were dropped."
      },
      "SpendMetrics": {
        "properties": {
          "wallet_debits_usd": {
            "type": "number",
            "title": "Wallet Debits Usd"
          },
          "debited_users": {
            "type": "integer",
            "title": "Debited Users"
          },
          "gross_inference_cost_usd": {
            "type": "number",
            "title": "Gross Inference Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "wallet_debits_usd",
          "debited_users",
          "gross_inference_cost_usd"
        ],
        "title": "SpendMetrics"
      },
      "SpendTrendResponse": {
        "properties": {
          "as_of": {
            "type": "string",
            "title": "As Of"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "hourly",
              "weekly",
              "monthly"
            ],
            "title": "Granularity"
          },
          "period_start": {
            "type": "string",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "title": "Period End"
          },
          "summary": {
            "$ref": "#/components/schemas/SpendTrendSummary"
          },
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/SpendBucketPoint"
            },
            "type": "array",
            "title": "Buckets"
          },
          "moving_average": {
            "items": {
              "$ref": "#/components/schemas/MovingAveragePoint"
            },
            "type": "array",
            "title": "Moving Average"
          }
        },
        "type": "object",
        "required": [
          "as_of",
          "granularity",
          "period_start",
          "period_end",
          "summary",
          "buckets",
          "moving_average"
        ],
        "title": "SpendTrendResponse"
      },
      "SpendTrendSummary": {
        "properties": {
          "total_spend_usd": {
            "type": "string",
            "title": "Total Spend Usd"
          },
          "latest_ma_usd": {
            "type": "string",
            "title": "Latest Ma Usd"
          }
        },
        "type": "object",
        "required": [
          "total_spend_usd",
          "latest_ma_usd"
        ],
        "title": "SpendTrendSummary"
      },
      "StagedListOut": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/StagedRowOut"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "StagedListOut"
      },
      "StagedRowOut": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "provider_model_id": {
            "type": "string",
            "title": "Provider Model Id"
          },
          "model_name": {
            "type": "string",
            "title": "Model Name"
          },
          "modality": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Modality"
          },
          "sync_status": {
            "type": "string",
            "title": "Sync Status"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "pricing_unit": {
            "type": "string",
            "title": "Pricing Unit"
          },
          "input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Cost"
          },
          "output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Cost"
          },
          "upstream_input_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Input Cost"
          },
          "upstream_output_cost": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Output Cost"
          },
          "pending_change": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending Change"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider",
          "provider_model_id",
          "model_name",
          "modality",
          "sync_status",
          "is_active",
          "context_window",
          "pricing_unit",
          "input_cost",
          "output_cost",
          "upstream_input_cost",
          "upstream_output_cost",
          "pending_change",
          "updated_at"
        ],
        "title": "StagedRowOut"
      },
      "StatusSyncResponse": {
        "properties": {
          "thread_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thread Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "type": "object",
        "title": "StatusSyncResponse"
      },
      "StoredBody": {
        "properties": {
          "truncated": {
            "type": "boolean",
            "title": "Truncated",
            "description": "True when the body exceeded the response cap and only its head is returned. Never inferred from a length \u2014 a body this large is otherwise indistinguishable from one that was genuinely this size."
          },
          "bytes": {
            "type": "integer",
            "title": "Bytes",
            "description": "Size of the stored body, before this cap."
          },
          "stored_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stored Bytes",
            "description": "How much is returned. Only present when truncated."
          },
          "content": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Content",
            "description": "The body as JSON, when it was stored as JSON and fits."
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "The body as text \u2014 a non-JSON body, a stream transcript, or the head of one that was truncated."
          }
        },
        "type": "object",
        "required": [
          "truncated",
          "bytes"
        ],
        "title": "StoredBody",
        "description": "One side's body, and whether this response carries all of it."
      },
      "StrategyReport": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "attempts": {
            "type": "integer",
            "title": "Attempts"
          },
          "wins": {
            "type": "integer",
            "title": "Wins"
          },
          "hard_failures": {
            "type": "integer",
            "title": "Hard Failures"
          },
          "benign_failures": {
            "type": "integer",
            "title": "Benign Failures"
          },
          "hard_failure_pct": {
            "type": "number",
            "title": "Hard Failure Pct"
          },
          "top_failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top Failure Reason"
          }
        },
        "type": "object",
        "required": [
          "strategy",
          "attempts",
          "wins",
          "hard_failures",
          "benign_failures",
          "hard_failure_pct"
        ],
        "title": "StrategyReport"
      },
      "StripePaymentRequest": {
        "properties": {
          "amount": {
            "type": "integer",
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "usd"
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstin"
          },
          "couponCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Couponcode"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "amount"
        ],
        "title": "StripePaymentRequest"
      },
      "StripePaymentResponse": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "free": {
            "type": "boolean",
            "title": "Free",
            "default": false
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "chargeAmount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chargeamount"
          },
          "gstAmount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gstamount"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "StripePaymentResponse"
      },
      "SubmitModelRequestBody": {
        "properties": {
          "model_name": {
            "type": "string",
            "title": "Model Name"
          },
          "use_case": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Case"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          }
        },
        "type": "object",
        "required": [
          "model_name"
        ],
        "title": "SubmitModelRequestBody"
      },
      "SupportRequestList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SupportRequestOut"
            },
            "type": "array",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "SupportRequestList"
      },
      "SupportRequestOut": {
        "properties": {
          "reference": {
            "type": "string",
            "title": "Reference"
          },
          "thread_id": {
            "type": "string",
            "title": "Thread Id"
          },
          "summary": {
            "type": "string",
            "title": "Summary"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "reference",
          "thread_id",
          "summary",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "SupportRequestOut"
      },
      "SupportedProviderOut": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "credential_shape": {
            "type": "string",
            "title": "Credential Shape",
            "default": "api_key"
          }
        },
        "type": "object",
        "required": [
          "provider"
        ],
        "title": "SupportedProviderOut"
      },
      "SurfaceMetrics": {
        "properties": {
          "surface": {
            "type": "string",
            "title": "Surface"
          },
          "requests": {
            "type": "integer",
            "title": "Requests",
            "default": 0
          },
          "successful": {
            "type": "integer",
            "title": "Successful",
            "default": 0
          },
          "failed": {
            "type": "integer",
            "title": "Failed",
            "default": 0
          },
          "success_rate": {
            "type": "string",
            "title": "Success Rate",
            "default": "0.0%"
          },
          "failure_rate": {
            "type": "string",
            "title": "Failure Rate",
            "default": "0.0%"
          },
          "server_failed": {
            "type": "integer",
            "title": "Server Failed",
            "default": 0
          },
          "client_rejected": {
            "type": "integer",
            "title": "Client Rejected",
            "default": 0
          },
          "error_code_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Error Code Counts",
            "default": {}
          }
        },
        "type": "object",
        "required": [
          "surface"
        ],
        "title": "SurfaceMetrics",
        "description": "One surface's slice of the day. Rates are a share of THAT surface, not the\nplatform \u2014 the whole point is that a small surface failing hard is visible."
      },
      "SweepOut": {
        "properties": {
          "checked": {
            "type": "integer",
            "title": "Checked",
            "description": "Cells examined \u2014 one per (model_id, provider, field) with either a stored price or applied change-log history. `ok + diverged + unexplained + legacy_unaudited` always equals this."
          },
          "ok": {
            "type": "integer",
            "title": "Ok",
            "description": "The ledger's last applied value equals the stored value."
          },
          "diverged": {
            "type": "integer",
            "title": "Diverged",
            "description": "Applied history exists but its final value is NOT what is stored \u2014 something wrote the column after the last audited write. Includes the inverse (ledger has a value, the column is NULL)."
          },
          "unexplained": {
            "type": "integer",
            "title": "Unexplained",
            "description": "A stored price with ZERO applied rows on a cell the change log otherwise knows about (hold/dismissal rows). Nothing in the ledger put that value there."
          },
          "broken_chain": {
            "type": "integer",
            "title": "Broken Chain",
            "description": "Cells where an applied row's old_value does not chain to the previous row's new_value \u2014 an out-of-band write that a later audited write has since papered over. ORTHOGONAL to the four verdicts above: it overlaps ok/diverged and is NOT part of the partition that sums to `checked`."
          },
          "legacy_unaudited": {
            "type": "integer",
            "title": "Legacy Unaudited",
            "description": "A stored price on a cell with no change-log rows at all \u2014 seeded/legacy, predating the audit spine. Counted, never alarmed, and not listed in `findings`."
          },
          "rows_scanned": {
            "type": "integer",
            "title": "Rows Scanned",
            "description": "model_pricing rows read."
          },
          "providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers",
            "description": "Providers swept, in the order they were swept."
          },
          "findings": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Findings",
            "description": "Per-finding detail for diverged / unexplained / broken-chain cells only, capped at `pricing_sweep_max_findings`. The counts above are always exact and uncapped."
          },
          "findings_truncated": {
            "type": "boolean",
            "title": "Findings Truncated",
            "description": "True when the detail list hit the cap \u2014 the counts are still complete."
          },
          "pairing_checked": {
            "type": "integer",
            "title": "Pairing Checked",
            "description": "MESH-559: sell\u2194upstream PAIRS examined (two per catalog_sync row \u2014 the input pair and the output pair). A separate universe from `checked`, which counts ledger cells; the two never sum.",
            "default": 0
          },
          "pairing_broken": {
            "type": "integer",
            "title": "Pairing Broken",
            "description": "Pairs where the stored sell price does not equal its `upstream_*` cost carried through the row's declared margin, or where exactly one of the two is NULL. `usage_events.upstream_cost_usd` is derived from those columns, so a break means every COGS figure for that model is wrong.",
            "default": 0
          },
          "pairing_findings": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Pairing Findings",
            "description": "Per-break detail, capped at `pricing_sweep_max_findings`. The counts above are always exact and uncapped."
          },
          "pairing_findings_truncated": {
            "type": "boolean",
            "title": "Pairing Findings Truncated",
            "description": "True when the pairing detail list hit the cap.",
            "default": false
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Errors",
            "description": "Per-provider scan failures. A non-empty list fails the request with a 502: a partial sweep must never read as a clean bill of health."
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          }
        },
        "type": "object",
        "required": [
          "checked",
          "ok",
          "diverged",
          "unexplained",
          "broken_chain",
          "legacy_unaudited",
          "rows_scanned",
          "providers",
          "findings",
          "findings_truncated",
          "duration_ms"
        ],
        "title": "SweepOut"
      },
      "SweepResult": {
        "properties": {
          "deleted": {
            "type": "integer",
            "title": "Deleted"
          },
          "facts_purged": {
            "type": "integer",
            "title": "Facts Purged"
          },
          "vector_misses": {
            "type": "integer",
            "title": "Vector Misses"
          },
          "batches": {
            "type": "integer",
            "title": "Batches"
          },
          "remaining": {
            "type": "boolean",
            "title": "Remaining"
          }
        },
        "type": "object",
        "required": [
          "deleted",
          "facts_purged",
          "vector_misses",
          "batches",
          "remaining"
        ],
        "title": "SweepResult"
      },
      "SystemSettingOut": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "value": {
            "type": "string",
            "title": "Value"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "key",
          "value",
          "description",
          "updated_at"
        ],
        "title": "SystemSettingOut"
      },
      "SystemUsageSummary": {
        "properties": {
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost Usd"
          },
          "population": {
            "type": "string",
            "const": "all",
            "title": "Population",
            "default": "all"
          },
          "internal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsagePopulationTotals"
              },
              {
                "type": "null"
              }
            ]
          },
          "external": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsagePopulationTotals"
              },
              {
                "type": "null"
              }
            ]
          },
          "unattributed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UsagePopulationTotals"
              },
              {
                "type": "null"
              }
            ]
          },
          "total_models": {
            "type": "integer",
            "title": "Total Models"
          },
          "total_rag_files": {
            "type": "integer",
            "title": "Total Rag Files"
          },
          "total_rag_size_bytes": {
            "type": "integer",
            "title": "Total Rag Size Bytes"
          },
          "rag_files_embedded": {
            "type": "integer",
            "title": "Rag Files Embedded"
          },
          "rag_files_pending_embed": {
            "type": "integer",
            "title": "Rag Files Pending Embed"
          }
        },
        "type": "object",
        "required": [
          "total_requests",
          "successful_requests",
          "total_tokens",
          "total_cost_usd",
          "total_models",
          "total_rag_files",
          "total_rag_size_bytes",
          "rag_files_embedded",
          "rag_files_pending_embed"
        ],
        "title": "SystemUsageSummary"
      },
      "TagBreakdown": {
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests",
            "default": 0
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "platform_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Fee Usd"
          }
        },
        "type": "object",
        "required": [
          "value",
          "requests"
        ],
        "title": "TagBreakdown",
        "description": "One value of the grouped-by tag key (MESH-855)."
      },
      "TeamContext": {
        "properties": {
          "team_id": {
            "type": "string",
            "title": "Team Id"
          },
          "team_name": {
            "type": "string",
            "title": "Team Name"
          },
          "team_slug": {
            "type": "string",
            "title": "Team Slug"
          },
          "team_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpm Limit"
          },
          "team_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpd Limit"
          },
          "team_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Tpm Limit"
          },
          "team_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Spend Cap"
          }
        },
        "type": "object",
        "required": [
          "team_id",
          "team_name",
          "team_slug",
          "team_rpm_limit",
          "team_rpd_limit",
          "team_tpm_limit",
          "team_spend_cap"
        ],
        "title": "TeamContext"
      },
      "TeamMemberContext": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          },
          "access_via_org_admin": {
            "type": "boolean",
            "title": "Access Via Org Admin",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "role",
          "member_rpm_limit",
          "member_rpd_limit",
          "member_tpm_limit",
          "member_spend_cap"
        ],
        "title": "TeamMemberContext"
      },
      "TeamMemberResponse": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "access_via_org_admin": {
            "type": "boolean",
            "title": "Access Via Org Admin",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "role",
          "member_rpm_limit",
          "member_rpd_limit",
          "member_tpm_limit",
          "member_spend_cap",
          "created_at"
        ],
        "title": "TeamMemberResponse"
      },
      "TeamPermissions": {
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "scope": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/OrgPermission"
            },
            "type": "array",
            "title": "Permissions"
          }
        },
        "type": "object",
        "required": [
          "role",
          "scope",
          "permissions"
        ],
        "title": "TeamPermissions",
        "description": "What the caller may do to ONE team of theirs."
      },
      "TeamResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "team_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpm Limit"
          },
          "team_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpd Limit"
          },
          "team_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Tpm Limit"
          },
          "team_spend_cap": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Spend Cap"
          },
          "default_rpm_limit": {
            "type": "integer",
            "title": "Default Rpm Limit"
          },
          "default_rpd_limit": {
            "type": "integer",
            "title": "Default Rpd Limit"
          },
          "default_tpm_limit": {
            "type": "integer",
            "title": "Default Tpm Limit"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "is_member": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Member"
          },
          "team_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Role"
          },
          "org_role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Role"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "name",
          "slug",
          "is_default",
          "team_rpm_limit",
          "team_rpd_limit",
          "team_tpm_limit",
          "team_spend_cap",
          "default_rpm_limit",
          "default_rpd_limit",
          "default_tpm_limit",
          "created_at"
        ],
        "title": "TeamResponse"
      },
      "TemplateSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "owner": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "is_global": {
            "type": "boolean",
            "title": "Is Global"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "is_beta": {
            "type": "boolean",
            "title": "Is Beta"
          },
          "creator_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator Name"
          },
          "creator_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator Email"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          },
          "published_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Version"
          },
          "latest_version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Version"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "owner",
          "org_id",
          "team_id",
          "is_global",
          "description",
          "system",
          "messages",
          "model",
          "params",
          "variables",
          "category",
          "version",
          "is_beta",
          "creator_name",
          "creator_email",
          "created_at",
          "updated_at"
        ],
        "title": "TemplateSummary"
      },
      "TemplateVersionSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "template_id": {
            "type": "string",
            "title": "Template Id"
          },
          "version_number": {
            "type": "integer",
            "title": "Version Number"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables"
          },
          "reverted_from_version_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reverted From Version Id"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "is_published": {
            "type": "boolean",
            "title": "Is Published"
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "template_id",
          "version_number",
          "system",
          "messages",
          "model",
          "params",
          "variables",
          "reverted_from_version_id",
          "created_by",
          "created_at",
          "is_published",
          "published_at"
        ],
        "title": "TemplateVersionSummary"
      },
      "TestAzureFoundryCredentialsRequest": {
        "properties": {
          "api_key": {
            "type": "string",
            "minLength": 1,
            "title": "Api Key",
            "description": "Azure AI Foundry primary or secondary key"
          },
          "endpoint": {
            "type": "string",
            "minLength": 1,
            "title": "Endpoint",
            "description": "Full project endpoint URL (e.g. https://my-resource.services.ai.azure.com/api/projects/my-project)"
          }
        },
        "type": "object",
        "required": [
          "api_key",
          "endpoint"
        ],
        "title": "TestAzureFoundryCredentialsRequest",
        "description": "Body for the *test-without-saving* endpoint.\n\nValidation needs only api_key + endpoint \u2014 there is no team scoping until a\nkey is actually registered \u2014 so this is a lean subset of\nCreateAzureFoundryProviderKeyRequest with no ``team_id``."
      },
      "TestEmbeddingsRequest": {
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/app__routers__admin_test_embeddings__ModelEntry"
            },
            "type": "array",
            "title": "Models"
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {},
                "type": "array"
              }
            ],
            "title": "Input"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "default": "openai"
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions"
          },
          "encoding_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encoding Format"
          }
        },
        "type": "object",
        "required": [
          "models",
          "input"
        ],
        "title": "TestEmbeddingsRequest"
      },
      "TestEventRequest": {
        "properties": {
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "channel_id": {
            "type": "string",
            "title": "Channel Id"
          }
        },
        "type": "object",
        "required": [
          "event_type",
          "channel_id"
        ],
        "title": "TestEventRequest"
      },
      "TestExistingAWSKeyRequest": {
        "properties": {
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          }
        },
        "type": "object",
        "title": "TestExistingAWSKeyRequest"
      },
      "TestModelItem": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Model Id"
          },
          "input_token_cost_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Token Cost Per 1M"
          },
          "output_token_cost_per_1m": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Token Cost Per 1M"
          },
          "model_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Type"
          },
          "brand": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand"
          },
          "pricing_unit": {
            "type": "string",
            "title": "Pricing Unit",
            "default": "per_1m_tokens"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "modality": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Modality",
            "default": [
              "text"
            ]
          },
          "input_modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Modalities"
          },
          "output_modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Modalities"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking",
            "default": false
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api",
            "default": true
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api",
            "default": false
          },
          "supports_embeddings": {
            "type": "boolean",
            "title": "Supports Embeddings",
            "default": false
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching",
            "default": false
          },
          "supports_tools": {
            "type": "boolean",
            "title": "Supports Tools",
            "default": false
          },
          "supports_structured_output": {
            "type": "boolean",
            "title": "Supports Structured Output",
            "default": false
          },
          "supports_system_prompt": {
            "type": "boolean",
            "title": "Supports System Prompt",
            "default": true
          },
          "supports_background_response": {
            "type": "boolean",
            "title": "Supports Background Response",
            "default": false
          },
          "supports_video_generation": {
            "type": "boolean",
            "title": "Supports Video Generation",
            "default": false
          },
          "supports_video_first_frame": {
            "type": "boolean",
            "title": "Supports Video First Frame",
            "default": false
          },
          "supports_video_last_frame": {
            "type": "boolean",
            "title": "Supports Video Last Frame",
            "default": false
          },
          "supports_video_reference_image": {
            "type": "boolean",
            "title": "Supports Video Reference Image",
            "default": false
          },
          "supports_video_reference_video": {
            "type": "boolean",
            "title": "Supports Video Reference Video",
            "default": false
          },
          "supports_video_reference_audio": {
            "type": "boolean",
            "title": "Supports Video Reference Audio",
            "default": false
          },
          "supports_video_negative_prompt": {
            "type": "boolean",
            "title": "Supports Video Negative Prompt",
            "default": false
          },
          "max_prompt_chars": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Prompt Chars"
          },
          "supports_generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supports Generate Audio"
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "request_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Cost"
          },
          "standard_context_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standard Context Threshold"
          },
          "long_context_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Input Cost"
          },
          "long_context_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Output Cost"
          },
          "cache_read_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Input Cost"
          },
          "cache_write_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write Input Cost"
          },
          "cache_write_1h_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write 1H Input Cost"
          },
          "long_context_cache_read_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Read Input Cost"
          },
          "long_context_cache_write_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Write Input Cost"
          },
          "cache_hit_price_per_token": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Hit Price Per Token"
          },
          "batch_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Input Cost"
          },
          "batch_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Output Cost"
          },
          "training_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Training Cost"
          },
          "fine_tuned_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Input Cost"
          },
          "fine_tuned_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Output Cost"
          },
          "image_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Input Cost"
          },
          "image_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost"
          },
          "input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Cost"
          },
          "output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Cost"
          },
          "image_output_size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Size"
          },
          "audio_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Input Cost"
          },
          "audio_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Output Cost"
          },
          "transcription_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcription Cost"
          },
          "output_with_audio_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output With Audio Cost"
          },
          "output_with_video_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output With Video Cost"
          },
          "supports_image_edit": {
            "type": "boolean",
            "title": "Supports Image Edit",
            "default": false
          },
          "supports_image_inpaint": {
            "type": "boolean",
            "title": "Supports Image Inpaint",
            "default": false
          },
          "supports_image_outpaint": {
            "type": "boolean",
            "title": "Supports Image Outpaint",
            "default": false
          },
          "supports_image_mix": {
            "type": "boolean",
            "title": "Supports Image Mix",
            "default": false
          },
          "supports_image_reframe": {
            "type": "boolean",
            "title": "Supports Image Reframe",
            "default": false
          },
          "supports_image_upscale": {
            "type": "boolean",
            "title": "Supports Image Upscale",
            "default": false
          },
          "supports_image_remove_background": {
            "type": "boolean",
            "title": "Supports Image Remove Background",
            "default": false
          },
          "supports_image_reference": {
            "type": "boolean",
            "title": "Supports Image Reference",
            "default": false
          },
          "image_output_cost_512": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 512"
          },
          "image_output_cost_1k": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 1K"
          },
          "image_output_cost_2k": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 2K"
          },
          "image_output_cost_4k": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost 4K"
          },
          "video_output_cost_360p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 360P"
          },
          "video_output_cost_480p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 480P"
          },
          "video_output_cost_540p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 540P"
          },
          "video_output_cost_720p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 720P"
          },
          "video_output_cost_768p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 768P"
          },
          "video_output_cost_1080p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 1080P"
          },
          "video_output_cost_1440p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 1440P"
          },
          "video_output_cost_4k": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output Cost 4K"
          },
          "video_output_with_video_cost_360p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 360P"
          },
          "video_output_with_video_cost_480p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 480P"
          },
          "video_output_with_video_cost_540p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 540P"
          },
          "video_output_with_video_cost_720p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 720P"
          },
          "video_output_with_video_cost_768p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 768P"
          },
          "video_output_with_video_cost_1080p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 1080P"
          },
          "video_output_with_video_cost_1440p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 1440P"
          },
          "video_output_with_video_cost_4k": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Video Cost 4K"
          },
          "video_output_with_audio_cost_360p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 360P"
          },
          "video_output_with_audio_cost_480p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 480P"
          },
          "video_output_with_audio_cost_540p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 540P"
          },
          "video_output_with_audio_cost_720p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 720P"
          },
          "video_output_with_audio_cost_768p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 768P"
          },
          "video_output_with_audio_cost_1080p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 1080P"
          },
          "video_output_with_audio_cost_1440p": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 1440P"
          },
          "video_output_with_audio_cost_4k": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Output With Audio Cost 4K"
          },
          "price_matrix": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Matrix"
          },
          "tool_pricing": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Pricing"
          },
          "reasoning_output_cost": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning Output Cost"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "is_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Default"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "default": true
          },
          "is_free": {
            "type": "boolean",
            "title": "Is Free",
            "default": false
          },
          "cache_read_audio_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Audio Input Cost"
          },
          "deprecated_date": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deprecated Date"
          },
          "responses_provider_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responses Provider Model Id"
          },
          "supports_realtime": {
            "type": "boolean",
            "title": "Supports Realtime",
            "default": false
          },
          "realtime_session_max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Session Max Tokens"
          },
          "realtime_max_concurrent_per_owner": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realtime Max Concurrent Per Owner"
          },
          "audio_input_price_per_token": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Input Price Per Token"
          },
          "audio_output_price_per_token": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Output Price Per Token"
          },
          "cached_audio_input_price_per_token": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Audio Input Price Per Token"
          },
          "cached_text_input_price_per_token": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Text Input Price Per Token"
          },
          "test_modality": {
            "type": "string",
            "enum": [
              "completions",
              "image"
            ],
            "title": "Test Modality",
            "default": "completions"
          },
          "skip_test": {
            "type": "boolean",
            "title": "Skip Test",
            "default": false
          },
          "composite_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompositeTestConfig"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "model_id"
        ],
        "title": "TestModelItem"
      },
      "TestModelsRequest": {
        "properties": {
          "is_dry_run": {
            "type": "boolean",
            "title": "Is Dry Run",
            "default": true
          },
          "skip_models_update": {
            "type": "boolean",
            "title": "Skip Models Update",
            "default": false
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "models": {
            "items": {
              "$ref": "#/components/schemas/TestModelItem"
            },
            "type": "array",
            "title": "Models"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "default": "Reply with just the word OK and nothing else."
          },
          "image_prompt": {
            "type": "string",
            "title": "Image Prompt",
            "default": "A red circle on a white background."
          },
          "timeout": {
            "type": "number",
            "title": "Timeout",
            "default": 500.0
          }
        },
        "type": "object",
        "required": [
          "provider",
          "models"
        ],
        "title": "TestModelsRequest"
      },
      "TestResponsesRequest": {
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/app__routers__admin_test_responses__ModelEntry"
            },
            "type": "array",
            "title": "Models"
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {},
                "type": "array"
              }
            ],
            "title": "Input"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "default": "qwen"
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 2.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "reasoning": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reasoning"
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          }
        },
        "type": "object",
        "required": [
          "models",
          "input"
        ],
        "title": "TestResponsesRequest"
      },
      "TextBlock": {
        "properties": {
          "type": {
            "type": "string",
            "const": "text",
            "title": "Type",
            "default": "text"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "TextBlock",
        "description": "A ``{\"type\": \"text\", \"text\": ...}`` content block."
      },
      "ThinkingBlock": {
        "properties": {
          "type": {
            "type": "string",
            "const": "thinking",
            "title": "Type",
            "default": "thinking"
          },
          "thinking": {
            "type": "string",
            "title": "Thinking",
            "default": ""
          },
          "signature": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signature"
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "title": "ThinkingBlock",
        "description": "An assistant's reasoning, as this endpoint itself emits it.\n\nAccepted so a client can replay our own answer back as conversation history,\nthen dropped: the chat shape has no inbound reasoning slot. It carries no\n``signature`` either \u2014 the reasoning we surface is a provider-authored\nsummary, never verifiable raw CoT, so there is nothing truthful to sign."
      },
      "Thread": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "surface": {
            "type": "string",
            "title": "Surface"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "messages": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Messages"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "surface",
          "model",
          "params",
          "messages",
          "org_id",
          "team_id",
          "created_at",
          "updated_at"
        ],
        "title": "Thread"
      },
      "ThreadSummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "surface": {
            "type": "string",
            "title": "Surface"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "message_count": {
            "type": "integer",
            "title": "Message Count"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "title",
          "surface",
          "model",
          "params",
          "message_count",
          "created_at",
          "updated_at"
        ],
        "title": "ThreadSummary",
        "description": "List item. Deliberately carries no messages \u2014 see list_threads."
      },
      "ThreadsPage": {
        "properties": {
          "threads": {
            "items": {
              "$ref": "#/components/schemas/ThreadSummary"
            },
            "type": "array",
            "title": "Threads"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "threads",
          "total",
          "limit",
          "offset"
        ],
        "title": "ThreadsPage"
      },
      "TickResult": {
        "properties": {
          "reclaimed": {
            "type": "integer",
            "title": "Reclaimed",
            "default": 0
          },
          "claimed": {
            "type": "integer",
            "title": "Claimed",
            "default": 0
          },
          "succeeded": {
            "type": "integer",
            "title": "Succeeded",
            "default": 0
          },
          "retrying": {
            "type": "integer",
            "title": "Retrying",
            "default": 0
          },
          "dead": {
            "type": "integer",
            "title": "Dead",
            "default": 0
          },
          "errored": {
            "type": "integer",
            "title": "Errored",
            "default": 0
          },
          "pruned": {
            "type": "integer",
            "title": "Pruned",
            "default": 0
          },
          "queue_depth": {
            "type": "integer",
            "title": "Queue Depth",
            "default": 0
          }
        },
        "type": "object",
        "title": "TickResult"
      },
      "TokenUsage": {
        "properties": {
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          }
        },
        "type": "object",
        "title": "TokenUsage"
      },
      "Tool": {
        "properties": {
          "type": {
            "type": "string",
            "const": "function",
            "title": "Type",
            "default": "function"
          },
          "function": {
            "$ref": "#/components/schemas/ToolFunction"
          }
        },
        "type": "object",
        "required": [
          "function"
        ],
        "title": "Tool"
      },
      "ToolCall": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "type": {
            "type": "string",
            "const": "function",
            "title": "Type",
            "default": "function"
          },
          "function": {
            "additionalProperties": true,
            "type": "object",
            "title": "Function"
          },
          "thought_signature": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thought Signature"
          }
        },
        "type": "object",
        "required": [
          "id",
          "function"
        ],
        "title": "ToolCall"
      },
      "ToolFunction": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "parameters": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parameters"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "ToolFunction"
      },
      "ToolPrice": {
        "properties": {
          "cost": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 10.0,
                "minimum": 0.0
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              }
            ],
            "title": "Cost"
          },
          "unit": {
            "$ref": "#/components/schemas/ToolPriceUnit",
            "default": "per_call"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "cost"
        ],
        "title": "ToolPrice",
        "description": "One tool's per-call price.\n\n``extra=\"forbid\"`` matters: a stray ``{\"currency\": \"EUR\"}`` would otherwise be\naccepted and then silently billed as USD."
      },
      "ToolPriceUnit": {
        "type": "string",
        "enum": [
          "per_call"
        ],
        "title": "ToolPriceUnit",
        "description": "Units the biller understands. ``per_call`` is the only one it charges on."
      },
      "ToolResultBlock": {
        "properties": {
          "type": {
            "type": "string",
            "const": "tool_result",
            "title": "Type",
            "default": "tool_result"
          },
          "tool_use_id": {
            "type": "string",
            "title": "Tool Use Id"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "is_error": {
            "type": "boolean",
            "title": "Is Error",
            "default": false
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "required": [
          "tool_use_id"
        ],
        "title": "ToolResultBlock",
        "description": "The caller's answer to a ``tool_use``.\n\nStructurally this is the biggest difference from OpenAI: Anthropic puts tool\nresults in a **user** message as content blocks, while OpenAI uses dedicated\n``role=\"tool\"`` messages. One Anthropic user turn therefore expands into\nseveral OpenAI messages \u2014 see ``messages_request_to_chat``."
      },
      "ToolUseBlock": {
        "properties": {
          "type": {
            "type": "string",
            "const": "tool_use",
            "title": "Type",
            "default": "tool_use"
          },
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "input": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input"
          },
          "cache_control": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "ToolUseBlock",
        "description": "An assistant's tool invocation. ``input`` is a decoded object here, while\nOpenAI carries it as a JSON *string* in ``function.arguments``."
      },
      "TranscriptionResponse": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "TranscriptionResponse"
      },
      "TransferOwnershipRequest": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          }
        },
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "TransferOwnershipRequest"
      },
      "TriageUpdate": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "TriageUpdate"
      },
      "UpdateAzureFoundryProviderKeyRequest": {
        "properties": {
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallback"
          }
        },
        "type": "object",
        "title": "UpdateAzureFoundryProviderKeyRequest"
      },
      "UpdateGenericProviderKeyRequest": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallback"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          }
        },
        "type": "object",
        "title": "UpdateGenericProviderKeyRequest"
      },
      "UpdateIncidentRequest": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "severity": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "affected_components": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Affected Components"
          },
          "scheduled_start": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled Start"
          },
          "scheduled_end": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scheduled End"
          },
          "expected_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Updated At",
            "description": "The incident's `updated_at` as the caller last read it. When sent, the edit is applied only if the record has not changed since \u2014 otherwise 409 `incident_conflict`, whose `error.details` carries the current values. Omit to write unconditionally (last-write-wins)."
          }
        },
        "type": "object",
        "title": "UpdateIncidentRequest",
        "description": "All fields optional; only those present in the payload are applied."
      },
      "UpdateMemberRequest": {
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          }
        },
        "type": "object",
        "title": "UpdateMemberRequest"
      },
      "UpdateMemoryItemRequest": {
        "properties": {
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "position": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Position"
          }
        },
        "type": "object",
        "title": "UpdateMemoryItemRequest",
        "description": "Partial edit of one item. Every field omitted = leave unchanged.\n\n``item_type`` is absent on purpose \u2014 see ``update_memory_item``.",
        "example": {
          "content": "Always answer in British English."
        }
      },
      "UpdateMemoryRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "retention_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retention Days"
          }
        },
        "type": "object",
        "title": "UpdateMemoryRequest"
      },
      "UpdateModelOverrideRequest": {
        "properties": {
          "upstream_model_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Model Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          }
        },
        "type": "object",
        "title": "UpdateModelOverrideRequest"
      },
      "UpdateModelRequestBody": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "UpdateModelRequestBody"
      },
      "UpdateOpenAIProviderKeyRequest": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "allow_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallback"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          }
        },
        "type": "object",
        "title": "UpdateOpenAIProviderKeyRequest"
      },
      "UpdateOrgRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "org_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpm Limit"
          },
          "org_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Rpd Limit"
          },
          "org_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Tpm Limit"
          },
          "org_spend_cap": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Spend Cap"
          },
          "default_api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Api Version"
          },
          "default_pii_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PiiPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_body_log_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BodyLogPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "zero_data_retention": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Zero Data Retention"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          }
        },
        "type": "object",
        "title": "UpdateOrgRequest"
      },
      "UpdateOrgTierRequest": {
        "properties": {
          "rate_limit_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Limit Tier"
          }
        },
        "type": "object",
        "title": "UpdateOrgTierRequest"
      },
      "UpdateProviderKeyRequest": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "secret_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Secret Ref"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "allow_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allow Fallback"
          }
        },
        "type": "object",
        "title": "UpdateProviderKeyRequest"
      },
      "UpdateRoleRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "scope": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccessScope"
              },
              {
                "type": "null"
              }
            ]
          },
          "permissions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/OrgPermission"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Permissions"
          }
        },
        "type": "object",
        "title": "UpdateRoleRequest",
        "description": "Partial. ``slug`` is absent on purpose \u2014 see ``update_role``."
      },
      "UpdateSettingsRequest": {
        "properties": {
          "phone_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "title": "Postal Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "UpdateSettingsRequest"
      },
      "UpdateSystemSettingRequest": {
        "properties": {
          "value": {
            "type": "string",
            "title": "Value"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "value"
        ],
        "title": "UpdateSystemSettingRequest"
      },
      "UpdateTeamMemberRequest": {
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "member_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpm Limit"
          },
          "member_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Rpd Limit"
          },
          "member_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Tpm Limit"
          },
          "member_spend_cap": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Spend Cap"
          }
        },
        "type": "object",
        "title": "UpdateTeamMemberRequest"
      },
      "UpdateTeamRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "team_rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpm Limit"
          },
          "team_rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Rpd Limit"
          },
          "team_tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Tpm Limit"
          },
          "team_spend_cap": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Spend Cap"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          }
        },
        "type": "object",
        "title": "UpdateTeamRequest"
      },
      "UpdateTemplateRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "System",
            "deprecated": true
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages",
            "deprecated": true
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "deprecated": true
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params",
            "deprecated": true
          },
          "variables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variables",
            "deprecated": true
          }
        },
        "type": "object",
        "title": "UpdateTemplateRequest",
        "description": "Metadata goes straight onto the template row. The five content fields\nare deprecated (MESH-503) \u2014 see DECISIONS.md \u2014 but still create+publish a\nversion under the hood, matching this PATCH's original behavior."
      },
      "UpdateThreadRequest": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "surface": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Surface"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Params"
          },
          "messages": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Messages"
          }
        },
        "type": "object",
        "title": "UpdateThreadRequest",
        "description": "Every field optional; only what is sent is written.\n\n`messages` replaces the whole list rather than appending. The client already\nholds the authoritative thread in memory (it is what the user is looking at),\nand an append endpoint would need to resolve conflicts between two tabs \u2014 a\nproblem a last-writer-wins replace simply does not have."
      },
      "UpsertIn": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MetadataIn"
            },
            "type": "array",
            "maxItems": 250,
            "minItems": 1,
            "title": "Items"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "items"
        ],
        "title": "UpsertIn"
      },
      "UpsertOut": {
        "properties": {
          "written": {
            "type": "integer",
            "title": "Written"
          },
          "skipped_stale": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Skipped Stale",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "written"
        ],
        "title": "UpsertOut"
      },
      "UsageEventDetailOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Label"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "end_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End User Id"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "model_name": {
            "type": "string",
            "title": "Model Name"
          },
          "model_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Provider"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream"
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "tokens_per_second": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Per Second"
          },
          "provider_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Latency Ms"
          },
          "platform_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Latency Ms"
          },
          "ttft_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ttft Ms"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Category"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "failure_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Stage"
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "images_generated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Images Generated"
          },
          "model_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Type"
          },
          "is_byok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Byok"
          },
          "byok_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Byok Key Id"
          },
          "byok_key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Byok Key Label"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "fallback_triggered": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Triggered"
          },
          "platform_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Fee Usd"
          },
          "image_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Tokens"
          },
          "member_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Name"
          },
          "member_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Email"
          },
          "attempt_no": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempt No"
          },
          "is_retry_attempt": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Retry Attempt"
          },
          "routing_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Fallback"
          },
          "model_requested": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Requested"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id"
          },
          "traffic_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Traffic Type"
          },
          "upstream_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Cost Usd"
          },
          "cached_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached Tokens"
          },
          "cache_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Source"
          },
          "provider_request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Request Id"
          },
          "upstream_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Upstream Status"
          },
          "provider_error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Error Code"
          },
          "error_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Detail"
          },
          "ip_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ip Address"
          },
          "provider_requested": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Requested"
          },
          "provider_served": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Served"
          },
          "attempts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/UsageEventOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempts"
          },
          "attempt_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempt Count"
          },
          "retry_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Retry Count"
          },
          "routing_chain": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RoutingChainOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "key_id",
          "key_label",
          "request_id",
          "model",
          "model_name",
          "model_provider",
          "stream",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost_usd",
          "latency_ms",
          "tokens_per_second",
          "status",
          "error_code",
          "created_at"
        ],
        "title": "UsageEventDetailOut",
        "description": "Full per-request detail for the admin request-inspector drawer.\n\nExtends the list row with provider-side error tracing and the extra cost /\nlatency / token columns useful when triaging a single request."
      },
      "UsageEventOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "key_id": {
            "type": "string",
            "title": "Key Id"
          },
          "key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Label"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "end_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End User Id"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "model_name": {
            "type": "string",
            "title": "Model Name"
          },
          "model_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Provider"
          },
          "stream": {
            "type": "boolean",
            "title": "Stream"
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cost Usd"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "tokens_per_second": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokens Per Second"
          },
          "provider_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Latency Ms"
          },
          "platform_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Latency Ms"
          },
          "ttft_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ttft Ms"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Category"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "failure_stage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Stage"
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "images_generated": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Images Generated"
          },
          "model_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Type"
          },
          "is_byok": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Byok"
          },
          "byok_key_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Byok Key Id"
          },
          "byok_key_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Byok Key Label"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "fallback_triggered": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fallback Triggered"
          },
          "platform_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform Fee Usd"
          },
          "image_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Tokens"
          },
          "member_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Name"
          },
          "member_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Email"
          },
          "attempt_no": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Attempt No"
          },
          "is_retry_attempt": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Retry Attempt"
          },
          "routing_fallback": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Fallback"
          },
          "model_requested": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Requested"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "id",
          "key_id",
          "key_label",
          "request_id",
          "model",
          "model_name",
          "model_provider",
          "stream",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "cost_usd",
          "latency_ms",
          "tokens_per_second",
          "status",
          "error_code",
          "created_at"
        ],
        "title": "UsageEventOut"
      },
      "UsageEventsPage": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/UsageEventOut"
            },
            "type": "array",
            "title": "Events"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "events",
          "total",
          "limit",
          "offset"
        ],
        "title": "UsageEventsPage"
      },
      "UsageFilter": {
        "properties": {
          "since": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Since"
          },
          "until": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Until"
          },
          "model": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "status": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "key_id": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key Id"
          },
          "org_id": {
            "type": "string",
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "member_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member User Id"
          },
          "end_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End User Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "failure_stage": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Stage"
          },
          "service_tier": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "model_type": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Type"
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "tag_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tag Key"
          },
          "routing": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing",
            "description": "Narrow to requests routing did not serve on the first attempt: `retried`, `provider_fallback`, `model_fallback`. Any may match."
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 200.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit",
            "default": 50
          },
          "offset": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Offset",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "org_id"
        ],
        "title": "UsageFilter"
      },
      "UsageInfo": {
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "type": "integer",
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          },
          "input_tokens_details": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Tokens Details"
          },
          "output_tokens_details": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "integer"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Tokens Details"
          }
        },
        "type": "object",
        "required": [
          "prompt_tokens",
          "completion_tokens",
          "total_tokens"
        ],
        "title": "UsageInfo"
      },
      "UsagePopulationTotals": {
        "properties": {
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "requests",
          "successful_requests",
          "total_tokens",
          "total_cost_usd"
        ],
        "title": "UsagePopulationTotals",
        "description": "Traffic totals for ONE population (internal or external).\n\nMESH-757. The headline fields on ``SystemUsageSummary`` cover ALL traffic and\nkeep their existing meaning; these break that same total into the two groups so\na reader can see which one they are looking at. Reported side by side and\nlabelled \u2014 never silently filtered \u2014 because a number that quietly drops 92% of\nitself is how MESH-585 happened."
      },
      "UsageReconcileResult": {
        "properties": {
          "day": {
            "type": "string",
            "title": "Day"
          },
          "providers_checked": {
            "type": "integer",
            "title": "Providers Checked"
          },
          "billable_rows": {
            "type": "integer",
            "title": "Billable Rows"
          },
          "no_usage_signal_rows": {
            "type": "integer",
            "title": "No Usage Signal Rows"
          },
          "charged_without_usage_rows": {
            "type": "integer",
            "title": "Charged Without Usage Rows"
          },
          "charged_without_usage_cost_usd": {
            "type": "string",
            "title": "Charged Without Usage Cost Usd"
          },
          "uncharged_usage_rows": {
            "type": "integer",
            "title": "Uncharged Usage Rows"
          },
          "uncharged_usage_usd": {
            "type": "string",
            "title": "Uncharged Usage Usd"
          },
          "error_rows": {
            "type": "integer",
            "title": "Error Rows"
          },
          "billed_error_rows": {
            "type": "integer",
            "title": "Billed Error Rows"
          },
          "billed_error_cost_usd": {
            "type": "string",
            "title": "Billed Error Cost Usd"
          },
          "stream_parity_flagged_pairs": {
            "type": "integer",
            "title": "Stream Parity Flagged Pairs"
          },
          "provider_underbilled_models": {
            "type": "integer",
            "title": "Provider Underbilled Models"
          },
          "provider_underbilled_loss_usd": {
            "type": "string",
            "title": "Provider Underbilled Loss Usd"
          },
          "issues_found": {
            "type": "integer",
            "title": "Issues Found"
          }
        },
        "type": "object",
        "required": [
          "day",
          "providers_checked",
          "billable_rows",
          "no_usage_signal_rows",
          "charged_without_usage_rows",
          "charged_without_usage_cost_usd",
          "uncharged_usage_rows",
          "uncharged_usage_usd",
          "error_rows",
          "billed_error_rows",
          "billed_error_cost_usd",
          "stream_parity_flagged_pairs",
          "provider_underbilled_models",
          "provider_underbilled_loss_usd",
          "issues_found"
        ],
        "title": "UsageReconcileResult"
      },
      "UsageTimeSeries": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "cost_usd": {
            "type": "string",
            "title": "Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "requests",
          "cost_usd"
        ],
        "title": "UsageTimeSeries"
      },
      "UsedCouponCodesOut": {
        "properties": {
          "coupon_codes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Coupon Codes"
          }
        },
        "type": "object",
        "required": [
          "coupon_codes"
        ],
        "title": "UsedCouponCodesOut"
      },
      "UserDetailSummary": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "key_count": {
            "type": "integer",
            "title": "Key Count"
          },
          "active_key_count": {
            "type": "integer",
            "title": "Active Key Count"
          },
          "api_calls": {
            "type": "integer",
            "title": "Api Calls"
          },
          "total_spent_usd": {
            "type": "string",
            "title": "Total Spent Usd"
          },
          "total_paid_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Paid Usd"
          },
          "balance_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Balance Usd"
          },
          "last_activity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "banned": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Banned"
          },
          "ban_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ban Reason"
          },
          "total_byok_platform_fee_usd": {
            "type": "string",
            "title": "Total Byok Platform Fee Usd",
            "default": "0"
          },
          "month_api_calls": {
            "type": "integer",
            "title": "Month Api Calls",
            "default": 0
          },
          "month_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Month Tokens"
          },
          "month_byok_requests": {
            "type": "integer",
            "title": "Month Byok Requests",
            "default": 0
          },
          "month_byok_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Month Byok Tokens"
          },
          "month_byok_platform_fee_usd": {
            "type": "string",
            "title": "Month Byok Platform Fee Usd",
            "default": "0"
          },
          "cached_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached At"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "display_name",
          "key_count",
          "active_key_count",
          "api_calls",
          "total_spent_usd",
          "balance_usd",
          "last_activity",
          "created_at"
        ],
        "title": "UserDetailSummary"
      },
      "UserRagList": {
        "properties": {
          "users": {
            "items": {
              "$ref": "#/components/schemas/UserRagSummary"
            },
            "type": "array",
            "title": "Users"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "users",
          "total",
          "limit",
          "offset"
        ],
        "title": "UserRagList"
      },
      "UserRagSummary": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "total_files": {
            "type": "integer",
            "title": "Total Files"
          },
          "total_size_bytes": {
            "type": "integer",
            "title": "Total Size Bytes"
          },
          "files_ready": {
            "type": "integer",
            "title": "Files Ready"
          },
          "files_embedded": {
            "type": "integer",
            "title": "Files Embedded"
          },
          "files_failed": {
            "type": "integer",
            "title": "Files Failed"
          },
          "latest_upload_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Upload At"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "total_files",
          "total_size_bytes",
          "files_ready",
          "files_embedded",
          "files_failed",
          "latest_upload_at"
        ],
        "title": "UserRagSummary"
      },
      "UserReservationsOut": {
        "properties": {
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd",
            "description": "Total credit balance in USD."
          },
          "reserved_usd": {
            "type": "string",
            "title": "Reserved Usd",
            "description": "Funds held by in-flight operations, in USD."
          },
          "available_usd": {
            "type": "string",
            "title": "Available Usd",
            "description": "Spendable balance: balance_usd minus reserved_usd."
          },
          "category_totals": {
            "items": {
              "$ref": "#/components/schemas/ReservationCategoryTotal"
            },
            "type": "array",
            "title": "Category Totals",
            "description": "Authoritative reserved totals per category (from Redis)."
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ReservationItem"
            },
            "type": "array",
            "title": "Items",
            "description": "Paginated per-operation breakdown (best-effort)."
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total attributable items across all categories."
          },
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "Page size used."
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "Page offset used."
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Whether more items exist beyond this page."
          }
        },
        "type": "object",
        "required": [
          "balance_usd",
          "reserved_usd",
          "available_usd",
          "total",
          "limit",
          "offset",
          "has_more"
        ],
        "title": "UserReservationsOut",
        "description": "Admin view of a single user's balance split into reserved vs available."
      },
      "UserRoleOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "granted_by_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Granted By Email"
          },
          "revoked_by_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked By Email"
          },
          "granted_by": {
            "type": "string",
            "title": "Granted By"
          },
          "granted_at": {
            "type": "string",
            "format": "date-time",
            "title": "Granted At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "revoked_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked By"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "role",
          "granted_by",
          "granted_at"
        ],
        "title": "UserRoleOut"
      },
      "UserSettingsResponse": {
        "properties": {
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Postal Code"
          }
        },
        "type": "object",
        "title": "UserSettingsResponse"
      },
      "UserSummary": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "key_count": {
            "type": "integer",
            "title": "Key Count"
          },
          "active_key_count": {
            "type": "integer",
            "title": "Active Key Count"
          },
          "total_spent_usd": {
            "type": "string",
            "title": "Total Spent Usd"
          },
          "balance_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Balance Usd"
          },
          "last_activity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "key_count",
          "active_key_count",
          "total_spent_usd",
          "created_at"
        ],
        "title": "UserSummary"
      },
      "UsersPage": {
        "properties": {
          "users": {
            "items": {
              "$ref": "#/components/schemas/UserSummary"
            },
            "type": "array",
            "title": "Users"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "available_domains": {
            "items": {
              "$ref": "#/components/schemas/DomainCount"
            },
            "type": "array",
            "title": "Available Domains"
          }
        },
        "type": "object",
        "required": [
          "users",
          "total",
          "limit",
          "offset",
          "available_domains"
        ],
        "title": "UsersPage"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerificationOut": {
        "properties": {
          "verdicts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Verdicts"
          },
          "degraded": {
            "type": "integer",
            "title": "Degraded"
          },
          "last_verified_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Verified At"
          },
          "reconciliation": {
            "$ref": "#/components/schemas/ReconciliationOut"
          },
          "probes": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Probes"
          }
        },
        "type": "object",
        "required": [
          "verdicts",
          "degraded",
          "reconciliation"
        ],
        "title": "VerificationOut"
      },
      "VerifierFindingOut": {
        "properties": {
          "verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verdict"
          },
          "page_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Url"
          },
          "page_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Page Value"
          },
          "compared_to": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compared To"
          },
          "independent": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Independent"
          },
          "degraded": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Degraded"
          },
          "gate_failures": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Gate Failures"
          },
          "trail": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Trail"
          },
          "evidence_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Evidence Ids"
          }
        },
        "type": "object",
        "title": "VerifierFindingOut",
        "description": "WS2: the verifier's verdict attached to a held field \u2014 the\n`held_fields[f]['verifier']` dict the applier writes. Every key optional:\nholds written before the verifier existed (or while it is disabled) carry\nnone of this, and a partial dict must still parse rather than 500 the\nreview page."
      },
      "VersionReport": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "model_ids": {
            "type": "integer",
            "title": "Model Ids"
          },
          "critical": {
            "type": "integer",
            "title": "Critical"
          },
          "warnings": {
            "type": "integer",
            "title": "Warnings"
          }
        },
        "type": "object",
        "required": [
          "version",
          "is_active",
          "model_ids",
          "critical",
          "warnings"
        ],
        "title": "VersionReport"
      },
      "VideoContentItem": {
        "properties": {
          "type": {
            "type": "string",
            "title": "Type",
            "description": "The kind of media: text, image_url, video_url, audio_url or document_url."
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "Prompt text. Several text items are joined together."
          },
          "image_url": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Url",
            "description": "An image, given as {\"url\": ...} \u2014 a public URL or a data URI."
          },
          "video_url": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Url",
            "description": "A video, given as {\"url\": ...} \u2014 a public URL or a data URI."
          },
          "audio_url": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Url",
            "description": "An audio clip, given as {\"url\": ...} \u2014 a public URL or a data URI."
          },
          "document_url": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document Url",
            "description": "A document, given as {\"url\": ...} \u2014 a public URL the model reads for reference. Only some models accept one; the rest refuse the request rather than generating without it."
          },
          "draft_task": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft Task",
            "description": "A draft task to build the finished video from."
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role",
            "description": "What this media is for: first_frame, last_frame, reference_image, reference_video, reference_audio, reference_document, or one of the finer scene_image, source_video and background_audio. Omit it and an image is treated as the first frame, a video as a reference video, audio as reference audio, and a document as a reference document."
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject",
            "description": "Groups several references into one character or object. Items sharing a name form one group, the first image in it is the main view, and @name in your prompt refers to it. 1-64 characters: letters, digits, _ or -."
          },
          "frame_index": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Frame Index",
            "description": "Show this image at an exact frame number, counting from 0 at the start of the video. Only on a reference_image, and only one image per frame."
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 300.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp",
            "description": "Show this image at a moment in the video, in seconds from the start. Only on a reference_image, and only one image per moment."
          }
        },
        "type": "object",
        "required": [
          "type"
        ],
        "title": "VideoContentItem",
        "description": "A single item in the content array.\n\n``type`` is the modality (``text``, ``image_url``, ``video_url``, ``audio_url``,\n``draft_task``); ``role`` is what the model should do with it. The role spellings\ncallers send through ``type`` instead (``refer_image``, ``image_tail``, kling's\nomni slots) stay permanent aliases \u2014 see ``app.providers.video_content``.\n\n``frame_index``/``timestamp`` pin a reference image to one moment of the video;\na pinned image is still forwarded as an ordinary reference to models that\ncannot pin one.\n\n``scene_image``/``source_video``/``background_audio`` NARROW an ordinary reference\nrole, so a model without the finer slot still receives the media as that reference.\n``reference_document`` narrows nothing \u2014 no other holder carries a document \u2014 so a\nmodel that cannot read one refuses the request."
      },
      "VideoEmbeddingUrl": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "VideoEmbeddingUrl"
      },
      "VideoGenerationRequest": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Which model generates the video. Use an id from GET /v1/models."
          },
          "content": {
            "items": {
              "$ref": "#/components/schemas/VideoContentItem"
            },
            "type": "array",
            "title": "Content",
            "description": "Your prompt, plus any images, video or audio the model should work from."
          },
          "previous_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Task Id",
            "description": "Continue from one of your earlier finished videos instead of uploading it again."
          },
          "callback_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Url",
            "description": "We POST the finished task here when the model supports callbacks; a model that does not is refused rather than silently never calling you. Delivery is best effort and is not retried, so keep polling as your fallback."
          },
          "return_last_frame": {
            "type": "boolean",
            "title": "Return Last Frame",
            "description": "Also return a still of the final frame, so you can chain it into the next clip.",
            "default": false
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier",
            "description": "Pick a faster or cheaper processing tier, where the model offers one."
          },
          "execution_expires_after": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Expires After",
            "description": "Seconds before an unfinished task is given up on. Defaults to 48 hours."
          },
          "generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generate Audio",
            "description": "Generate a soundtrack along with the picture."
          },
          "draft": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft",
            "description": "Generate a quick low-resolution preview instead of the finished video."
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution",
            "description": "Output resolution, such as 720p or 1080p, or an exact size like 1280x720 on the models that take one."
          },
          "ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ratio",
            "description": "Aspect ratio, such as 16:9 or 9:16. Use adaptive to follow your input."
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 300.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration",
            "description": "How long the video should be, in seconds."
          },
          "match_source_duration": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Match Source Duration",
            "description": "Make the video as long as the source video you sent, instead of a fixed length. Cannot be combined with duration."
          },
          "fast_pretreatment": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fast Pretreatment",
            "description": "Skip some prompt pre-processing so generation starts sooner."
          },
          "frames": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Frames",
            "description": "Exact number of frames, as an alternative to duration."
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed",
            "description": "Reuse a seed to get a similar result again."
          },
          "camera_fixed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Camera Fixed",
            "description": "Hold the camera still instead of letting it move."
          },
          "watermark": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Watermark",
            "description": "Add the model's watermark to the output."
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised id for the person making the request, used for abuse detection."
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 9.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority",
            "description": "Nudge this task ahead of your other queued tasks."
          },
          "external_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "External Task Id",
            "description": "Your own id for this task, echoed back so you can match it to your records."
          },
          "multi_shot": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Multi Shot",
            "description": "Let the model compose the video as several shots."
          },
          "negative_prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Negative Prompt",
            "description": "What to keep out of the generated video."
          },
          "guidance_scale": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 10.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Guidance Scale",
            "description": "How closely to follow the prompt. Higher stays nearer your wording; lower gives the model more freedom."
          },
          "prompt_extend": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Extend",
            "description": "Let the model expand your prompt with extra detail before it generates."
          },
          "style": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Style",
            "description": "A named visual style, on models that offer them."
          },
          "movement_amplitude": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Movement Amplitude",
            "description": "How much the subjects in frame are allowed to move."
          },
          "bgm": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bgm",
            "description": "Add background music to the generated video."
          },
          "keep_original_sound": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keep Original Sound",
            "description": "Keep the audio from your source video instead of generating new audio."
          },
          "audio_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Type",
            "description": "Which kinds of sound to generate: speech, effects, or both."
          },
          "output_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Format",
            "description": "Container for the returned file. The accepted values are the model's own and the value is passed through unchecked."
          },
          "omni_reference_task_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Omni Reference Task Type",
            "description": "Say up front whether you are generating from references, editing a video, or extending one, so a mismatch is caught when you submit rather than failing later."
          },
          "web_search": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Web Search",
            "description": "Let the model look up current details mentioned in your prompt."
          },
          "bitrate_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bitrate Mode",
            "description": "Encode at a higher bitrate for a cleaner picture and a larger file."
          },
          "num_inference_steps": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Num Inference Steps",
            "description": "How many refinement steps to run. More can improve quality and takes longer."
          },
          "enable_safety_checker": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enable Safety Checker",
            "description": "Run the model's own content check on the result."
          },
          "thinking_level": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Thinking Level",
            "description": "How much the model reasons about your prompt before it starts generating."
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "model",
          "content"
        ],
        "title": "VideoGenerationRequest",
        "example": {
          "callback_url": "https://webhook.site/your-id",
          "content": [
            {
              "text": "A girl holding a fox, the girl opens her eyes and gently looks at the camera.",
              "type": "text"
            },
            {
              "image_url": {
                "url": "https://example.com/reference.png"
              },
              "type": "image_url"
            }
          ],
          "duration": 5,
          "generate_audio": true,
          "model": "byteplus/dreamina-seedance-2-0",
          "ratio": "adaptive",
          "watermark": false
        }
      },
      "VideoPollResult": {
        "properties": {
          "checked": {
            "type": "integer",
            "title": "Checked"
          },
          "settled": {
            "type": "integer",
            "title": "Settled"
          },
          "errors": {
            "type": "integer",
            "title": "Errors"
          },
          "reaped": {
            "type": "integer",
            "title": "Reaped",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "checked",
          "settled",
          "errors"
        ],
        "title": "VideoPollResult"
      },
      "VideoSubmitResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "queued"
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoTaskError"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "content": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoTaskContent"
              },
              {
                "type": "null"
              }
            ]
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ratio"
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration"
          },
          "frames": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Frames"
          },
          "framespersecond": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Framespersecond"
          },
          "generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generate Audio"
          },
          "billed_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Seconds"
          },
          "billed_resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Resolution"
          },
          "billed_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Usd"
          },
          "settled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settled"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "draft": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft"
          },
          "draft_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft Task Id"
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "execution_expires_after": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Expires After"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoTaskUsage"
              },
              {
                "type": "null"
              }
            ]
          },
          "unsupported_params": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unsupported Params"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "VideoSubmitResponse",
        "description": "The submit response, which carries one field retrieval cannot.\n\nMESH-714. `unsupported_params` is the parameters the caller sent that the\nSERVED provider drops \u2014 knowable only at submit, and reconstructing it on a\nlater read would mean persisting it per task. It is on a subclass rather than\non `VideoTaskResponse` because that model is also what the poll and list\npaths return AND what upstream payloads are parsed into, so a field there\nwould appear as a null on responses that can never populate it.\n\nNull (not absent) when nothing was dropped, like every other optional field."
      },
      "VideoTaskContent": {
        "properties": {
          "video_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Url"
          },
          "last_frame_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Frame Url"
          }
        },
        "type": "object",
        "title": "VideoTaskContent"
      },
      "VideoTaskError": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "VideoTaskError"
      },
      "VideoTaskListResponse": {
        "properties": {
          "object": {
            "type": "string",
            "const": "list",
            "title": "Object",
            "default": "list"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/VideoTaskResponse"
            },
            "type": "array",
            "title": "Data"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "data",
          "has_more",
          "total",
          "limit",
          "offset"
        ],
        "title": "VideoTaskListResponse"
      },
      "VideoTaskResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "queued"
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoTaskError"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "content": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoTaskContent"
              },
              {
                "type": "null"
              }
            ]
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution"
          },
          "ratio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ratio"
          },
          "duration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration"
          },
          "frames": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Frames"
          },
          "framespersecond": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Framespersecond"
          },
          "generate_audio": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Generate Audio"
          },
          "billed_seconds": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Seconds"
          },
          "billed_resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Resolution"
          },
          "billed_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billed Usd"
          },
          "settled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settled"
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "draft": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft"
          },
          "draft_task_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Draft Task Id"
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "execution_expires_after": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Execution Expires After"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VideoTaskUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "VideoTaskResponse"
      },
      "VideoTaskUsage": {
        "properties": {
          "completion_tokens": {
            "type": "integer",
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          }
        },
        "type": "object",
        "required": [
          "completion_tokens",
          "total_tokens"
        ],
        "title": "VideoTaskUsage"
      },
      "VideoUrl": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "VideoUrl"
      },
      "VoiceInfo": {
        "properties": {
          "voice_id": {
            "type": "string",
            "title": "Voice Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "brand": {
            "type": "string",
            "title": "Brand"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "gender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gender"
          },
          "preview_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Preview Url"
          }
        },
        "type": "object",
        "required": [
          "voice_id",
          "name",
          "brand"
        ],
        "title": "VoiceInfo",
        "description": "A single TTS voice, normalised across model brands.\n\n``brand`` is the model brand (e.g. ``elevenlabs``, ``hexgrad``,\n``canopylabs``, ``cartesia``) \u2014 the value callers filter the catalog by.\nThe same voice may be available under more than one model.\n\nNOTE: the upstream serving provider (Together / DeepInfra / ElevenLabs) is\ndeliberately NOT exposed here \u2014 it's internal routing detail. Voices are\nidentified publicly by ``brand`` + ``model`` + ``voice_id`` only."
      },
      "VoiceSettings": {
        "properties": {
          "stability": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stability"
          },
          "similarity_boost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Similarity Boost"
          },
          "style": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Style"
          },
          "use_speaker_boost": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Use Speaker Boost"
          },
          "speed": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Speed"
          }
        },
        "type": "object",
        "title": "VoiceSettings"
      },
      "VoicesResponse": {
        "properties": {
          "voices": {
            "items": {
              "$ref": "#/components/schemas/VoiceInfo"
            },
            "type": "array",
            "title": "Voices",
            "default": []
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "default": 0
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated",
            "default": false
          }
        },
        "type": "object",
        "title": "VoicesResponse",
        "description": "Unified voice catalog spanning every TTS provider, optionally brand-filtered."
      },
      "WebSearchRequest": {
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 2000,
            "minLength": 1,
            "title": "Query",
            "description": "The search query."
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Native engine model id. Defaults to the server's configured model.",
            "examples": [
              "perplexity/sonar",
              "perplexity/sonar-pro"
            ]
          },
          "provider": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "native",
                  "tavily"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "Pin a specific engine. Omit to use native-first with Tavily fallback."
          },
          "max_results": {
            "type": "integer",
            "maximum": 20.0,
            "minimum": 1.0,
            "title": "Max Results",
            "description": "Maximum results to return.",
            "default": 5
          },
          "search_depth": {
            "type": "string",
            "enum": [
              "basic",
              "advanced"
            ],
            "title": "Search Depth",
            "description": "Tavily search depth; ignored by the native engine.",
            "default": "basic"
          },
          "include_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Include Domains",
            "description": "Restrict results to these domains."
          },
          "exclude_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Domains",
            "description": "Drop results from these domains."
          },
          "include_answer": {
            "type": "boolean",
            "title": "Include Answer",
            "description": "Ask the engine for a synthesized answer alongside results.",
            "default": false
          },
          "tags": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "description": "Your own labels for this request, echoed back on the usage row and available as a filter and a group-by dimension in the usage API. String keys to string values. Never put personal or sensitive data here \u2014 tags are stored with the usage record and are not redacted.",
            "examples": [
              {
                "env": "prod",
                "feature": "summariser"
              }
            ]
          },
          "safety_identifier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Safety Identifier",
            "description": "A stable, anonymised identifier for the end user making this request, recorded on the usage row and available as a filter and a group-by dimension in the usage API. Supersedes the deprecated `user` field. Use an opaque id, not an email address or a name."
          }
        },
        "type": "object",
        "required": [
          "query"
        ],
        "title": "WebSearchRequest",
        "example": {
          "max_results": 5,
          "query": "latest James Webb telescope discoveries",
          "search_depth": "basic"
        }
      },
      "WebSearchResponse": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query"
          },
          "answer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer"
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/WebSearchResultItem"
            },
            "type": "array",
            "title": "Results"
          },
          "provider": {
            "type": "string",
            "enum": [
              "native",
              "tavily"
            ],
            "title": "Provider"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "query",
          "provider"
        ],
        "title": "WebSearchResponse",
        "example": {
          "provider": "native",
          "query": "latest James Webb telescope discoveries",
          "request_id": "req_01J\u2026",
          "results": [
            {
              "content": "Astronomers using the James Webb Space Telescope\u2026",
              "score": 0.93,
              "title": "JWST spots earliest known galaxy",
              "url": "https://example.com/jwst"
            }
          ]
        }
      },
      "WebSearchResultItem": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "content": {
            "type": "string",
            "title": "Content",
            "default": ""
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "published_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published Date"
          }
        },
        "type": "object",
        "required": [
          "title",
          "url"
        ],
        "title": "WebSearchResultItem"
      },
      "WeightProfileOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "weights": {
            "$ref": "#/components/schemas/WeightVector"
          },
          "default_weights": {
            "$ref": "#/components/schemas/WeightVector"
          },
          "is_override": {
            "type": "boolean",
            "title": "Is Override"
          }
        },
        "type": "object",
        "required": [
          "name",
          "weights",
          "default_weights",
          "is_override"
        ],
        "title": "WeightProfileOut"
      },
      "WeightProfilesOut": {
        "properties": {
          "profiles": {
            "items": {
              "$ref": "#/components/schemas/WeightProfileOut"
            },
            "type": "array",
            "title": "Profiles"
          },
          "default_profile": {
            "type": "string",
            "title": "Default Profile"
          },
          "sum_tolerance": {
            "type": "number",
            "title": "Sum Tolerance"
          }
        },
        "type": "object",
        "required": [
          "profiles",
          "default_profile",
          "sum_tolerance"
        ],
        "title": "WeightProfilesOut"
      },
      "WeightProfilesPatchIn": {
        "properties": {
          "profiles": {
            "additionalProperties": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WeightVector"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Profiles"
          }
        },
        "type": "object",
        "required": [
          "profiles"
        ],
        "title": "WeightProfilesPatchIn"
      },
      "WeightVector": {
        "properties": {
          "q": {
            "type": "number",
            "title": "Q"
          },
          "c": {
            "type": "number",
            "title": "C"
          },
          "l": {
            "type": "number",
            "title": "L"
          }
        },
        "type": "object",
        "required": [
          "q",
          "c",
          "l"
        ],
        "title": "WeightVector"
      },
      "app__routers__admin__CreateKeyRequest": {
        "properties": {
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "default_params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Params"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Meta"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          },
          "model_limits": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Limits"
          },
          "tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Limit"
          },
          "fixed_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fixed Provider"
          }
        },
        "type": "object",
        "required": [
          "owner"
        ],
        "title": "CreateKeyRequest"
      },
      "app__routers__admin__CreateKeyResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          }
        },
        "type": "object",
        "required": [
          "id",
          "key",
          "owner",
          "status",
          "default_model",
          "rpm_limit",
          "rpd_limit"
        ],
        "title": "CreateKeyResponse"
      },
      "app__routers__admin__KeySummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "masked_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Masked Key"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "default_params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Params"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          },
          "model_limits": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Limits"
          },
          "tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Limit"
          },
          "cache_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Enabled"
          },
          "cache_shared": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Shared"
          },
          "routing_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Policy"
          },
          "fixed_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fixed Provider"
          },
          "fixed_provider_enforced": {
            "type": "boolean",
            "title": "Fixed Provider Enforced",
            "default": false
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "owner",
          "email",
          "status",
          "default_model",
          "default_params",
          "rpm_limit",
          "rpd_limit",
          "spend_cap_usd",
          "allowed_models",
          "blocked_models",
          "model_limits",
          "tpm_limit",
          "created_at",
          "updated_at"
        ],
        "title": "KeySummary"
      },
      "app__routers__admin__UpdateKeyRequest": {
        "properties": {
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "default_params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Params"
          },
          "meta": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Meta"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          },
          "model_limits": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Limits"
          },
          "tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Limit"
          },
          "cache_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Enabled"
          },
          "cache_shared": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Shared"
          },
          "routing_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/KeyRoutingPolicyInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "fixed_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fixed Provider"
          }
        },
        "type": "object",
        "title": "UpdateKeyRequest"
      },
      "app__routers__admin_balance_failures__ReconcileResult": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "replayed": {
            "type": "boolean",
            "title": "Replayed"
          },
          "owner": {
            "type": "string",
            "title": "Owner"
          },
          "deducted_usd": {
            "type": "string",
            "title": "Deducted Usd"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "id",
          "replayed",
          "owner",
          "deducted_usd",
          "message"
        ],
        "title": "ReconcileResult"
      },
      "app__routers__admin_test_embeddings__ModelEntry": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "provider_model_id": {
            "type": "string",
            "title": "Provider Model Id"
          },
          "prompt_usd_per_1m": {
            "type": "string",
            "title": "Prompt Usd Per 1M"
          },
          "completion_usd_per_1m": {
            "type": "string",
            "title": "Completion Usd Per 1M"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "provider_model_id",
          "prompt_usd_per_1m",
          "completion_usd_per_1m"
        ],
        "title": "ModelEntry"
      },
      "app__routers__admin_test_responses__ModelEntry": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "responses_provider_model_id": {
            "type": "string",
            "title": "Responses Provider Model Id"
          },
          "prompt_usd_per_1m": {
            "type": "string",
            "title": "Prompt Usd Per 1M"
          },
          "completion_usd_per_1m": {
            "type": "string",
            "title": "Completion Usd Per 1M"
          },
          "context_length": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Length"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "pricing_unit": {
            "type": "string",
            "title": "Pricing Unit",
            "default": "per_1m_tokens"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "default": "USD"
          },
          "modality": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Modality",
            "default": [
              "text"
            ]
          },
          "input_modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Modalities"
          },
          "output_modalities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Modalities"
          },
          "supports_thinking": {
            "type": "boolean",
            "title": "Supports Thinking",
            "default": false
          },
          "supports_completions_api": {
            "type": "boolean",
            "title": "Supports Completions Api",
            "default": false
          },
          "supports_responses_api": {
            "type": "boolean",
            "title": "Supports Responses Api",
            "default": true
          },
          "supports_embeddings": {
            "type": "boolean",
            "title": "Supports Embeddings",
            "default": false
          },
          "supports_batching": {
            "type": "boolean",
            "title": "Supports Batching",
            "default": false
          },
          "supports_tools": {
            "type": "boolean",
            "title": "Supports Tools",
            "default": false
          },
          "supports_structured_output": {
            "type": "boolean",
            "title": "Supports Structured Output",
            "default": false
          },
          "supports_system_prompt": {
            "type": "boolean",
            "title": "Supports System Prompt",
            "default": true
          },
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context Window"
          },
          "request_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Cost"
          },
          "standard_context_threshold": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Standard Context Threshold"
          },
          "long_context_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Input Cost"
          },
          "long_context_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Output Cost"
          },
          "cache_read_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Read Input Cost"
          },
          "cache_write_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write Input Cost"
          },
          "cache_write_1h_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Write 1H Input Cost"
          },
          "long_context_cache_read_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Read Input Cost"
          },
          "long_context_cache_write_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Long Context Cache Write Input Cost"
          },
          "batch_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Input Cost"
          },
          "batch_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Batch Output Cost"
          },
          "training_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Training Cost"
          },
          "fine_tuned_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Input Cost"
          },
          "fine_tuned_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fine Tuned Output Cost"
          },
          "image_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Input Cost"
          },
          "image_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Cost"
          },
          "image_output_size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Output Size"
          },
          "audio_input_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Input Cost"
          },
          "audio_output_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Output Cost"
          },
          "transcription_cost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcription Cost"
          },
          "priority": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "responses_provider_model_id",
          "prompt_usd_per_1m",
          "completion_usd_per_1m"
        ],
        "title": "ModelEntry"
      },
      "app__routers__auto_router_catalog_drift__FindingReport": {
        "properties": {
          "model_id": {
            "type": "string",
            "title": "Model Id"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "severity": {
            "type": "string",
            "title": "Severity"
          },
          "detail": {
            "type": "string",
            "title": "Detail"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Sources"
          },
          "refs": {
            "items": {
              "$ref": "#/components/schemas/RefReport"
            },
            "type": "array",
            "title": "Refs"
          }
        },
        "type": "object",
        "required": [
          "model_id",
          "kind",
          "severity",
          "detail",
          "active"
        ],
        "title": "FindingReport"
      },
      "app__routers__auto_router_liveness__FindingReport": {
        "properties": {
          "strategy": {
            "type": "string",
            "title": "Strategy"
          },
          "severity": {
            "type": "string",
            "title": "Severity"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "detail": {
            "type": "string",
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "strategy",
          "severity",
          "kind",
          "detail"
        ],
        "title": "FindingReport"
      },
      "app__routers__keys__CreateKeyRequest": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm"
          },
          "rpd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd"
          },
          "tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          },
          "model_limits": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Limits"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,5}|(?=[\\d.]{1,13}0*$)\\d{0,5}\\.\\d{0,7}0*$)"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "routing_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/KeyRoutingPolicyInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "routing_policy_template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Policy Template Id"
          },
          "api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Version"
          },
          "pii_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PiiPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "body_log_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BodyLogPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "fixed_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fixed Provider"
          }
        },
        "type": "object",
        "title": "CreateKeyRequest"
      },
      "app__routers__keys__CreateKeyResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "key",
          "label",
          "status",
          "default_model",
          "created_at"
        ],
        "title": "CreateKeyResponse"
      },
      "app__routers__keys__KeySummary": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "masked_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Masked Key"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "rpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm Limit"
          },
          "rpd_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd Limit"
          },
          "tpm_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm Limit"
          },
          "effective_rpm_limit": {
            "type": "integer",
            "title": "Effective Rpm Limit"
          },
          "effective_rpd_limit": {
            "type": "integer",
            "title": "Effective Rpd Limit"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          },
          "model_limits": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Limits"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "creator_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator Name"
          },
          "creator_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creator Email"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "routing_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Policy"
          },
          "routing_policy_template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Policy Template Id"
          },
          "routing_policy_template_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Policy Template Name"
          },
          "api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Version"
          },
          "pii_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pii Policy"
          },
          "pii_policy_enforced": {
            "type": "boolean",
            "title": "Pii Policy Enforced",
            "default": false
          },
          "body_log_policy": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body Log Policy"
          },
          "body_log_policy_enforced": {
            "type": "boolean",
            "title": "Body Log Policy Enforced",
            "default": false
          },
          "fixed_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fixed Provider"
          },
          "fixed_provider_enforced": {
            "type": "boolean",
            "title": "Fixed Provider Enforced",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "status",
          "default_model",
          "rpm_limit",
          "rpd_limit",
          "tpm_limit",
          "effective_rpm_limit",
          "effective_rpd_limit",
          "allowed_models",
          "blocked_models",
          "model_limits",
          "org_id",
          "team_id",
          "created_by",
          "created_at"
        ],
        "title": "KeySummary"
      },
      "app__routers__keys__UpdateKeyRequest": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "default_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Model"
          },
          "rpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpm"
          },
          "rpd": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rpd"
          },
          "tpm": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tpm"
          },
          "allowed_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Models"
          },
          "blocked_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "type": "array",
                "maxItems": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Blocked Models"
          },
          "model_limits": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Limits"
          },
          "spend_cap_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^(?!^[-+.]*$)[+-]?0*(?:\\d{0,5}|(?=[\\d.]{1,13}0*$)\\d{0,5}\\.\\d{0,7}0*$)"
              },
              {
                "type": "null"
              }
            ],
            "title": "Spend Cap Usd"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "routing_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/KeyRoutingPolicyInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "routing_policy_template_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Routing Policy Template Id"
          },
          "api_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Version"
          },
          "pii_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PiiPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "body_log_policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BodyLogPolicy"
              },
              {
                "type": "null"
              }
            ]
          },
          "fixed_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fixed Provider"
          }
        },
        "type": "object",
        "title": "UpdateKeyRequest"
      },
      "app__routers__orgs__UsageSummary": {
        "properties": {
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "type": "string",
            "title": "Total Cost Usd"
          }
        },
        "type": "object",
        "required": [
          "total_requests",
          "total_tokens",
          "total_cost_usd"
        ],
        "title": "UsageSummary"
      },
      "app__routers__pricing_admin__CoverageOut": {
        "properties": {
          "rows_total": {
            "type": "integer",
            "title": "Rows Total"
          },
          "rows_active": {
            "type": "integer",
            "title": "Rows Active"
          },
          "rows_unpriced": {
            "type": "integer",
            "title": "Rows Unpriced"
          },
          "rows_primary_priced": {
            "type": "integer",
            "title": "Rows Primary Priced"
          },
          "rows_token_partial": {
            "type": "integer",
            "title": "Rows Token Partial"
          },
          "priced_fields": {
            "type": "integer",
            "title": "Priced Fields"
          },
          "sourced_fields": {
            "type": "integer",
            "title": "Sourced Fields"
          },
          "primary_coverage_pct": {
            "type": "number",
            "title": "Primary Coverage Pct"
          },
          "sourced_pct": {
            "type": "number",
            "title": "Sourced Pct"
          },
          "by_class": {
            "items": {
              "$ref": "#/components/schemas/ClassCoverageOut"
            },
            "type": "array",
            "title": "By Class"
          }
        },
        "type": "object",
        "required": [
          "rows_total",
          "rows_active",
          "rows_unpriced",
          "rows_primary_priced",
          "rows_token_partial",
          "priced_fields",
          "sourced_fields",
          "primary_coverage_pct",
          "sourced_pct",
          "by_class"
        ],
        "title": "CoverageOut"
      },
      "app__routers__provider_metadata__CoverageOut": {
        "properties": {
          "total_rows": {
            "type": "integer",
            "title": "Total Rows"
          },
          "rows_by_source": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Rows By Source"
          },
          "mapped_rows": {
            "type": "integer",
            "title": "Mapped Rows"
          },
          "unmapped_rows": {
            "type": "integer",
            "title": "Unmapped Rows"
          },
          "unmapped_slugs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Unmapped Slugs"
          },
          "providers_without_metadata": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Providers Without Metadata"
          },
          "dangling_mesh_providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Dangling Mesh Providers"
          }
        },
        "type": "object",
        "required": [
          "total_rows",
          "rows_by_source",
          "mapped_rows",
          "unmapped_rows",
          "unmapped_slugs",
          "providers_without_metadata",
          "dangling_mesh_providers"
        ],
        "title": "CoverageOut",
        "description": "How complete the registry is \u2014 the honest version.\n\nDeliberately reports three separate gaps that a single naive\n`JOIN model_pricing ON provider = provider_slug` would blur into one wrong\nnumber."
      },
      "app__routers__reconcile__ReconcileResult": {
        "properties": {
          "checked": {
            "type": "integer",
            "title": "Checked"
          },
          "drifted": {
            "type": "integer",
            "title": "Drifted"
          },
          "total_discrepancy_usd": {
            "type": "string",
            "title": "Total Discrepancy Usd"
          },
          "actionable": {
            "type": "integer",
            "title": "Actionable"
          },
          "actionable_discrepancy_usd": {
            "type": "string",
            "title": "Actionable Discrepancy Usd"
          },
          "legacy": {
            "type": "integer",
            "title": "Legacy"
          },
          "partial_history": {
            "type": "integer",
            "title": "Partial History"
          },
          "rounding": {
            "type": "integer",
            "title": "Rounding"
          }
        },
        "type": "object",
        "required": [
          "checked",
          "drifted",
          "total_discrepancy_usd",
          "actionable",
          "actionable_discrepancy_usd",
          "legacy",
          "partial_history",
          "rounding"
        ],
        "title": "ReconcileResult"
      },
      "app__usage__analytics__UsageSummary": {
        "properties": {
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests"
          },
          "prompt_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Tokens"
          },
          "completion_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completion Tokens"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "total_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost Usd"
          },
          "total_platform_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Platform Fee Usd"
          },
          "total_byok_platform_fee_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Byok Platform Fee Usd"
          },
          "total_byok_cost_usd": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Byok Cost Usd"
          },
          "total_byok_requests": {
            "type": "integer",
            "title": "Total Byok Requests",
            "default": 0
          },
          "total_platform_requests": {
            "type": "integer",
            "title": "Total Platform Requests",
            "default": 0
          },
          "total_byok_tokens": {
            "type": "integer",
            "title": "Total Byok Tokens",
            "default": 0
          },
          "total_platform_tokens": {
            "type": "integer",
            "title": "Total Platform Tokens",
            "default": 0
          },
          "by_model": {
            "items": {
              "$ref": "#/components/schemas/ModelBreakdown"
            },
            "type": "array",
            "title": "By Model"
          },
          "by_model_total": {
            "type": "integer",
            "title": "By Model Total",
            "default": 0
          },
          "by_tag": {
            "items": {
              "$ref": "#/components/schemas/TagBreakdown"
            },
            "type": "array",
            "title": "By Tag"
          },
          "by_tag_total": {
            "type": "integer",
            "title": "By Tag Total",
            "default": 0
          },
          "cached_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cached At"
          }
        },
        "type": "object",
        "required": [
          "total_requests",
          "successful_requests",
          "error_requests",
          "prompt_tokens",
          "completion_tokens",
          "total_tokens",
          "total_cost_usd",
          "by_model"
        ],
        "title": "UsageSummary"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Enter your MeshAPI key (`rsk_...`) or, for the admin-keys endpoints, a dashboard session token \u2014 sent as `Authorization: Bearer <token>`."
      }
    }
  },
  "servers": [
    {
      "url": "https://api.meshapi.ai"
    }
  ],
  "x-mesh-api-versions": [
    {
      "label": "2026-08",
      "status": "ga",
      "released": "2026-08-15",
      "deprecated_on": null,
      "sunset_on": null,
      "notes_url": null,
      "baseline": true,
      "latest": false
    },
    {
      "label": "2026-09",
      "status": "ga",
      "released": "2026-09-03",
      "deprecated_on": null,
      "sunset_on": null,
      "notes_url": null,
      "baseline": false,
      "latest": true
    }
  ],
  "x-enable-proxy": false,
  "security": [
    {
      "BearerAuth": []
    }
  ]
}
