{
    "info": {
        "description": "REST API for management of Baseten resources",
        "title": "Baseten management API",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.baseten.co"
        }
    ],
    "security": [
        {
            "BearerAuth": []
        }
    ],
    "paths": {
        "/v1/volumes": {
            "get": {
                "summary": "Gets the volumes in a namespace",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'namespace': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns one row per volume in the namespace, each with its tags, head version, version counts, and any scheduled expiry. Pass namespace to choose the namespace, which is required because the volume service has no cross-namespace inventory. Versions live on the versions sub-resource, so this response stays a fixed size per volume no matter how long a volume's history is. A volume with no live versions left, whether deleted or expired, is not listed.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of volumes to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "namespace",
                        "in": "query",
                        "required": true,
                        "description": "Namespace to list volumes in. Required, because the volume service has no cross-namespace inventory.",
                        "schema": {
                            "title": "Namespace",
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListVolumesResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/volumes/token": {
            "post": {
                "summary": "Creates a volume access token",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/volumes/token \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scopes\": null,\n  \"namespaces\": null,\n  \"volumes\": null,\n  \"correlation_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/token\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scopes': None, 'namespaces': None, 'volumes': None, 'correlation_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Exchanges your API key for a short-lived token that authenticates against Baseten volume storage. A volume token is needed only to push and pull volume data; other volume operations use your API key directly. Tokens expire after one hour and cannot be renewed; exchange again for a fresh token. Push and tag capabilities require organization-level model management permission. Pass correlation_id to link the issued token to a client operation in server logs.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateVolumeTokenRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateVolumeTokenResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/volumes/namespaces": {
            "get": {
                "summary": "Gets the volume namespaces in your workspace",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes/namespaces \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/namespaces\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the namespaces that hold volumes your API key can read, in lowercase. Namespaces are not created directly: a namespace comes into existence when the first volume is pushed into it.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of namespaces to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListVolumeNamespacesResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/volumes/syncs": {
            "get": {
                "summary": "Lists volume syncs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes/syncs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/syncs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'ref': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists volume syncs in the active workspace, newest first. Results may be narrowed by an exact destination ref.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "ref",
                        "in": "query",
                        "required": false,
                        "description": "Exact destination reference to match.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Ref"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VolumeSyncsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Starts a volume sync",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/volumes/syncs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"source\": null,\n  \"destination\": {\n    \"ref\": null\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/syncs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'source': None, 'destination': {'ref': None}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Starts one durable asynchronous transfer from a remote source into a BDN volume.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateVolumeSyncRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VolumeSyncV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/volumes/syncs/{volume_sync_id}": {
            "get": {
                "summary": "Gets a volume sync",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes/syncs/{volume_sync_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/syncs/{volume_sync_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VolumeSyncV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_sync_id"
                }
            ]
        },
        "/v1/volumes/syncs/{volume_sync_id}/cancel": {
            "post": {
                "summary": "Cancels a volume sync",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/volumes/syncs/{volume_sync_id}/cancel \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/syncs/{volume_sync_id}/cancel\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Requests cancellation of a pending or running sync. Repeated cancellation and cancellation of terminal syncs return the existing state. Once cancellation is accepted, a later completion callback cannot replace the CANCELED state.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VolumeSyncV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_sync_id"
                }
            ]
        },
        "/v1/volumes/{volume_namespace}/{volume_name}": {
            "delete": {
                "summary": "Deletes a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"expected_sequence\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={'expected_sequence': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes every live version of the volume, after which the volume stops appearing in listings. The data is not erased: each version stays restorable until its recovery deadline passes, and the versions sub-resource still reports them when you pass include_tombstoned. Deleting a volume that has no live versions left succeeds and reports zero versions deleted.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DeleteVolumeRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeleteVolumeResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                }
            ],
            "get": {
                "summary": "Gets a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a volume with its tags, head version, version counts, and any scheduled expiry. Versions live on the versions sub-resource so they can be paged separately. A volume whose versions have all been deleted or have expired is still returned, with zero live versions.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VolumeV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/volumes/{volume_namespace}/{volume_name}/versions": {
            "get": {
                "summary": "Gets the versions of a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns every live version of the volume, newest first, each with its digest, size, lifecycle, the tags pointing at it, and any scheduled expiry. Pass include_tombstoned to list deleted and expired versions alongside them.",
                "parameters": [
                    {
                        "name": "include_tombstoned",
                        "in": "query",
                        "required": false,
                        "description": "Whether to include deleted and expired versions. Such a version carries a TOMBSTONED lifecycle and stays restorable until its recovery deadline passes.",
                        "schema": {
                            "default": false,
                            "title": "Include Tombstoned",
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListVolumeVersionsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                }
            ]
        },
        "/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}": {
            "delete": {
                "summary": "Deletes one version of a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"expected_sequence\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={'expected_sequence': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes the version the address names, along with every tag pointing at it. Addressing the version by tag deletes the version the tag points at, not the tag. The data is not erased: the version stays restorable until the recovery deadline in the response passes. Deleting a version that is already deleted is a conflict, not a repeat success.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DeleteVolumeVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeleteVolumeVersionResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                },
                {
                    "$ref": "#/components/parameters/volume_version"
                }
            ],
            "get": {
                "summary": "Gets one version of a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a single version of the volume. Address it with `:<tag>` for a tag, `@<digest>` for a full content digest or a prefix of at least 12 hexadecimal characters, or `head` for the version a reference with no tag or digest resolves to. A digest prefix that matches more than one version is rejected: supply more characters.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VolumeVersionDetailV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}/restore": {
            "post": {
                "summary": "Restores a deleted or expired version of a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}/restore \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"expected_sequence\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/versions/{volume_version}/restore\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'expected_sequence': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a deleted or expired version to service, provided its recovery deadline has not passed. The tags the version carried are not restored with it, so re-tag it if anything depended on those, and a restored version never expires until something sets a new expiry. Address the version by digest: a tombstoned version has no tags left to name it by.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RestoreVolumeVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RestoreVolumeVersionResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                },
                {
                    "$ref": "#/components/parameters/volume_version"
                }
            ]
        },
        "/v1/token": {
            "post": {
                "summary": "Creates a sandbox access token",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/token \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scopes\": [\n    \"sandboxes\"\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/token\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scopes': ['sandboxes']}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Exchanges your Baseten credentials for a short-lived token that authenticates against the sandbox API. The token carries every team you belong to. Tokens expire after two hours and cannot be renewed; request a new one when needed. This endpoint is experimental and may change or be removed without notice.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateTokenRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TokenV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/secrets": {
            "get": {
                "summary": "Gets all secrets (metadata only, no plain text keys)",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/secrets \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/secrets\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SecretsV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Upserts a secret",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/secrets \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my_secret\",\n  \"value\": \"my_secret_value\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/secrets\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'my_secret', 'value': 'my_secret_value'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates or updates a secret by name. Scoped to the caller's primary team; use the team-scoped variant to target a specific team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpsertSecretRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SecretV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/secrets/{secret_name}": {
            "delete": {
                "summary": "Deletes a secret by name",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/secrets/{secret_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/secrets/{secret_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a secret by name in the specified team, or in the caller's organization default team when no team is specified.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SecretTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/secret_name"
                }
            ]
        },
        "/v1/teams/{team_id}/secrets": {
            "get": {
                "summary": "Gets all secrets for a team (metadata only, no plain text keys)",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/secrets \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/secrets\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SecretsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ],
            "post": {
                "summary": "Upserts a secret in a team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/secrets \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my_secret\",\n  \"value\": \"my_secret_value\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/secrets\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'my_secret', 'value': 'my_secret_value'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new secret or updates an existing secret if one with the provided name already exists. The name and creation date of the created or updated secret is returned. This secret belongs to the specified team",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpsertSecretRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SecretV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/secrets/{secret_name}": {
            "delete": {
                "summary": "Deletes a secret by name",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/teams/{team_id}/secrets/{secret_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/secrets/{secret_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a secret by name in the specified team, or in the caller's organization default team when no team is specified.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SecretTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                },
                {
                    "$ref": "#/components/parameters/secret_name"
                }
            ]
        },
        "/v1/environment_groups": {
            "get": {
                "summary": "Lists environment groups",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/environment_groups \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/environment_groups\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists environment groups. The team-scoped path targets the team in the path; the top-level path targets the caller's organization default team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentGroupsV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/environment_groups/{env_name}": {
            "get": {
                "summary": "Gets an environment group by name",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/environment_groups/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/environment_groups/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a single environment group by name. The team-scoped path targets the team in the path; the top-level path targets the caller's organization default team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentGroupV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ],
            "patch": {
                "summary": "Updates an environment group's restriction settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/environment_groups/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"manage_access\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/environment_groups/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'manage_access': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Sets whether the environment is restricted and replaces the list of users granted manage access. The team-scoped path targets the team in the path; the top-level path targets the caller's organization default team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateEnvironmentGroupRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentGroupV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/environment_groups": {
            "get": {
                "summary": "Lists environment groups",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/environment_groups \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/environment_groups\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists environment groups. The team-scoped path targets the team in the path; the top-level path targets the caller's organization default team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentGroupsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/teams/{team_id}/environment_groups/{env_name}": {
            "get": {
                "summary": "Gets an environment group by name",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/environment_groups/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/environment_groups/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a single environment group by name. The team-scoped path targets the team in the path; the top-level path targets the caller's organization default team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentGroupV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ],
            "patch": {
                "summary": "Updates an environment group's restriction settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/teams/{team_id}/environment_groups/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"manage_access\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/environment_groups/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'manage_access': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Sets whether the environment is restricted and replaces the list of users granted manage access. The team-scoped path targets the team in the path; the top-level path targets the caller's organization default team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateEnvironmentGroupRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentGroupV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams": {
            "get": {
                "summary": "Lists all teams",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a list of all teams the authenticated user has access to.",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only the team with this exact name, if any.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TeamsV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}": {
            "get": {
                "summary": "Gets a team by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a team the authenticated user has access to.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TeamV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/regions": {
            "get": {
                "summary": "Lists regions available to the organization",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/regions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/regions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the regions available for new deployments in the caller's organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RegionsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/teams/{team_id}/regions": {
            "get": {
                "summary": "Lists regions available to a team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/regions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/regions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the regions the team specified in the path can place deployments in.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RegionsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/instance_types": {
            "get": {
                "summary": "Gets all available instance types",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/instance_types \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/instance_types\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InstanceTypesV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/user_config": {
            "get": {
                "summary": "Gets the caller's Loops user config",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/user_config \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/user_config\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the caller's Loops user config (per-user accelerator priorities). Null fields mean 'inherit the org-level allowlist'.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsUserConfigResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Patches the caller's Loops user config",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/loops/user_config \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"trainer_accelerator_priority\": [\n    \"H100\",\n    \"H200\"\n  ],\n  \"sampler_accelerator_priority\": [\n    \"H100\",\n    \"H200\"\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/user_config\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'trainer_accelerator_priority': ['H100', 'H200'], 'sampler_accelerator_priority': ['H100', 'H200']}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the caller's Loops user config using JSON Merge Patch (RFC 7396) semantics per field: omit a field to leave it unchanged, send null to clear (inherit the org-level allowlist), or send a list to set the allowlist. Empty lists are rejected.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PatchLoopsUserConfigRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PatchLoopsUserConfigResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/instance_type_prices": {
            "get": {
                "summary": "Gets prices for available instance types",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/instance_type_prices \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/instance_type_prices\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InstanceTypePricesV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/prepare_model_upload": {
            "post": {
                "summary": "Validates a model push payload and issues upload credentials",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/prepare_model_upload \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"deployment\": {\n    \"config\": null,\n    \"raw_config\": null,\n    \"user_env\": null,\n    \"environment_name\": null,\n    \"region\": null,\n    \"deploy_timeout_minutes\": null,\n    \"deployment_name\": null,\n    \"labels\": null\n  },\n  \"name\": null,\n  \"team_id\": null,\n  \"model_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/prepare_model_upload\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'deployment': {'config': None, 'raw_config': None, 'user_env': None, 'environment_name': None, 'region': None, 'deploy_timeout_minutes': None, 'deployment_name': None, 'labels': None}, 'name': None, 'team_id': None, 'model_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PrepareModelUploadRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PrepareModelUploadResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/audit_logs": {
            "get": {
                "summary": "Gets the audit log for the workspace",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/audit_logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/audit_logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'direction': 'DESC', 'search': None, 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns audit-log entries across the workspace, newest first, covering models, chains, and workspace-level actions. Use the filters to narrow by event type, actor, resource, environment, source, or time window, and the cursor to page. In workspaces with multiple teams, only organization admins can read the workspace audit log.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of entries to return per page. Defaults to 20, and must be between 1 and 200.",
                        "schema": {
                            "default": 20,
                            "maximum": 200,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order by the time the action occurred. Defaults to DESC (newest first). Ignored when paginating with a cursor.",
                        "schema": {
                            "$ref": "#/components/schemas/AuditLogSortDirectionV1",
                            "default": "DESC"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Case-insensitive substring matched against resource names and IDs in the entry.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search"
                        }
                    },
                    {
                        "name": "event_type_groups",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries whose event type falls in one of these groups.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/AuditLogEventTypeGroupV1"
                            },
                            "title": "Event Type Groups",
                            "type": "array"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries whose acting user is one of these IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "User Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "deployment_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries referencing one of these model deployment IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Deployment Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "chain_deployment_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries referencing one of these chain deployment IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Chain Deployment Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "environment_names",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries for one of these environments.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Environment Names",
                            "type": "array"
                        }
                    },
                    {
                        "name": "sources",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries issued from one of these surfaces.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/AuditLogSourceV1"
                            },
                            "title": "Sources",
                            "type": "array"
                        }
                    },
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds for the start of the window. Defaults to the beginning of the audit-log history.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds for the end of the window. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListAuditLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models": {
            "get": {
                "summary": "Gets all models",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only models with this exact name, if any. On a team-scoped route this matches at most one model; on the org-wide route it may match models in multiple teams, since names are unique only within a team.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelsV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a new model from a source",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"source\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'source': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new model in the caller's organization. The `source` field selects how the model is constructed (currently `library_listing`, which forks an accessible listing from `GET /v1/library_models`). The deployment isn't instantly ready; poll the GET endpoint until status is ACTIVE.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreatedModelDeploymentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/models": {
            "get": {
                "summary": "Gets all models",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only models with this exact name, if any. On a team-scoped route this matches at most one model; on the org-wide route it may match models in multiple teams, since names are unique only within a team.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ],
            "post": {
                "summary": "Creates a new model from a source",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"source\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'source': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new model in the caller's organization. The `source` field selects how the model is constructed (currently `library_listing`, which forks an accessible listing from `GET /v1/library_models`). The deployment isn't instantly ready; poll the GET endpoint until status is ACTIVE.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreatedModelDeploymentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models/{model_id}": {
            "delete": {
                "summary": "Deletes a model by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ],
            "get": {
                "summary": "Gets a model by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a model by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my-model\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'name': 'my-model'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the mutable fields of a model and returns the updated model. Renaming does not change the model ID, endpoints, or deployments. Pushes that still use the old model_name create another model or target a model that now uses that name, so update config.yaml after renaming.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models/{model_id}/audit_logs": {
            "get": {
                "summary": "Gets the audit log for a model",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/audit_logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/audit_logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'direction': 'DESC', 'search': None, 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns audit-log entries for a single model, newest first. Use the filters to narrow by event type, actor, deployment, environment, source, or time window, and the cursor to page.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of entries to return per page. Defaults to 20, and must be between 1 and 200.",
                        "schema": {
                            "default": 20,
                            "maximum": 200,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order by the time the action occurred. Defaults to DESC (newest first). Ignored when paginating with a cursor.",
                        "schema": {
                            "$ref": "#/components/schemas/AuditLogSortDirectionV1",
                            "default": "DESC"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Case-insensitive substring matched against resource names and IDs in the entry.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search"
                        }
                    },
                    {
                        "name": "event_type_groups",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries whose event type falls in one of these groups.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/AuditLogEventTypeGroupV1"
                            },
                            "title": "Event Type Groups",
                            "type": "array"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries whose acting user is one of these IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "User Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "deployment_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries referencing one of these model deployment IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Deployment Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "chain_deployment_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries referencing one of these chain deployment IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Chain Deployment Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "environment_names",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries for one of these environments.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Environment Names",
                            "type": "array"
                        }
                    },
                    {
                        "name": "sources",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries issued from one of these surfaces.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/AuditLogSourceV1"
                            },
                            "title": "Sources",
                            "type": "array"
                        }
                    },
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds for the start of the window. Defaults to the beginning of the audit-log history.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds for the end of the window. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListAuditLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments": {
            "get": {
                "summary": "Gets all deployments of a model",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only the deployment with this exact name, if any.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ],
            "post": {
                "summary": "Adds a new deployment to a model",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"source\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'source': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateModelDeploymentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreatedModelDeploymentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models/{model_id}/deployments/development": {
            "get": {
                "summary": "Gets a model's development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a model's development deployment and returns the deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/production": {
            "get": {
                "summary": "Gets a model's production deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/production \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/production\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a model's production deployment and returns the deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}": {
            "delete": {
                "summary": "Deletes a model's deployment by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a model's deployment by ID and returns the tombstone of the deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ],
            "get": {
                "summary": "Gets a model's deployment by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a model's deployment by ID and returns the deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a model's deployment by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my-deployment\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'name': 'my-deployment'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the mutable fields of a deployment and returns the updated deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateDeploymentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models/{model_id}/deployments/development/autoscaling_settings": {
            "patch": {
                "summary": "Updates a development deployment's autoscaling settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/autoscaling_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"min_replica\": 0,\n  \"max_replica\": 7,\n  \"autoscaling_window\": 600,\n  \"scale_down_delay\": 120,\n  \"concurrency_target\": 2,\n  \"target_utilization_percentage\": 70,\n  \"target_in_flight_tokens\": 40000,\n  \"max_scale_down_rate\": 20\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/autoscaling_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'min_replica': 0, 'max_replica': 7, 'autoscaling_window': 600, 'scale_down_delay': 120, 'concurrency_target': 2, 'target_utilization_percentage': 70, 'target_in_flight_tokens': 40000, 'max_scale_down_rate': 20}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a development deployment's autoscaling settings and returns the update status.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateAutoscalingSettingsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/production/autoscaling_settings": {
            "patch": {
                "summary": "Updates a production deployment's autoscaling settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/production/autoscaling_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"min_replica\": 0,\n  \"max_replica\": 7,\n  \"autoscaling_window\": 600,\n  \"scale_down_delay\": 120,\n  \"concurrency_target\": 2,\n  \"target_utilization_percentage\": 70,\n  \"target_in_flight_tokens\": 40000,\n  \"max_scale_down_rate\": 20\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/production/autoscaling_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'min_replica': 0, 'max_replica': 7, 'autoscaling_window': 600, 'scale_down_delay': 120, 'concurrency_target': 2, 'target_utilization_percentage': 70, 'target_in_flight_tokens': 40000, 'max_scale_down_rate': 20}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a production deployment's autoscaling settings and returns the update status.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateAutoscalingSettingsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/autoscaling_settings": {
            "patch": {
                "summary": "Updates a deployment's autoscaling settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/autoscaling_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"min_replica\": 0,\n  \"max_replica\": 7,\n  \"autoscaling_window\": 600,\n  \"scale_down_delay\": 120,\n  \"concurrency_target\": 2,\n  \"target_utilization_percentage\": 70,\n  \"target_in_flight_tokens\": 40000,\n  \"max_scale_down_rate\": 20\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/autoscaling_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'min_replica': 0, 'max_replica': 7, 'autoscaling_window': 600, 'scale_down_delay': 120, 'concurrency_target': 2, 'target_utilization_percentage': 70, 'target_in_flight_tokens': 40000, 'max_scale_down_rate': 20}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a deployment's autoscaling settings and returns the update status.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateAutoscalingSettingsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/request_backpressure_settings": {
            "patch": {
                "summary": "Updates a deployment's request backpressure settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/request_backpressure_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"policy\": \"REJECT_ON_FULL\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/request_backpressure_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'policy': 'REJECT_ON_FULL'}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateRequestBackpressureSettingsV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RequestBackpressureSettingsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/development/promote": {
            "post": {
                "summary": "Promotes a development deployment to production",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_production\": true,\n  \"preserve_env_instance_type\": true\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_production': True, 'preserve_env_instance_type': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new production deployment from the development deployment and returns the deployment that is building.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/promote": {
            "post": {
                "summary": "Promotes a deployment to production",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_production\": true,\n  \"preserve_env_instance_type\": true\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_production': True, 'preserve_env_instance_type': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Promotes an existing deployment to production and returns the same deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/development/activate": {
            "post": {
                "summary": "Activates a development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/activate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/activate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Activates a development deployment if not already activated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ActivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/production/activate": {
            "post": {
                "summary": "Activates a production deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/production/activate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/production/activate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Activates a production deployment if not already activated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ActivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/activate": {
            "post": {
                "summary": "Activates a deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/activate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/activate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Activates a deployment if not already activated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ActivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/development/deactivate": {
            "post": {
                "summary": "Deactivates a development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deactivates a development deployment if not already deactivated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/production/deactivate": {
            "post": {
                "summary": "Deactivates a production deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/production/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/production/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deactivates a production deployment if not already deactivated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/deactivate": {
            "post": {
                "summary": "Deactivates a deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deactivates a deployment if not already deactivated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/development/retry": {
            "post": {
                "summary": "Retries a failed development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/retry \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/retry\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Retries a failed development deployment and returns the retry status and updated deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RetryDeploymentResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/production/retry": {
            "post": {
                "summary": "Retries a failed production deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/production/retry \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/production/retry\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Retries a failed production deployment and returns the retry status and updated deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RetryDeploymentResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/retry": {
            "post": {
                "summary": "Retries a failed deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/retry \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/retry\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Retries a failed deployment and returns the retry status and updated deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RetryDeploymentResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/download": {
            "get": {
                "summary": "Gets a presigned download URL for a deployment's truss",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/download \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/download\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a presigned URL to download the truss tar file for a deployment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DownloadDeploymentResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/config": {
            "get": {
                "summary": "Gets a deployment's config",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/config \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/config\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'output_format': 'raw'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the deployment's config. `output_format` query param picks the shape: 'raw' (config.yaml text), 'parsed' (dict with defaults), or 'both' (default).",
                "parameters": [
                    {
                        "name": "output_format",
                        "in": "query",
                        "required": false,
                        "description": "'raw': verbatim config.yaml with comments (not available for deployments created before 2026-04-30). 'parsed': dict with server-side defaults applied (always available). 'both': both fields populated.",
                        "schema": {
                            "$ref": "#/components/schemas/DeploymentConfigOutputFormat",
                            "default": "both"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentConfigResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/logs": {
            "get": {
                "summary": "Gets the logs for a model deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None, 'replica': None, 'request_id': None, 'component': None, 'search_pattern': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets all the logs for a model deployment in the given time range, which defaults to the last 30 minutes. A failed or older deployment may only have logs from before that window; pass `start_epoch_millis` to widen it back to the build/deploy time.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order for logs",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Limit of logs to fetch in a single request",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": 500,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "min_level",
                        "in": "query",
                        "required": false,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/LogLevelV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "replica",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs emitted by this replica (5-char short ID).",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Replica"
                        }
                    },
                    {
                        "name": "request_id",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs tagged with this inference request ID.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Request Id"
                        }
                    },
                    {
                        "name": "component",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs from this component.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Component"
                        }
                    },
                    {
                        "name": "search_pattern",
                        "in": "query",
                        "required": false,
                        "description": "RE2 regular expression matched against the log message. Prefer `includes` and `excludes` for plain substring matches.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search Pattern"
                        }
                    },
                    {
                        "name": "includes",
                        "in": "query",
                        "required": false,
                        "description": "Case-sensitive substrings that must all appear in the log message.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 8,
                            "title": "Includes",
                            "type": "array"
                        }
                    },
                    {
                        "name": "excludes",
                        "in": "query",
                        "required": false,
                        "description": "Case-sensitive substrings; lines containing any of these are dropped.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 8,
                            "title": "Excludes",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ],
            "post": {
                "summary": "Gets the logs for a model deployment (deprecated; use GET)",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"start_epoch_millis\": null,\n  \"end_epoch_millis\": null,\n  \"direction\": null,\n  \"limit\": null,\n  \"min_level\": null,\n  \"replica\": null,\n  \"request_id\": null,\n  \"component\": null,\n  \"search_pattern\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None, 'replica': None, 'request_id': None, 'component': None, 'search_pattern': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Use the GET form on this path instead.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetDeploymentLogsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "deprecated",
                "deprecated": true
            }
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/patches": {
            "post": {
                "summary": "Stages a patch against a development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"prev_patch_hash\": null,\n  \"next_patch_point\": {\n    \"content_hashes\": null,\n    \"config\": null\n  },\n  \"patch_ops\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'prev_patch_hash': None, 'next_patch_point': {'content_hashes': None, 'config': None}, 'patch_ops': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Persists a patch durably without applying it; call the sync endpoint to apply staged patches to the running deployment. The target must be a development deployment (its archive created with `is_development` set to `true`); patching any other deployment is rejected.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateDeploymentPatchRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateDeploymentPatchResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/patches/state": {
            "get": {
                "summary": "Gets a development deployment's patch state",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches/state \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches/state\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the patch point the deployment is recorded as running and the latest staged-but-unsynced point, if any. The watch client computes its next patch off the pending point when present, else the running point.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetDeploymentPatchesStateResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/patches/sync": {
            "post": {
                "summary": "Syncs staged patches to a development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches/sync \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches/sync\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Applies any staged patches to the running deployment. A 2xx response means the sync reached a verdict: in sync, or a full push is required (needs_full_deploy_reason). A 503 means the sync was not attempted or failed recoverably and should be retried; any other error is terminal.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SyncDeploymentPatchesRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SyncDeploymentPatchesResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/metrics": {
            "get": {
                "summary": "Gets the metrics for a model deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/metrics \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/metrics\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'mode': 'CURRENT', 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the metrics for a model deployment in the given time range.",
                "parameters": [
                    {
                        "name": "mode",
                        "in": "query",
                        "required": false,
                        "description": "'CURRENT': a single instantaneous snapshot at now; start/end must be omitted. 'SUMMARY': a single value set aggregating the whole window. 'SERIES': evenly-spaced value sets across the window, with the step derived from the window duration.",
                        "schema": {
                            "$ref": "#/components/schemas/ModelMetricModeV1",
                            "default": "CURRENT"
                        }
                    },
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch millis timestamp to start fetching metrics. Defaults to one hour before the end.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch millis timestamp to end fetching metrics. Defaults to the current time. The window between start and end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "metrics",
                        "in": "query",
                        "required": false,
                        "description": "Names of the metrics to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. When omitted, a default set is returned: baseten_replicas_active, baseten_inference_requests_total, and baseten_end_to_end_response_time_seconds. Unknown names are rejected; valid names that do not apply are omitted from the response.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Metrics",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetModelMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}": {
            "delete": {
                "summary": "Terminates a replica in a deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Terminates a deployment replica and returns the termination status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TerminateReplicaResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                },
                {
                    "$ref": "#/components/parameters/replica_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/ssh/sign": {
            "post": {
                "summary": "Signs an SSH certificate for an inference model",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/ssh/sign \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"public_key\": null,\n  \"replica_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/ssh/sign\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'public_key': None, 'replica_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Signs a short-lived SSH certificate granting access to a running inference model pod. Returns the signed SSH certificate, a JWT token for SSH proxy authentication, the proxy address to connect through, and the certificate expiry time.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SignSSHCertificateRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignSSHCertificateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/environments": {
            "get": {
                "summary": "Gets all environments",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets all environments for a given model.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ],
            "post": {
                "summary": "Creates an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"staging\",\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 800,\n    \"concurrency_target\": 3,\n    \"max_replica\": 2,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 60,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"promotion_settings\": {\n    \"promotion_cleanup_strategy\": null,\n    \"ramp_up_duration_seconds\": 600,\n    \"ramp_up_while_promoting\": true,\n    \"redeploy_on_promotion\": true,\n    \"rolling_deploy\": false,\n    \"rolling_deploy_config\": null\n  },\n  \"request_backpressure_settings\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'staging', 'autoscaling_settings': {'autoscaling_window': 800, 'concurrency_target': 3, 'max_replica': 2, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 60, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'promotion_settings': {'promotion_cleanup_strategy': None, 'ramp_up_duration_seconds': 600, 'ramp_up_while_promoting': True, 'redeploy_on_promotion': True, 'rolling_deploy': False, 'rolling_deploy_config': None}, 'request_backpressure_settings': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates an environment for the specified model and returns the environment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models/{model_id}/environments/{env_name}": {
            "delete": {
                "summary": "Deletes an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes an environment and returns its tombstone. Any in-progress promotion to the environment is canceled, and the deployment currently serving the environment is scaled down to zero replicas rather than deleted. The production environment cannot be deleted.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ],
            "get": {
                "summary": "Gets an environment's details",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets an environment's details and returns the environment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates an environment's settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 800,\n    \"concurrency_target\": 3,\n    \"max_replica\": 2,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 60,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"promotion_settings\": {\n    \"promotion_cleanup_strategy\": null,\n    \"ramp_up_duration_seconds\": 600,\n    \"ramp_up_while_promoting\": true,\n    \"redeploy_on_promotion\": true,\n    \"rolling_deploy\": null,\n    \"rolling_deploy_config\": null\n  },\n  \"autoscaling_schedule_settings\": {\n    \"schedules\": [\n      {\n        \"autoscaling_settings\": {\n          \"autoscaling_window\": null,\n          \"concurrency_target\": null,\n          \"max_replica\": 8,\n          \"max_scale_down_rate\": null,\n          \"min_replica\": 2,\n          \"scale_down_delay\": null,\n          \"target_in_flight_tokens\": null,\n          \"target_utilization_percentage\": null\n        },\n        \"cadence\": \"DAILY\",\n        \"enabled\": true,\n        \"end_hour\": 10,\n        \"end_minute\": 0,\n        \"name\": \"weekday-peak\",\n        \"start_hour\": 8,\n        \"start_minute\": 0,\n        \"weekdays\": [\n          \"MONDAY\",\n          \"TUESDAY\",\n          \"WEDNESDAY\",\n          \"THURSDAY\",\n          \"FRIDAY\"\n        ]\n      }\n    ],\n    \"timezone\": \"America/Los_Angeles\"\n  },\n  \"request_backpressure_settings\": {\n    \"policy\": \"REJECT_ON_FULL\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'autoscaling_settings': {'autoscaling_window': 800, 'concurrency_target': 3, 'max_replica': 2, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 60, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'promotion_settings': {'promotion_cleanup_strategy': None, 'ramp_up_duration_seconds': 600, 'ramp_up_while_promoting': True, 'redeploy_on_promotion': True, 'rolling_deploy': None, 'rolling_deploy_config': None}, 'autoscaling_schedule_settings': {'schedules': [{'autoscaling_settings': {'autoscaling_window': None, 'concurrency_target': None, 'max_replica': 8, 'max_scale_down_rate': None, 'min_replica': 2, 'scale_down_delay': None, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'cadence': 'DAILY', 'enabled': True, 'end_hour': 10, 'end_minute': 0, 'name': 'weekday-peak', 'start_hour': 8, 'start_minute': 0, 'weekdays': ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY']}], 'timezone': 'America/Los_Angeles'}, 'request_backpressure_settings': {'policy': 'REJECT_ON_FULL'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Asynchronously updates an environment's settings. Poll the GET endpoint for the applied state.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateEnvironmentResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/models/{model_id}/environments/{env_name}/logs": {
            "get": {
                "summary": "Gets the logs for a model environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None, 'replica': None, 'request_id': None, 'component': None, 'search_pattern': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets logs across all deployments that were active on the environment in the given time range, which defaults to the last 30 minutes. Pass `start_epoch_millis` to widen the window back to an earlier deployment's build/deploy time.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order for logs",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Limit of logs to fetch in a single request",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": 500,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "min_level",
                        "in": "query",
                        "required": false,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/LogLevelV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "replica",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs emitted by this replica (5-char short ID).",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Replica"
                        }
                    },
                    {
                        "name": "request_id",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs tagged with this inference request ID.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Request Id"
                        }
                    },
                    {
                        "name": "component",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs from this component.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Component"
                        }
                    },
                    {
                        "name": "search_pattern",
                        "in": "query",
                        "required": false,
                        "description": "RE2 regular expression matched against the log message. Prefer `includes` and `excludes` for plain substring matches.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search Pattern"
                        }
                    },
                    {
                        "name": "includes",
                        "in": "query",
                        "required": false,
                        "description": "Case-sensitive substrings that must all appear in the log message.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 8,
                            "title": "Includes",
                            "type": "array"
                        }
                    },
                    {
                        "name": "excludes",
                        "in": "query",
                        "required": false,
                        "description": "Case-sensitive substrings; lines containing any of these are dropped.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 8,
                            "title": "Excludes",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/metrics": {
            "get": {
                "summary": "Gets the metrics for a model environment.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/metrics \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/metrics\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'mode': 'CURRENT', 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets metrics aggregated across every deployment that was active on the environment in the given time range. In series mode the window is split at each promotion so that every point reflects the deployment(s) serving the environment at that time.",
                "parameters": [
                    {
                        "name": "mode",
                        "in": "query",
                        "required": false,
                        "description": "'CURRENT': a single instantaneous snapshot at now; start/end must be omitted. 'SUMMARY': a single value set aggregating the whole window. 'SERIES': evenly-spaced value sets across the window, with the step derived from the window duration.",
                        "schema": {
                            "$ref": "#/components/schemas/ModelMetricModeV1",
                            "default": "CURRENT"
                        }
                    },
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch millis timestamp to start fetching metrics. Defaults to one hour before the end.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch millis timestamp to end fetching metrics. Defaults to the current time. The window between start and end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "metrics",
                        "in": "query",
                        "required": false,
                        "description": "Names of the metrics to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. When omitted, a default set is returned: baseten_replicas_active, baseten_inference_requests_total, and baseten_end_to_end_response_time_seconds. Unknown names are rejected; valid names that do not apply are omitted from the response.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Metrics",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetModelMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/activate": {
            "post": {
                "summary": "Activates a deployment associated with an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/activate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/activate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Activates a deployment associated with an environment if not already activated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ActivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/deactivate": {
            "post": {
                "summary": "Deactivates a deployment associated with an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deactivates a deployment associated with an environment if not already deactivated.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/promote": {
            "post": {
                "summary": "Promotes a deployment to an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_deployment\": true,\n  \"deployment_id\": null,\n  \"preserve_env_instance_type\": true\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_deployment': True, 'deployment_id': None, 'preserve_env_instance_type': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Promotes an existing deployment to an environment and returns the promoted deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteToEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/cancel_promotion": {
            "post": {
                "summary": "Cancels a promotion to an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/cancel_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/cancel_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Cancels an ongoing promotion to an environment and returns the cancellation status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CancelPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/pause_promotion": {
            "post": {
                "summary": "Pauses a rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/pause_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/pause_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Pauses an in-progress rolling promotion after the current step completes. No further scaling changes are made until resumed.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/resume_promotion": {
            "post": {
                "summary": "Resumes a paused rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/resume_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/resume_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Resumes a paused rolling promotion, continuing from where it was paused.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/force_cancel_promotion": {
            "post": {
                "summary": "Force cancels a rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_cancel_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_cancel_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Immediately cancels an in-progress rolling promotion and triggers rollback to the previous version.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/force_roll_forward_promotion": {
            "post": {
                "summary": "Force rolls forward a rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_roll_forward_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_roll_forward_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Immediately completes the rolling promotion, shifting all traffic to the new version. This works even if the promotion is in the process of rolling back.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/chains": {
            "get": {
                "summary": "Gets all chains",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainsV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}": {
            "delete": {
                "summary": "Deletes a chain by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/chains/{chain_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                }
            ],
            "get": {
                "summary": "Gets a chain by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}/audit_logs": {
            "get": {
                "summary": "Gets the audit log for a chain",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id}/audit_logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/audit_logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'direction': 'DESC', 'search': None, 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns audit-log entries for a single chain, newest first. Use the filters to narrow by event type, actor, chain deployment, environment, source, or time window, and the cursor to page.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of entries to return per page. Defaults to 20, and must be between 1 and 200.",
                        "schema": {
                            "default": 20,
                            "maximum": 200,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order by the time the action occurred. Defaults to DESC (newest first). Ignored when paginating with a cursor.",
                        "schema": {
                            "$ref": "#/components/schemas/AuditLogSortDirectionV1",
                            "default": "DESC"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Case-insensitive substring matched against resource names and IDs in the entry.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search"
                        }
                    },
                    {
                        "name": "event_type_groups",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries whose event type falls in one of these groups.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/AuditLogEventTypeGroupV1"
                            },
                            "title": "Event Type Groups",
                            "type": "array"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries whose acting user is one of these IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "User Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "deployment_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries referencing one of these model deployment IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Deployment Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "chain_deployment_ids",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries referencing one of these chain deployment IDs.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Chain Deployment Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "environment_names",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries for one of these environments.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Environment Names",
                            "type": "array"
                        }
                    },
                    {
                        "name": "sources",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only entries issued from one of these surfaces.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/AuditLogSourceV1"
                            },
                            "title": "Sources",
                            "type": "array"
                        }
                    },
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds for the start of the window. Defaults to the beginning of the audit-log history.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds for the end of the window. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListAuditLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                }
            ]
        },
        "/v1/chains/{chain_id}/deployments": {
            "get": {
                "summary": "Gets all chain deployments",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id}/deployments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/deployments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainDeploymentsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                }
            ]
        },
        "/v1/chains/{chain_id}/deployments/{chain_deployment_id}": {
            "delete": {
                "summary": "Deletes a chain deployment by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainDeploymentTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/chain_deployment_id"
                }
            ],
            "get": {
                "summary": "Gets a chain deployment by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainDeploymentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}/deployments/{chain_deployment_id}/deactivate": {
            "post": {
                "summary": "Deactivates a chain deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id}/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id}/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deactivates a chain deployment and returns the deactivation status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/chain_deployment_id"
                }
            ]
        },
        "/v1/chains/{chain_id}/deployments/{chain_deployment_id}/chainlets/{chainlet_id}/logs": {
            "get": {
                "summary": "Gets the logs for a chainlet within a chain deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id}/chainlets/{chainlet_id}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/deployments/{chain_deployment_id}/chainlets/{chainlet_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None, 'replica': None, 'request_id': None, 'component': None, 'search_pattern': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Resolves the chainlet (by ID, scoped to the given chain deployment) to its underlying model deployment and returns its logs in the given time range.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order for logs",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Limit of logs to fetch in a single request",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": 500,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "min_level",
                        "in": "query",
                        "required": false,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/LogLevelV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "replica",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs emitted by this replica (5-char short ID).",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Replica"
                        }
                    },
                    {
                        "name": "request_id",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs tagged with this inference request ID.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Request Id"
                        }
                    },
                    {
                        "name": "component",
                        "in": "query",
                        "required": false,
                        "description": "Only return logs from this component.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Component"
                        }
                    },
                    {
                        "name": "search_pattern",
                        "in": "query",
                        "required": false,
                        "description": "RE2 regular expression matched against the log message. Prefer `includes` and `excludes` for plain substring matches.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maxLength": 256,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search Pattern"
                        }
                    },
                    {
                        "name": "includes",
                        "in": "query",
                        "required": false,
                        "description": "Case-sensitive substrings that must all appear in the log message.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 8,
                            "title": "Includes",
                            "type": "array"
                        }
                    },
                    {
                        "name": "excludes",
                        "in": "query",
                        "required": false,
                        "description": "Case-sensitive substrings; lines containing any of these are dropped.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "maxItems": 8,
                            "title": "Excludes",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/chain_deployment_id"
                },
                {
                    "$ref": "#/components/parameters/chainlet_id"
                }
            ]
        },
        "/v1/chains/{chain_id}/environments": {
            "get": {
                "summary": "Gets all chain environments",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets all chain environments for a given chain.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnvironmentsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                }
            ],
            "post": {
                "summary": "Creates a chain environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"staging\",\n  \"promotion_settings\": {\n    \"promotion_cleanup_strategy\": null,\n    \"ramp_up_duration_seconds\": 600,\n    \"ramp_up_while_promoting\": true,\n    \"redeploy_on_promotion\": true,\n    \"rolling_deploy\": null,\n    \"rolling_deploy_config\": null\n  },\n  \"chainlet_settings\": [\n    {\n      \"autoscaling_settings\": {\n        \"autoscaling_window\": 800,\n        \"concurrency_target\": 4,\n        \"max_replica\": 3,\n        \"max_scale_down_rate\": null,\n        \"min_replica\": 2,\n        \"scale_down_delay\": 63,\n        \"target_in_flight_tokens\": null,\n        \"target_utilization_percentage\": null\n      },\n      \"chainlet_name\": \"HelloWorld\",\n      \"instance_type_id\": \"2x8\"\n    },\n    {\n      \"autoscaling_settings\": {\n        \"autoscaling_window\": null,\n        \"concurrency_target\": null,\n        \"max_replica\": 3,\n        \"max_scale_down_rate\": null,\n        \"min_replica\": 3,\n        \"scale_down_delay\": null,\n        \"target_in_flight_tokens\": null,\n        \"target_utilization_percentage\": null\n      },\n      \"chainlet_name\": \"RandInt\",\n      \"instance_type_id\": \"A10Gx8x32\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'staging', 'promotion_settings': {'promotion_cleanup_strategy': None, 'ramp_up_duration_seconds': 600, 'ramp_up_while_promoting': True, 'redeploy_on_promotion': True, 'rolling_deploy': None, 'rolling_deploy_config': None}, 'chainlet_settings': [{'autoscaling_settings': {'autoscaling_window': 800, 'concurrency_target': 4, 'max_replica': 3, 'max_scale_down_rate': None, 'min_replica': 2, 'scale_down_delay': 63, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'chainlet_name': 'HelloWorld', 'instance_type_id': '2x8'}, {'autoscaling_settings': {'autoscaling_window': None, 'concurrency_target': None, 'max_replica': 3, 'max_scale_down_rate': None, 'min_replica': 3, 'scale_down_delay': None, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'chainlet_name': 'RandInt', 'instance_type_id': 'A10Gx8x32'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a chain environment. Returns the resulting environment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateChainEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainEnvironmentV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}/environments/{env_name}": {
            "get": {
                "summary": "Gets a chain environment's details",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets a chain environment's details and returns the chain environment.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainEnvironmentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ],
            "patch": {
                "summary": "Updates a chain environment's settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"promotion_settings\": {\n    \"promotion_cleanup_strategy\": null,\n    \"ramp_up_duration_seconds\": 600,\n    \"ramp_up_while_promoting\": true,\n    \"redeploy_on_promotion\": null,\n    \"rolling_deploy\": null,\n    \"rolling_deploy_config\": null\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'promotion_settings': {'promotion_cleanup_strategy': None, 'ramp_up_duration_seconds': 600, 'ramp_up_while_promoting': True, 'redeploy_on_promotion': None, 'rolling_deploy': None, 'rolling_deploy_config': None}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a chain environment's settings and returns the chain environment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateChainEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateChainEnvironmentResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}/environments/{env_name}/promote": {
            "post": {
                "summary": "Promotes a chain deployment to an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_deployment\": true,\n  \"deployment_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_deployment': True, 'deployment_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Promotes an existing chain deployment to an environment and returns the promoted chain deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteToChainEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainDeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/chains/{chain_id}/environments/{env_name}/chainlet_settings/autoscaling_settings": {
            "patch": {
                "summary": "Updates a chainlet environment's autoscaling settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}/chainlet_settings/autoscaling_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"updates\": [\n    {\n      \"autoscaling_settings\": {\n        \"autoscaling_window\": 800,\n        \"concurrency_target\": 4,\n        \"max_replica\": 3,\n        \"max_scale_down_rate\": null,\n        \"min_replica\": 2,\n        \"scale_down_delay\": 63,\n        \"target_in_flight_tokens\": null,\n        \"target_utilization_percentage\": null\n      },\n      \"chainlet_name\": \"HelloWorld\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}/chainlet_settings/autoscaling_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'updates': [{'autoscaling_settings': {'autoscaling_window': 800, 'concurrency_target': 4, 'max_replica': 3, 'max_scale_down_rate': None, 'min_replica': 2, 'scale_down_delay': 63, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'chainlet_name': 'HelloWorld'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a chainlet environment's autoscaling settings and returns the updated chainlet environment settings.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateChainletEnvironmentAutoscalingSettingsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateAutoscalingSettingsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/chains/{chain_id}/environments/{env_name}/chainlet_settings/instance_types/update": {
            "post": {
                "summary": "Updates a chainlet environment's instance type settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}/chainlet_settings/instance_types/update \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"updates\": [\n    {\n      \"chainlet_name\": \"HelloWorld\",\n      \"instance_type_id\": \"1x4\"\n    },\n    {\n      \"chainlet_name\": \"RandInt\",\n      \"instance_type_id\": \"A10G:2x24x96\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}/environments/{env_name}/chainlet_settings/instance_types/update\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'updates': [{'chainlet_name': 'HelloWorld', 'instance_type_id': '1x4'}, {'chainlet_name': 'RandInt', 'instance_type_id': 'A10G:2x24x96'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a chainlet environment's instance type settings. The chainlet environment setting must exist. When updated, a new chain deployment is created and deployed. It is promoted to the chain environment according to promotion settings on the environment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateChainletEnvironmentInstanceTypeRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateChainletEnvironmentInstanceTypeResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/teams/{team_id}/training_projects": {
            "post": {
                "summary": "Upserts a training project in a specific team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/training_projects \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"training_project\": {\n    \"name\": \"My Training Project\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/training_projects\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'training_project': {'name': 'My Training Project'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Upserts a training project with the specified metadata for a team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpsertTrainingProjectRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpsertTrainingProjectResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/training_projects": {
            "get": {
                "summary": "Lists training projects",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists all training projects for the organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListTrainingProjectsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Upserts a training project",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"training_project\": {\n    \"name\": \"My Training Project\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'training_project': {'name': 'My Training Project'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Upserts a training project with the specified metadata.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpsertTrainingProjectRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpsertTrainingProjectResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_projects/{training_project_id}/jobs": {
            "get": {
                "summary": "Lists training jobs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists all training jobs for the training project.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListTrainingJobsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                }
            ],
            "post": {
                "summary": "Creates a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"training_job\": {\n    \"image\": {\n      \"base_image\": \"hello-world\",\n      \"docker_auth\": null\n    },\n    \"compute\": {\n      \"node_count\": 1,\n      \"cpu_count\": 1,\n      \"memory\": \"2Gi\",\n      \"accelerator\": {\n        \"accelerator\": \"H100\",\n        \"count\": 2\n      },\n      \"availability_model\": \"spot\"\n    },\n    \"runtime\": {\n      \"start_commands\": [\n        \"python main.py\"\n      ],\n      \"environment_variables\": {\n        \"API_KEY\": \"your_api_key_here\",\n        \"PATH\": \"/usr/bin\"\n      },\n      \"enable_cache\": true,\n      \"cache_config\": {\n        \"enable_legacy_hf_mount\": true,\n        \"enabled\": true,\n        \"mount_base_path\": \"/root/.cache\",\n        \"require_cache_affinity\": true\n      },\n      \"checkpointing_config\": {\n        \"enabled\": true,\n        \"checkpoint_path\": \"/mnt/ckpts\",\n        \"volume_size_gib\": 10\n      },\n      \"load_checkpoint_config\": null\n    },\n    \"name\": \"gpt-oss-job\",\n    \"truss_user_env\": null,\n    \"interactive_session\": null,\n    \"weights\": [\n      {\n        \"allow_patterns\": null,\n        \"auth\": null,\n        \"auth_secret_name\": null,\n        \"ignore_patterns\": null,\n        \"mount_location\": \"/app/models/base\",\n        \"source\": \"hf://meta-llama/Llama-3-8B@main\"\n      }\n    ],\n    \"enable_baseten_workdir\": false,\n    \"priority\": 0\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'training_job': {'image': {'base_image': 'hello-world', 'docker_auth': None}, 'compute': {'node_count': 1, 'cpu_count': 1, 'memory': '2Gi', 'accelerator': {'accelerator': 'H100', 'count': 2}, 'availability_model': 'spot'}, 'runtime': {'start_commands': ['python main.py'], 'environment_variables': {'API_KEY': 'your_api_key_here', 'PATH': '/usr/bin'}, 'enable_cache': True, 'cache_config': {'enable_legacy_hf_mount': True, 'enabled': True, 'mount_base_path': '/root/.cache', 'require_cache_affinity': True}, 'checkpointing_config': {'enabled': True, 'checkpoint_path': '/mnt/ckpts', 'volume_size_gib': 10}, 'load_checkpoint_config': None}, 'name': 'gpt-oss-job', 'truss_user_env': None, 'interactive_session': None, 'weights': [{'allow_patterns': None, 'auth': None, 'auth_secret_name': None, 'ignore_patterns': None, 'mount_location': '/app/models/base', 'source': 'hf://meta-llama/Llama-3-8B@main'}], 'enable_baseten_workdir': False, 'priority': 0}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a training job with the specified configuration.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateTrainingJobRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}": {
            "delete": {
                "summary": "Deletes a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a training job. Stops it first if still running.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TrainingJobTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ],
            "get": {
                "summary": "Gets a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the details of an existing training job.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"priority\": 0,\n  \"availability_model\": \"spot\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'priority': 0, 'availability_model': 'spot'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates mutable fields on a PENDING training job: the queue priority (higher priorities are dequeued first) and the availability model (dedicated or spot capacity). Changes take effect on the next queue evaluation, which is triggered immediately.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateTrainingJobRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpdateTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/download": {
            "get": {
                "summary": "Gets presigned URLs for a training job's artifacts",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/download \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/download\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns presigned S3 URLs for the artifacts uploaded by a training job.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DownloadTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/recreate": {
            "post": {
                "summary": "Recreates a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/recreate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/recreate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new training job with the same configuration as an existing training job.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RecreateTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/logs": {
            "get": {
                "summary": "Gets the logs for a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the logs for a training job with the provided filters.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order for logs",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Limit of logs to fetch in a single request",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": 500,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "min_level",
                        "in": "query",
                        "required": false,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/LogLevelV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ],
            "post": {
                "summary": "Gets the logs for a training job (deprecated; use GET)",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"start_epoch_millis\": null,\n  \"end_epoch_millis\": null,\n  \"direction\": null,\n  \"limit\": null,\n  \"min_level\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Use the GET form on this path instead.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetTrainingJobLogsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "deprecated",
                "deprecated": true
            }
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics": {
            "get": {
                "summary": "Gets the metrics for a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'end_epoch_millis': None, 'start_epoch_millis': None, 'step_seconds': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the metrics for a training job.",
                "parameters": [
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch millis timestamp to end fetching metrics",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch millis timestamp to start fetching metrics.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "step_seconds",
                        "in": "query",
                        "required": false,
                        "description": "Resolution of the returned series, in seconds. When omitted, a step is derived from the time range so large windows return fewer points.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Step Seconds"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobMetricsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ],
            "post": {
                "summary": "Gets the metrics for a training job (deprecated; use GET)",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"end_epoch_millis\": null,\n  \"start_epoch_millis\": null,\n  \"step_seconds\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/metrics\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'end_epoch_millis': None, 'start_epoch_millis': None, 'step_seconds': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Use the GET form on this path instead.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetTrainingJobMetricsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "deprecated",
                "deprecated": true
            }
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/stop": {
            "post": {
                "summary": "Stops a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/stop \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/stop\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Stops a training job.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StopTrainingJobRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StopTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoints": {
            "get": {
                "summary": "Gets training job checkpoints",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoints \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoints\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the checkpoints for a training job.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobCheckpointsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoint_files": {
            "get": {
                "summary": "Gets training job checkpoint files",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoint_files \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoint_files\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets presigned URLs for all checkpoint files for a training job.",
                "parameters": [
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Max files per page (default 1000).",
                        "schema": {
                            "default": 1000,
                            "minimum": 1,
                            "title": "Page Size",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_token",
                        "in": "query",
                        "required": false,
                        "description": "Offset into the file list (default 0).",
                        "schema": {
                            "default": 0,
                            "minimum": 0,
                            "title": "Page Token",
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobCheckpointFilesResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/auth_codes": {
            "get": {
                "summary": "Gets auth codes for a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/auth_codes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/auth_codes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets authentication codes for all nodes of a training job's interactive sessions.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetAuthCodesResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id}": {
            "patch": {
                "summary": "Patches an interactive session",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"timeout_minutes\": null,\n  \"trigger\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/interactive_sessions/{session_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'timeout_minutes': None, 'trigger': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates specific fields on a training job's interactive session. Only provided (non-null) fields are updated.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PatchInteractiveSessionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PatchInteractiveSessionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                },
                {
                    "$ref": "#/components/parameters/session_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/ssh/sign": {
            "post": {
                "summary": "Signs an SSH certificate for a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/ssh/sign \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"public_key\": null,\n  \"replica_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/ssh/sign\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'public_key': None, 'replica_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Signs a short-lived SSH certificate granting access to a specific training job pod. Returns the signed SSH certificate, a JWT token for SSH proxy authentication, the proxy address to connect through, and the certificate expiry time.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SignSSHCertificateRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignSSHCertificateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/cache/summary": {
            "get": {
                "summary": "Gets training project cache summary",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/cache/summary \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/cache/summary\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the cache summary for the most recent training job in the project.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetCacheSummaryResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}": {
            "delete": {
                "summary": "Deletes a training project",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a training project and all associated training jobs.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TrainingProjectTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                }
            ],
            "get": {
                "summary": "Gets a training project",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the details of an existing training project.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingProjectResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_jobs/search": {
            "post": {
                "summary": "Searches training jobs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_jobs/search \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"project_id\": \"n4q95w5\",\n  \"job_id\": \"p7qr9qv\",\n  \"statuses\": [\n    \"TRAINING_JOB_RUNNING\",\n    \"TRAINING_JOB_COMPLETED\"\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_jobs/search\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'project_id': 'n4q95w5', 'job_id': 'p7qr9qv', 'statuses': ['TRAINING_JOB_RUNNING', 'TRAINING_JOB_COMPLETED']}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Searches training jobs for the organization.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SearchTrainingJobsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SearchTrainingJobsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/capabilities": {
            "get": {
                "summary": "Gets Loops server capabilities",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/capabilities \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/capabilities\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'model': 'Qwen/Qwen3-8B', 'use_case': 'rl', 'max_seq_len': 32768}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the list of models supported by the Loops server, including each model's maximum context length and whether it supports vision-language inputs. Each entry carries an 'enabled' flag saying whether this workspace can run it now, and 'enablement_details' explaining why when it cannot; filter on 'enabled' for the usable set. Capacity is resolved when the run is created, not here. Pass ?model= to ask about one model \u2014 an empty list means Baseten does not support it. Pass ?use_case=sft for a run that needs no sampler, and ?max_seq_len= to check a specific sequence length.",
                "parameters": [
                    {
                        "name": "model",
                        "in": "query",
                        "required": false,
                        "description": "Restrict the response to one model, identified by its HuggingFace repo id. A supported model comes back with its 'enabled' flag and, when false, its 'enablement_details'. An empty list means Baseten does not support that model. Omit to list every supported model.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "Qwen/Qwen3-8B"
                            ],
                            "title": "Model"
                        }
                    },
                    {
                        "name": "use_case",
                        "in": "query",
                        "required": false,
                        "description": "What the caller intends to run. Defaults to 'rl', the stricter of the two: an RL run needs both a trainer and a sampler, so anything enabled for 'rl' is also enabled for 'sft'.",
                        "schema": {
                            "$ref": "#/components/schemas/LoopsUseCaseV1",
                            "default": "rl",
                            "examples": [
                                "rl"
                            ]
                        }
                    },
                    {
                        "name": "max_seq_len",
                        "in": "query",
                        "required": false,
                        "description": "The sequence length the caller intends to train at \u2014 the same value they would pass as 'max_seq_len' when creating the run. Models that cannot serve it are reported as not enabled rather than returned with a ceiling the caller cannot use. Omit for the model's highest enabled sequence length.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                32768
                            ],
                            "title": "Max Seq Len"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsCapabilitiesResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/sessions": {
            "post": {
                "summary": "Creates a Loops session",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/sessions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/sessions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a Loops session scoped to the calling org.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsSessionResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/sessions/{session_id}": {
            "get": {
                "summary": "Gets a Loops session",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/sessions/{session_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/sessions/{session_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetches a Loops session by ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsSessionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/session_id"
                }
            ]
        },
        "/v1/loops/runs": {
            "get": {
                "summary": "Lists Loops runs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'run_id': 'k4q95w5', 'base_model': 'Qwen/Qwen3-8B', 'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops runs visible to the requesting user, optionally filtered by run id and/or base model. Defaults to the caller's own runs; pass ?scope=org to list every run in the caller's organization.",
                "parameters": [
                    {
                        "name": "run_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by run ID.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Run Id"
                        }
                    },
                    {
                        "name": "base_model",
                        "in": "query",
                        "required": false,
                        "description": "Filter runs by base model name.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "Qwen/Qwen3-8B"
                            ],
                            "title": "Base Model"
                        }
                    },
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "Defaults to the caller's own runs; pass 'org' to list every run in the caller's organization.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "org"
                            ],
                            "title": "Scope"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsRunsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a Loops run",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"session_id\": null,\n  \"base_model\": null,\n  \"name\": null,\n  \"max_seq_len\": null,\n  \"seed\": null,\n  \"availability_model\": \"spot\",\n  \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n  \"reuse_from_run_id\": null,\n  \"reuse_from_session_id\": null,\n  \"sampler_num_replicas\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'sampler_num_replicas': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a Loops run with an associated sampler in the given session.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsRunRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/runs/{run_id}/deactivate": {
            "post": {
                "summary": "Deactivates a Loops run",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/runs/{run_id}/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/runs/{run_id}/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Shuts down a Loops run by ID, tearing down both the run and its paired sampler. Succeeds if the run is already inactive. Saved checkpoints remain accessible.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/run_id"
                }
            ]
        },
        "/v1/loops/runs/{run_id}": {
            "get": {
                "summary": "Gets a Loops run",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/runs/{run_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/runs/{run_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetches a Loops run by ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/run_id"
                }
            ]
        },
        "/v1/loops/trainers": {
            "post": {
                "summary": "Creates a Loops trainer",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/trainers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"session_id\": null,\n  \"base_model\": null,\n  \"name\": null,\n  \"max_seq_len\": null,\n  \"seed\": null,\n  \"availability_model\": \"spot\",\n  \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n  \"reuse_from_run_id\": null,\n  \"reuse_from_session_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/trainers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a trainer-only Loops run in the given session, without a sampler. To sample from it, create a sampler with POST /v1/loops/samplers and pass this run's ID as run_id to pair the two. List and read the trainer through the /v1/loops/runs endpoints.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsTrainerRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/samplers": {
            "get": {
                "summary": "Lists Loops samplers",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/samplers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/samplers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops samplers (paired and standalone). Defaults to the caller's own; pass ?scope=org to list every sampler in the caller's organization.",
                "parameters": [
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "Defaults to the caller's own samplers; pass 'org' to include samplers owned by other users in the caller's organization.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "org"
                            ],
                            "title": "Scope"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsSamplersResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a Loops sampler",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/samplers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"availability_model\": null,\n  \"session_id\": null,\n  \"base_model\": null,\n  \"run_id\": null,\n  \"max_seq_length\": null,\n  \"model_path\": \"bt://loops:k4q95w5/sampler_weights/step-100\",\n  \"reuse_from_session_id\": null,\n  \"num_replicas\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/samplers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'availability_model': None, 'session_id': None, 'base_model': None, 'run_id': None, 'max_seq_length': None, 'model_path': 'bt://loops:k4q95w5/sampler_weights/step-100', 'reuse_from_session_id': None, 'num_replicas': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a standalone Loops sampler not linked to a run.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsSamplerRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsSamplerResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/samplers/{sampler_id}/deactivate": {
            "post": {
                "summary": "Deactivates a standalone Loops sampler",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/samplers/{sampler_id}/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/samplers/{sampler_id}/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Shuts down a standalone Loops sampler by ID. Succeeds if it is already inactive. A sampler paired to a run always returns 409 with the run's ID, even if it is inactive.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateLoopsSamplerResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/sampler_id"
                }
            ]
        },
        "/v1/loops/samplers/{sampler_id}": {
            "get": {
                "summary": "Gets a Loops sampler",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/samplers/{sampler_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/samplers/{sampler_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetches a Loops sampler by ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsSamplerResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/sampler_id"
                }
            ]
        },
        "/v1/loops/checkpoints": {
            "get": {
                "summary": "Lists Loops checkpoints",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/checkpoints \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'run_id': 'k4q95w5', 'base_model': 'Qwen/Qwen3-8B', 'checkpoint_path': 'bt://loops:k4q95w5/sampler_weights/step-100'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops checkpoints filtered by run id, base model, or bt:// URI. Provide exactly one filter.",
                "parameters": [
                    {
                        "name": "run_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by run ID. Returns all checkpoints saved by the run.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Run Id"
                        }
                    },
                    {
                        "name": "base_model",
                        "in": "query",
                        "required": false,
                        "description": "Filter by base model. Returns checkpoints across the caller's runs of this base model.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "Qwen/Qwen3-8B"
                            ],
                            "title": "Base Model"
                        }
                    },
                    {
                        "name": "checkpoint_path",
                        "in": "query",
                        "required": false,
                        "description": "bt:// URI of a Loops checkpoint. Form: bt://loops:<run_id>/(weights|sampler_weights)/<checkpoint_name>.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "bt://loops:k4q95w5/sampler_weights/step-100"
                            ],
                            "title": "Checkpoint Path"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsCheckpointsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/checkpoints/validate": {
            "post": {
                "summary": "Validates a Loops checkpoint bt:// URI",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/checkpoints/validate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"checkpoint_path\": \"bt://loops:k4q95w5/sampler_weights/step-100\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/validate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'checkpoint_path': 'bt://loops:k4q95w5/sampler_weights/step-100'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns whether the caller can manage and use this checkpoint.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ValidateLoopsCheckpointRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ValidateLoopsCheckpointResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/checkpoints/deploy": {
            "post": {
                "summary": "Deploys Loops checkpoints",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/checkpoints/deploy \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"checkpoint_ids\": null,\n  \"model_name\": null,\n  \"instance_type_id\": null,\n  \"hf_secret_name\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/deploy\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'checkpoint_ids': None, 'model_name': None, 'instance_type_id': None, 'hf_secret_name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates an inference deployment from one or more Loops sampler checkpoints. Confirm the user intends to create billable resources before calling it. This operation is not idempotent; repeating the request can create another deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DeployLoopsCheckpointRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeployLoopsCheckpointResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/checkpoints/{checkpoint_id}/files": {
            "get": {
                "summary": "Gets Loops checkpoint files",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/files \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/files\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets presigned URLs for the files under a Loops checkpoint. Returns a paginated list.",
                "parameters": [
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Max files per page (default 1000).",
                        "schema": {
                            "default": 1000,
                            "minimum": 1,
                            "title": "Page Size",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_token",
                        "in": "query",
                        "required": false,
                        "description": "Offset into the file list (default 0).",
                        "schema": {
                            "default": 0,
                            "minimum": 0,
                            "title": "Page Token",
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoopsCheckpointFilesResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/checkpoint_id"
                }
            ]
        },
        "/v1/loops/checkpoints/{checkpoint_id}/source": {
            "get": {
                "summary": "Gets where a Loops checkpoint's files come from",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/source \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/source\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Reports how to fetch a checkpoint's files: `s3` when the files endpoint serves presigned URLs for it, or `volume` with the ref to pull. Clients that download checkpoints should ask here first.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoopsCheckpointSourceResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/checkpoint_id"
                }
            ]
        },
        "/v1/loops/deployments": {
            "get": {
                "summary": "Lists Loops deployments",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/deployments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/deployments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops deployments. Defaults to the caller's own; pass ?scope=org to list every deployment in the caller's organization. Returns every deployment regardless of status; clients filter terminal states.",
                "parameters": [
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "Defaults to the caller's own deployments; pass 'org' to list every deployment in the caller's organization.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "org"
                            ],
                            "title": "Scope"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsDeploymentsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/deployments/{deployment_id}/deactivate": {
            "post": {
                "summary": "Deactivates a Loops deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/deployments/{deployment_id}/deactivate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/deployments/{deployment_id}/deactivate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Shuts down a Loops deployment by ID. Saved checkpoints remain accessible. Resolving the base model to a deployment ID is the caller's responsibility: list deployments and pick the active one.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateLoopsDeploymentResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/loops/deployments/{deployment_id}": {
            "get": {
                "summary": "Gets a Loops deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/deployments/{deployment_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/deployments/{deployment_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetches a Loops deployment by ID, including its latest status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsDeploymentResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/loops/deployments/{deployment_id}/debug_archive/files": {
            "get": {
                "summary": "Gets Loops debug archive files",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/deployments/{deployment_id}/debug_archive/files \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/deployments/{deployment_id}/debug_archive/files\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'page_token': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets presigned download URLs for a Loops deployment's debug archive.",
                "parameters": [
                    {
                        "name": "page_size",
                        "in": "query",
                        "required": false,
                        "description": "Max files per page (default and maximum 1000).",
                        "schema": {
                            "default": 1000,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Page Size",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page_token",
                        "in": "query",
                        "required": false,
                        "description": "Opaque token for the next page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Page Token"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoopsDebugArchiveFilesResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/loops/deployments/{deployment_id}/metrics": {
            "post": {
                "summary": "Gets metrics for a Loops trainer deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/deployments/{deployment_id}/metrics \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"end_epoch_millis\": null,\n  \"start_epoch_millis\": null,\n  \"step_seconds\": null,\n  \"time_divisor_seconds\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/deployments/{deployment_id}/metrics\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'end_epoch_millis': None, 'start_epoch_millis': None, 'step_seconds': None, 'time_divisor_seconds': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns per-node GPU/CPU/memory utilization and Knative queue-proxy request rate / concurrency / latency for the trainer pods. The sampler half of a Loops deployment is an OracleVersion and uses the existing model-metrics endpoint.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetLoopsDeploymentMetricsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsDeploymentMetricsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/loops/deployments/{deployment_id}/logs": {
            "get": {
                "summary": "Gets logs for a Loops trainer deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/loops/deployments/{deployment_id}/logs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/deployments/{deployment_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetches logs from the trainer pods of a Loops deployment. Visible to any member of the deployment's team.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order for logs",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Limit of logs to fetch in a single request",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": 500,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "min_level",
                        "in": "query",
                        "required": false,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/LogLevelV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/teams/{team_id}/loops/sessions": {
            "post": {
                "summary": "Creates a Loops session",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/sessions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/sessions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a Loops session scoped to the calling org.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsSessionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/teams/{team_id}/loops/runs": {
            "get": {
                "summary": "Lists a team's Loops runs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'run_id': 'k4q95w5', 'base_model': 'Qwen/Qwen3-8B', 'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops runs in the given team, visible to the requesting user, optionally filtered by run id and/or base model.",
                "parameters": [
                    {
                        "name": "run_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by run ID.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Run Id"
                        }
                    },
                    {
                        "name": "base_model",
                        "in": "query",
                        "required": false,
                        "description": "Filter runs by base model name.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "Qwen/Qwen3-8B"
                            ],
                            "title": "Base Model"
                        }
                    },
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "Defaults to the caller's own runs; pass 'org' to list every run in the caller's organization.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "org"
                            ],
                            "title": "Scope"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsRunsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ],
            "post": {
                "summary": "Creates a Loops run in a team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"session_id\": null,\n  \"base_model\": null,\n  \"name\": null,\n  \"max_seq_len\": null,\n  \"seed\": null,\n  \"availability_model\": \"spot\",\n  \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n  \"reuse_from_run_id\": null,\n  \"reuse_from_session_id\": null,\n  \"sampler_num_replicas\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'sampler_num_replicas': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a Loops run with an associated sampler in the given session; the run's infrastructure belongs to the given team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsRunRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/loops/trainers": {
            "post": {
                "summary": "Creates a Loops trainer",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/trainers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"session_id\": null,\n  \"base_model\": null,\n  \"name\": null,\n  \"max_seq_len\": null,\n  \"seed\": null,\n  \"availability_model\": \"spot\",\n  \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n  \"reuse_from_run_id\": null,\n  \"reuse_from_session_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/trainers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a trainer-only Loops run in the given session, without a sampler. To sample from it, create a sampler with POST /v1/loops/samplers and pass this run's ID as run_id to pair the two. List and read the trainer through the /v1/loops/runs endpoints.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsTrainerRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/teams/{team_id}/loops/samplers": {
            "get": {
                "summary": "Lists a team's Loops samplers",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/samplers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/samplers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops samplers (paired and standalone) in the given team, visible to the requesting user. Defaults to the caller's own; pass ?scope=org to list every sampler in the team.",
                "parameters": [
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "Defaults to the caller's own samplers; pass 'org' to include samplers owned by other users in the caller's organization.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "org"
                            ],
                            "title": "Scope"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsSamplersResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ],
            "post": {
                "summary": "Creates a Loops sampler in a team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/samplers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"availability_model\": null,\n  \"session_id\": null,\n  \"base_model\": null,\n  \"run_id\": null,\n  \"max_seq_length\": null,\n  \"model_path\": \"bt://loops:k4q95w5/sampler_weights/step-100\",\n  \"reuse_from_session_id\": null,\n  \"num_replicas\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/samplers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'availability_model': None, 'session_id': None, 'base_model': None, 'run_id': None, 'max_seq_length': None, 'model_path': 'bt://loops:k4q95w5/sampler_weights/step-100', 'reuse_from_session_id': None, 'num_replicas': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a standalone Loops sampler not linked to a run; the sampler belongs to the given team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsSamplerRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsSamplerResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training/capacity": {
            "get": {
                "summary": "Gets training GPU capacity",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training/capacity \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training/capacity\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns GPU capacity limits (baseline and peak) and current usage for the organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingGpuCapacityResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Sets a team's training GPU capacity",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/training/capacity \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": null,\n  \"gpu_type\": null,\n  \"max_gpus\": 8\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training/capacity\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'team_id': None, 'gpu_type': None, 'max_gpus': 8}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Sets the max concurrent GPUs of a given type a team may use. Creates the limit if one doesn't exist for this (team, gpu_type) pair, otherwise updates it in place. Org-admin only: this is a ceiling the org imposes on the team, not something the team manages for itself.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PatchTeamTrainingGpuCapacityRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PatchTeamTrainingGpuCapacityResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training/jobs/{training_job_id}/queue_context": {
            "get": {
                "summary": "Reconstructs queue context for a training job",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training/jobs/{training_job_id}/queue_context \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training/jobs/{training_job_id}/queue_context\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the (org, gpu_type) capacity pool the job was gated by, jobs that were holding GPU capacity in that pool when this job was submitted, and every TrainingJobStatus event in [submitted_at, released_at] for those jobs, useful for understanding why a job sat in PENDING. Caller must be an org admin and the job must belong to the caller's org.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobQueueContextResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/blobs/credentials/model": {
            "get": {
                "summary": "Gets blob credentials for models",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/blobs/credentials/model \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/blobs/credentials/model\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetBlobCredentialsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/blobs/credentials/train": {
            "get": {
                "summary": "Gets blob credentials for training",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/blobs/credentials/train \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/blobs/credentials/train\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetBlobCredentialsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/api_keys": {
            "post": {
                "summary": "Creates a team API key",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/api_keys \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my-api-key\",\n  \"type\": \"PERSONAL\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/api_keys\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'my-api-key', 'type': 'PERSONAL'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a team API key with the provided name and type. The API key is returned in the response.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateAPIKeyRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeyV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/api_keys": {
            "get": {
                "summary": "Lists API keys (metadata only, no plain text keys)",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/api_keys \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/api_keys\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'type': 'WORKSPACE_INVOKE'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns metadata for your personal API keys and the workspace and team API keys you can manage. Organization admins also receive every member's personal API keys, each with an owner identifying the member it belongs to.",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "Filter by API key type",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/APIKeyCategory"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "created_by_me",
                        "in": "query",
                        "required": false,
                        "description": "Return only keys created by the authenticated user",
                        "schema": {
                            "default": false,
                            "title": "Created By Me",
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeysV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates an API key",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/api_keys \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my-api-key\",\n  \"type\": \"PERSONAL\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/api_keys\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'my-api-key', 'type': 'PERSONAL'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates an API key with the provided name and type. The API key is returned in the response.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateAPIKeyRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeyV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/api_keys/{api_key_prefix}": {
            "delete": {
                "summary": "Deletes an API key by prefix",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/api_keys/{api_key_prefix} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/api_keys/{api_key_prefix}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes an API key by prefix and returns info about the API key.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeyTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/api_key_prefix"
                }
            ]
        },
        "/v1/model_apis": {
            "get": {
                "summary": "Lists Model APIs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/model_apis\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Model APIs visible to the caller. By default returns the full catalog; pass `added_only=true` to restrict to Model APIs the workspace has added.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "added_only",
                        "in": "query",
                        "required": false,
                        "description": "When true, restrict the result to Model APIs the workspace has added. Defaults to the full visible catalog.",
                        "schema": {
                            "default": false,
                            "title": "Added Only",
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelAPIsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/model_apis/usage": {
            "get": {
                "summary": "Gets Model APIs token usage in time buckets",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis/usage \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/model_apis/usage\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_time': None, 'end_time': None, 'bucket_width': '1m', 'limit': None, 'cursor': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns your organization's Model APIs token usage as a series of contiguous time buckets, broken down by the dimensions you pass in group_by. Buckets with no usage are included, so the series has no gaps. Usage is retained for 92 days, so buckets older than that are returned with no results.",
                "parameters": [
                    {
                        "name": "start_time",
                        "in": "query",
                        "required": false,
                        "description": "Start of the query range (ISO 8601, UTC), inclusive. Snapped down to the start of its bucket. Required on the first page, and ignored when you pass a cursor.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date-time",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Time"
                        }
                    },
                    {
                        "name": "end_time",
                        "in": "query",
                        "required": false,
                        "description": "End of the query range (ISO 8601, UTC), exclusive. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date-time",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Time"
                        }
                    },
                    {
                        "name": "bucket_width",
                        "in": "query",
                        "required": false,
                        "description": "Width of each time bucket: 1m, 1h, or 1d. Defaults to 1d.",
                        "schema": {
                            "$ref": "#/components/schemas/BucketWidth",
                            "default": "1d"
                        }
                    },
                    {
                        "name": "group_by",
                        "in": "query",
                        "required": false,
                        "description": "Dimensions to break usage down by, repeated once per dimension: api_key, user, model. Defaults to model.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/UsageDimensionV1"
                            },
                            "title": "Group By",
                            "type": "array"
                        }
                    },
                    {
                        "name": "api_keys",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these API key prefixes, repeated once per prefix.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Api Keys",
                            "type": "array"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage attributed to these user IDs, repeated once per ID.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "User Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "models",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these models, repeated once per model.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Models",
                            "type": "array"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Number of time buckets to return. Defaults and maximums depend on bucket_width: 1d defaults to 7 and allows 31, 1h defaults to 24 and allows 168, 1m defaults to 60 and allows 1440.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor from the pagination.cursor field of a previous response",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelApisUsageResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/model_apis/{model_api_name}": {
            "get": {
                "summary": "Gets a Model API",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis/{model_api_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/model_apis/{model_api_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetches a Model API by name, with workspace overlay when added.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelAPIV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_api_name"
                }
            ]
        },
        "/v1/llm_models": {
            "post": {
                "summary": "Creates a new BIS-LLM deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/llm_models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"resources\": null,\n  \"region\": null,\n  \"llm_version\": null,\n  \"model_metadata\": null,\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 600,\n    \"concurrency_target\": null,\n    \"max_replica\": 5,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 300,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"additional_autoscaling_config\": {\n    \"metrics\": [\n      {\n        \"name\": \"in_flight_tokens\",\n        \"target\": 40000\n      }\n    ]\n  },\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"git_sha\": \"abc123\"\n  },\n  \"weights\": [\n    {\n      \"mount_location\": \"/models/base\",\n      \"source\": \"hf://meta-llama/Llama-3-8B\"\n    }\n  ],\n  \"name\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/llm_models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'resources': None, 'region': None, 'llm_version': None, 'model_metadata': None, 'autoscaling_settings': {'autoscaling_window': 600, 'concurrency_target': None, 'max_replica': 5, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 300, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'additional_autoscaling_config': {'metrics': [{'name': 'in_flight_tokens', 'target': 40000}]}, 'metadata': {'environment': 'production', 'git_sha': 'abc123'}, 'weights': [{'mount_location': '/models/base', 'source': 'hf://meta-llama/Llama-3-8B'}], 'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLLMModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LLMModelHandleV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/llm_models": {
            "post": {
                "summary": "Creates a new BIS-LLM deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/llm_models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"resources\": null,\n  \"region\": null,\n  \"llm_version\": null,\n  \"model_metadata\": null,\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 600,\n    \"concurrency_target\": null,\n    \"max_replica\": 5,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 300,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"additional_autoscaling_config\": {\n    \"metrics\": [\n      {\n        \"name\": \"in_flight_tokens\",\n        \"target\": 40000\n      }\n    ]\n  },\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"git_sha\": \"abc123\"\n  },\n  \"weights\": [\n    {\n      \"mount_location\": \"/models/base\",\n      \"source\": \"hf://meta-llama/Llama-3-8B\"\n    }\n  ],\n  \"name\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/llm_models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'resources': None, 'region': None, 'llm_version': None, 'model_metadata': None, 'autoscaling_settings': {'autoscaling_window': 600, 'concurrency_target': None, 'max_replica': 5, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 300, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'additional_autoscaling_config': {'metrics': [{'name': 'in_flight_tokens', 'target': 40000}]}, 'metadata': {'environment': 'production', 'git_sha': 'abc123'}, 'weights': [{'mount_location': '/models/base', 'source': 'hf://meta-llama/Llama-3-8B'}], 'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLLMModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LLMModelHandleV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/llm_models/{model_id}/deployments": {
            "post": {
                "summary": "Creates a new BIS-LLM deployment version",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/llm_models/{model_id}/deployments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"resources\": null,\n  \"region\": null,\n  \"llm_version\": null,\n  \"model_metadata\": null,\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 600,\n    \"concurrency_target\": null,\n    \"max_replica\": 5,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 300,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"additional_autoscaling_config\": {\n    \"metrics\": [\n      {\n        \"name\": \"in_flight_tokens\",\n        \"target\": 40000\n      }\n    ]\n  },\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"git_sha\": \"abc123\"\n  },\n  \"weights\": [\n    {\n      \"mount_location\": \"/models/base\",\n      \"source\": \"hf://meta-llama/Llama-3-8B\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/llm_models/{model_id}/deployments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'resources': None, 'region': None, 'llm_version': None, 'model_metadata': None, 'autoscaling_settings': {'autoscaling_window': 600, 'concurrency_target': None, 'max_replica': 5, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 300, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'additional_autoscaling_config': {'metrics': [{'name': 'in_flight_tokens', 'target': 40000}]}, 'metadata': {'environment': 'production', 'git_sha': 'abc123'}, 'weights': [{'mount_location': '/models/base', 'source': 'hf://meta-llama/Llama-3-8B'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLLMModelVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LLMModelHandleV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/library_listings": {
            "get": {
                "summary": "Gets all library listings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/library_listings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns all library listings for the authenticated user's organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingsV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a new library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/library_listings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"display_name\": null,\n  \"user_defined_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'display_name': None, 'user_defined_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new library listing for the authenticated user's organization.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLibraryListingRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/library_listings/{user_defined_listing_id}": {
            "delete": {
                "summary": "Deletes a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a library listing and all of its associated versions. Any versions that are currently live will also be removed.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_defined_listing_id"
                }
            ],
            "get": {
                "summary": "Gets a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a specific library listing by its user-defined identifier.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"display_name\": null,\n  \"is_public\": null,\n  \"trending\": null,\n  \"metadata\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'display_name': None, 'is_public': None, 'trending': None, 'metadata': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a library listing. Supported fields are the display name, public visibility, trending status, and the model-level metadata. When metadata is provided, it replaces the stored metadata.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateLibraryListingRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/library_listings/{user_defined_listing_id}/versions": {
            "get": {
                "summary": "Gets all versions for a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns all versions for a specific library listing.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingVersionsV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_defined_listing_id"
                }
            ],
            "post": {
                "summary": "Creates a new library listing version",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"display_name\": null,\n  \"oracle_version_id\": null,\n  \"version_tag\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'display_name': None, 'oracle_version_id': None, 'version_tag': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new library listing version from an existing model version. The model version must be fully built (have an image_uri). If a listing with the given id already exists for the org, a new version is added. Otherwise, a new listing is created.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLibraryListingVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingVersionV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/library_listings/{user_defined_listing_id}/versions/{version_tag}": {
            "delete": {
                "summary": "Deletes a library listing version",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions/{version_tag} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions/{version_tag}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a specific version of a library listing. Deleting a live version will fail with a 400 error; demote the version first by setting another version as live.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingVersionTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_defined_listing_id"
                },
                {
                    "$ref": "#/components/parameters/version_tag"
                }
            ],
            "get": {
                "summary": "Gets a library listing version",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions/{version_tag} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions/{version_tag}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a specific version of a library listing.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingVersionV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a library listing version",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions/{version_tag} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"is_live\": null,\n  \"allow_truss_download\": null,\n  \"benchmark\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}/versions/{version_tag}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'is_live': None, 'allow_truss_download': None, 'benchmark': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a library listing version. Setting is_live to true will demote the current live version. When a benchmark is provided, it replaces the stored benchmark.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateLibraryListingVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingVersionV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/billing/model_apis": {
            "get": {
                "summary": "Gets daily Model APIs costs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/billing/model_apis \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/billing/model_apis\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'start_date': None, 'end_date': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns daily Model API costs in USD for your organization, with optional filtering and grouping by API key, user, model, and service tier. Results may differ from finalized invoice amounts. Cost history is available from August 5, 2026 at 20:45 UTC. August 5 is a partial day; earlier dates are unavailable.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Number of daily cost buckets to return. Defaults to 7; maximum 31.",
                        "schema": {
                            "default": 7,
                            "maximum": 31,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": false,
                        "description": "Inclusive UTC calendar day at the start of the query range. Defaults to the previous UTC date, cannot be before 2026-08-05, and is ignored when you pass a cursor.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": false,
                        "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included. The date range cannot exceed 90 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Date"
                        }
                    },
                    {
                        "name": "group_by",
                        "in": "query",
                        "required": false,
                        "description": "Dimensions to break costs down by, repeated once per dimension: api_key_prefix, user, model, or service_tier. Each result represents one observed combination of the requested dimensions within that day. For example, grouping by api_key_prefix and user returns each API-key and user pair that had usage. Combinations without usage are omitted, so result counts can differ between days. Omit for daily organization totals.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/ModelApiCostDimensionV1"
                            },
                            "title": "Group By",
                            "type": "array"
                        }
                    },
                    {
                        "name": "api_key_prefixes",
                        "in": "query",
                        "required": false,
                        "description": "Return only costs for these exact API key prefixes, repeated once per prefix.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Api Key Prefixes",
                            "type": "array"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only costs attributed to these exact user IDs, repeated once per ID.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "User Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "models",
                        "in": "query",
                        "required": false,
                        "description": "Return only costs for these exact model identifiers, repeated once per model.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Models",
                            "type": "array"
                        }
                    },
                    {
                        "name": "service_tiers",
                        "in": "query",
                        "required": false,
                        "description": "Return only costs for these exact service tiers, repeated once per tier.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Service Tiers",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelApisCostsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/billing/usage_summary": {
            "get": {
                "summary": "Gets billing usage summary for a date range",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/billing/usage_summary \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/billing/usage_summary\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_date': None, 'end_date': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns billing usage data within the specified date range. Includes dedicated model serving, training, and model APIs usage. The date range must not exceed 31 days.",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": true,
                        "description": "Start date (ISO 8601, UTC). Earliest queryable: 2026-01-01.",
                        "schema": {
                            "format": "date-time",
                            "title": "Start Date",
                            "type": "string"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": true,
                        "description": "End date in ISO 8601 format (UTC). Date range cannot exceed 31 days.",
                        "schema": {
                            "format": "date-time",
                            "title": "End Date",
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UsageSummaryV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/billing/tool_call_usage": {
            "get": {
                "summary": "Gets server-side tool call usage",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/billing/tool_call_usage \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/billing/tool_call_usage\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_date': None, 'end_date': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns your organization's server-side tool call usage (web search and fetch tools Baseten executes on your behalf) as daily rows grouped by provider, charge unit (sku), and model.",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": true,
                        "description": "Inclusive UTC calendar day at the start of the query range.",
                        "schema": {
                            "format": "date",
                            "title": "Start Date",
                            "type": "string"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": false,
                        "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included. The date range cannot exceed 90 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ToolCallUsageResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/users": {
            "get": {
                "summary": "Lists users in the workspace",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'email': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the workspace's members. Only actual joined members are returned; service accounts, invited users, and pending join requests are excluded.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": false,
                        "description": "When set, returns only users with this exact email, if any.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UsersResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/users/me": {
            "get": {
                "summary": "Gets the authenticated user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users/me \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/users/me\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns info about the user making the request.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserInfoV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/users/{user_id}": {
            "get": {
                "summary": "Gets a user by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns info about a user in the caller's workspace.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserInfoV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_id"
                }
            ]
        },
        "/v1/organizations/me": {
            "get": {
                "summary": "Gets the authenticated organization",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/organizations/me \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/organizations/me\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns info about the organization of the user making the request.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrganizationInfoV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/gateway/events": {
            "get": {
                "summary": "Lists gateway events",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/events \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/events\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'start_time': None, 'end_time': None, 'limit': None, 'cursor': None}\n)\n\nprint(response.text)"
                    }
                ],
                "parameters": [
                    {
                        "name": "start_time",
                        "in": "query",
                        "required": false,
                        "description": "Inclusive start (ISO 8601, UTC). Required without a cursor.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date-time",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Time"
                        }
                    },
                    {
                        "name": "end_time",
                        "in": "query",
                        "required": false,
                        "description": "Exclusive end (ISO 8601, UTC). Defaults to now.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date-time",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Max events. Default 100, max 1000.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "api_keys",
                        "in": "query",
                        "required": false,
                        "description": "Return only events for these API key prefixes, repeated once per prefix.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Api Keys",
                            "type": "array"
                        }
                    },
                    {
                        "name": "external_entity_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only events for these external entity IDs, repeated once per ID.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "External Entity Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Next-page cursor. Other parameters are ignored.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GatewayEventsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/explore/metadata": {
            "get": {
                "summary": "Lists model metadata",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/explore/metadata \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/explore/metadata\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'provider': None, 'q': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists all live model metadata rows, e.g. for model pickers.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "provider",
                        "in": "query",
                        "required": false,
                        "description": "Filter to a provider by slug prefix, e.g. 'anthropic'. Preserved by the cursor; if repeated, must match the original filter.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Provider"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Case-insensitive substring search over metadata slugs. Preserved by the cursor; if repeated, must match the original filter.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Q"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ExploreMetadataResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes": {
            "get": {
                "summary": "Lists routes",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'team_id': None, 'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists routes you can invoke in the team, newest first, optionally filtered by exact name.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "Identifier of the team whose routes to list.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "Filter by exact route name. Preserved by the cursor; if repeated, must match the original filter.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RoutesResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/routes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": \"abc1234\",\n  \"display_name\": \"Assistant\",\n  \"target\": {\n    \"model\": \"zai-org/GLM-5.3\",\n    \"type\": \"BASETEN_MODEL_API\"\n  },\n  \"description\": \"Assistant for code review and debugging.\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'team_id': 'abc1234', 'display_name': 'Assistant', 'target': {'model': 'zai-org/GLM-5.3', 'type': 'BASETEN_MODEL_API'}, 'description': 'Assistant for code review and debugging.'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates and derives a name for the provided route configuration",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateRouteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes/usage": {
            "get": {
                "summary": "Gets daily route usage and estimated costs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/usage \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/usage\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'start_date': None, 'end_date': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Buckets are UTC days, and days with no usage are included. Organization admins see all route usage in the organization. Other members, including viewers, see only usage from Routes keys they created, including keys that have since expired, been revoked, or been deleted. Usage is metered every 15 minutes, so the current hour can lag. Model API costs use your prices at the time of each request and include tool calls. xAI costs are the charges xAI reports. OpenAI and Anthropic costs are estimated from Baseten's reference prices and may differ from your provider's bill. Vertex and OpenAI-compatible usage is not included. Costs for OpenAI, Anthropic, and xAI estimate what you pay those providers; they are not Baseten charges. Usage is retained for 92 days.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Number of daily buckets to return. Defaults to 7; maximum 31.",
                        "schema": {
                            "default": 7,
                            "maximum": 31,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": false,
                        "description": "Inclusive UTC calendar day at the start of the query range. Defaults to the previous UTC date, and is ignored when you pass a cursor.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": false,
                        "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included.",
                        "schema": {
                            "anyOf": [
                                {
                                    "format": "date",
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Date"
                        }
                    },
                    {
                        "name": "group_by",
                        "in": "query",
                        "required": false,
                        "description": "Dimensions to break usage down by, repeated once per dimension: USER, MODEL, or PROVIDER. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. Defaults to MODEL.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/RouteUsageDimensionV1"
                            },
                            "title": "Group By",
                            "type": "array"
                        }
                    },
                    {
                        "name": "user_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage from Routes keys created by these user IDs, repeated once per ID.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "User Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "models",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these exact model names, repeated once per model.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Models",
                            "type": "array"
                        }
                    },
                    {
                        "name": "providers",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these providers, repeated once per provider.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/RouteProviderV1"
                            },
                            "title": "Providers",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RoutesUsageResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes/settings/users/{user_id}": {
            "get": {
                "summary": "Gets a user's route settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the settings that apply to the user, including the spend limit that caps what they can spend on Baseten Code each month: the limit set on the user, their team's per-member limit, and the effective limit for this user. The user limit always overrides the team's per-member limit.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteUserSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_id"
                }
            ],
            "patch": {
                "summary": "Updates a user's route settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/routes/settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"spend_limit\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'spend_limit': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Changes only the fields in the request. Once the user's metered spend in a month reaches the spend limit, requests with Routes keys they created are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. The user's own limit supersedes their team's per-member limit.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateRouteUserSettingsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteUserSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes/settings/teams/{team_id}": {
            "get": {
                "summary": "Gets a team's route settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/settings/teams/{team_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/settings/teams/{team_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the settings that apply to the team, including the default models for each coding harness and the team's spend limits. Any member who can invoke the team's routes can read them.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteTeamSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ],
            "patch": {
                "summary": "Updates a team's route settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/routes/settings/teams/{team_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"harness_defaults\": null,\n  \"spend_limit\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/settings/teams/{team_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'harness_defaults': None, 'spend_limit': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Changes only the fields in the request, all or nothing. Requires team admin.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateRouteTeamSettingsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteTeamSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes/connections": {
            "get": {
                "summary": "Lists connections",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'team_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the team's connections, newest first.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "Identifier of the team whose connections to list.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteConnectionsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/routes/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": \"abc1234\",\n  \"config\": {\n    \"provider\": \"ANTHROPIC\",\n    \"secret_id\": \"abc1234\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'team_id': 'abc1234', 'config': {'provider': 'ANTHROPIC', 'secret_id': 'abc1234'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a connection from the team to an upstream provider.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateRouteConnectionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteConnectionV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes/connections/{connection_id}": {
            "delete": {
                "summary": "Deletes a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/routes/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes the connection. The team secret it points at is left in place.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteConnectionTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/connection_id"
                }
            ],
            "patch": {
                "summary": "Updates a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/routes/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"config\": {\n    \"provider\": \"ANTHROPIC\",\n    \"secret_id\": \"abc1234\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'config': {'provider': 'ANTHROPIC', 'secret_id': 'abc1234'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateRouteConnectionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteConnectionV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/routes/{route_id}": {
            "delete": {
                "summary": "Deletes a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/route_id"
                }
            ],
            "get": {
                "summary": "Gets a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"description\": \"Assistant for code review and debugging.\",\n  \"display_name\": \"Assistant\",\n  \"target\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'description': 'Assistant for code review and debugging.', 'display_name': 'Assistant', 'target': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "The route name, target type, and owning team are immutable.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateRouteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RouteV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/gateway/endpoints": {
            "get": {
                "summary": "Lists Gateway endpoints",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/endpoints \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/endpoints\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EndpointsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a Gateway endpoint",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/gateway/endpoints \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"slug\": \"baseten/mymodel-4\",\n  \"region\": \"UNRESTRICTED\",\n  \"targets\": [\n    {\n      \"environment_name\": \"staging\",\n      \"model_id\": \"3kZ9xqd\",\n      \"provider\": \"BASETEN\",\n      \"target_model\": \"custom/model-name\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/endpoints\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'slug': 'baseten/mymodel-4', 'region': 'UNRESTRICTED', 'targets': [{'environment_name': 'staging', 'model_id': '3kZ9xqd', 'provider': 'BASETEN', 'target_model': 'custom/model-name'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Provisions an endpoint for the given slug and its upstream target. Exactly one target is supported at this time. The slug's prefix must be one your organization owns.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateEndpointRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EndpointV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/gateway/endpoints/{endpoint_id}": {
            "delete": {
                "summary": "Deletes a Gateway endpoint",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/gateway/endpoints/{endpoint_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/endpoints/{endpoint_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EndpointTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/endpoint_id"
                }
            ],
            "get": {
                "summary": "Gets a Gateway endpoint",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/endpoints/{endpoint_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/endpoints/{endpoint_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EndpointV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a Gateway endpoint",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/gateway/endpoints/{endpoint_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"targets\": [\n    {\n      \"environment_name\": \"staging\",\n      \"model_id\": \"3kZ9xqd\",\n      \"provider\": \"BASETEN\",\n      \"target_model\": \"custom/model-name\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/endpoints/{endpoint_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'targets': [{'environment_name': 'staging', 'model_id': '3kZ9xqd', 'provider': 'BASETEN', 'target_model': 'custom/model-name'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the endpoint's provided mutable fields. If targets are provided, the full target list is replaced. Exactly one target is supported at this time.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateEndpointRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EndpointV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/gateway/groups": {
            "get": {
                "summary": "Lists groups",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/groups \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GroupsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/gateway/groups \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"metadata\": {\n    \"name\": \"Acme prod\",\n    \"external_entity_id\": \"cust_42\"\n  },\n  \"models\": [\n    {\n      \"slug\": \"my-org/claude\"\n    }\n  ],\n  \"hierarchy\": {\n    \"limit_enforcement\": \"INDEPENDENT\",\n    \"parent_group_id\": \"abc123\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'metadata': {'name': 'Acme prod', 'external_entity_id': 'cust_42'}, 'models': [{'slug': 'my-org/claude'}], 'hierarchy': {'limit_enforcement': 'INDEPENDENT', 'parent_group_id': 'abc123'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a group and its endpoint configuration.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGroupRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GroupV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/gateway/groups/{group_id}": {
            "get": {
                "summary": "Gets a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/groups/{group_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups/{group_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GroupV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/group_id"
                }
            ],
            "patch": {
                "summary": "Updates a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/gateway/groups/{group_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"metadata\": {\n    \"name\": \"Acme Prod\"\n  },\n  \"models\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups/{group_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'metadata': {'name': 'Acme Prod'}, 'models': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the group's mutable fields.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateGroupRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GroupV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/gateway/groups/{group_id}/api_keys": {
            "get": {
                "summary": "Lists API keys for a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/KeysForGroupResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/group_id"
                }
            ],
            "post": {
                "summary": "Creates an API key for a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"prod-key-1\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'prod-key-1'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new API key for the given group.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateApiKeyForGroupRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateApiKeyForGroupResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/gateway/groups/{group_id}/api_keys/register": {
            "post": {
                "summary": "Registers an API key for a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys/register \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"my-model-api-key\",\n  \"key\": \"my-secure-api-key-value\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys/register\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'my-model-api-key', 'key': 'my-secure-api-key-value'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Registers a Gateway API key with the provided value and name.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/RegisterAPIKeyRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RegisterAPIKeyResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/group_id"
                }
            ]
        },
        "/v1/gateway/groups/{group_id}/api_keys/{api_key_prefix}": {
            "get": {
                "summary": "Gets an API key for a group",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys/{api_key_prefix} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/gateway/groups/{group_id}/api_keys/{api_key_prefix}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GatewayKeyInfoV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/group_id"
                },
                {
                    "$ref": "#/components/parameters/api_key_prefix"
                }
            ]
        },
        "/v1/sandboxes/configuration": {
            "get": {
                "operationId": "GetSandboxConfiguration",
                "summary": "Get sandbox configuration",
                "description": "Return available Carbon-compatible sandbox regions. Configuration is the same for every team, so no team is selected. Only enabled regions supporting Carbon are returned. This describes regional capability, not the runtime selected for a particular team or sandbox. Region configuration is cached for up to 30 seconds.",
                "tags": [
                    "Sandboxes"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetSandboxConfigurationResponseV1"
                                },
                                "example": {
                                    "regions": [
                                        {
                                            "name": "us-was-1",
                                            "country": "us",
                                            "continent": "na",
                                            "location": "Washington",
                                            "info_generation": "CARBON"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/instances/{sandbox_name}/metrics": {
            "get": {
                "operationId": "GetSandboxMetrics",
                "summary": "Get sandbox metrics",
                "description": "Returns every interval in the requested half-open range [start_time, end_time).\nBuckets align to UTC interval boundaries; partial boundary buckets include only samples\nwithin the requested range. The first bucket may start before start_time. Ranges are limited to 31 days\nand 10000 buckets. Request counts are zero when there is no traffic, and null\nfor buckets entirely before sandbox creation. CPU and memory are null without\nsamples, including standby. Error rate is the fraction of requests returning\n4xx or 5xx, null when there are no requests. Telemetry failures return an error.\n",
                "tags": [
                    "Sandboxes"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/SandboxName"
                    },
                    {
                        "name": "start_time",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "end_time",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "interval_seconds",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "enum": [
                                10,
                                30,
                                60,
                                300,
                                900,
                                3600
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Complete sandbox metrics time series.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxMetricsV1"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid range, interval, or query parameter."
                    },
                    "401": {
                        "description": "Authentication required."
                    },
                    "403": {
                        "description": "Team access denied."
                    },
                    "404": {
                        "description": "Sandbox not found."
                    },
                    "502": {
                        "description": "Metrics query failed."
                    },
                    "503": {
                        "description": "Metrics are unavailable."
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/instances/{sandbox_name}/logs": {
            "get": {
                "operationId": "GetSandboxLogs",
                "summary": "Get sandbox logs",
                "description": "Returns sandbox runtime logs, newest first, within the half-open range\n[start_time, end_time). Ranges are limited to 7 days. Follow next_cursor\nuntil it is null to retrieve all pages, keeping the same range and limit.\nLogs before sandbox creation are excluded. Unavailable telemetry returns an error.\n",
                "tags": [
                    "Sandboxes"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/SandboxName"
                    },
                    {
                        "name": "start_time",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "end_time",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000,
                            "default": 100
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque next_cursor from the previous page. Omit for the first page.",
                        "schema": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 4096
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of sandbox logs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxLogsV1"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid range, limit, cursor, or query parameter."
                    },
                    "401": {
                        "description": "Authentication required."
                    },
                    "403": {
                        "description": "Team access denied."
                    },
                    "404": {
                        "description": "Sandbox not found."
                    },
                    "502": {
                        "description": "Logs query failed."
                    },
                    "503": {
                        "description": "Logs are unavailable."
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/instances": {
            "get": {
                "operationId": "ListSandboxes",
                "summary": "List sandboxes",
                "description": "Return a cursor-paginated page of sandboxes. Terminated sandboxes are hidden by default.",
                "tags": [
                    "Sandboxes"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Search indexed sandbox names and labels. Search is applied before pagination.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "api-review"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Deployment statuses. Repeat the query parameter for each status, for example status=DEPLOYED&status=FAILED. Unknown values are rejected. Cannot be combined with external_id.",
                        "required": false,
                        "style": "form",
                        "explode": true,
                        "schema": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "string",
                                "minLength": 1
                            },
                            "example": [
                                "DEPLOYED",
                                "FAILED"
                            ]
                        }
                    },
                    {
                        "name": "external_id",
                        "in": "query",
                        "description": "Filter by a caller-owned external identifier. Cannot be combined with status.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "api-review-20260916-001"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxesResponseV1"
                                },
                                "examples": {
                                    "page": {
                                        "$ref": "#/components/examples/SandboxesPage"
                                    },
                                    "last_page": {
                                        "$ref": "#/components/examples/SandboxesLastPage"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "CreateSandbox",
                "summary": "Create a sandbox",
                "description": "Create a sandbox with an optional client-provided name, generated by the server when omitted. The request waits briefly for deployment, then returns the created resource. Deployment may continue after the response; inspect status to determine readiness. Names belonging to failed or terminated sandboxes can be reused; an active sandbox reserves its name. Every field is optional. The server applies image and memory defaults; SDKs should omit fields the caller did not set. A request with no body creates a sandbox from baseten/base-image:latest, the built-in image with the sandbox execution API ready to use, with 4096 MB of memory. It is available directly; no image build, push, or GET /v1/sandboxes/images is needed. Use the returned url to execute commands with your authentication token as a Bearer token, not your Baseten API key.",
                "tags": [
                    "Sandboxes"
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateSandboxRequestV1"
                            },
                            "examples": {
                                "quickstart": {
                                    "$ref": "#/components/examples/CreateSandboxQuickstart"
                                },
                                "complete": {
                                    "$ref": "#/components/examples/CreateSandbox"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Sandbox created.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxReady"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "409": {
                        "description": "An active sandbox with the requested name already exists. Returns a JSON error with code, message, and optional details.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "code": "ALREADY_EXISTS",
                                    "message": "A sandbox with this name already exists.",
                                    "details": {
                                        "name": "baseten-api-review-0916"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/instances/{sandbox_name}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxName"
                }
            ],
            "get": {
                "operationId": "GetSandbox",
                "summary": "Get a sandbox",
                "description": "Return the sandbox configuration and status.",
                "tags": [
                    "Sandboxes"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "name": "show_secrets",
                        "in": "query",
                        "description": "Reveal environment variable values for workspace administrators. Defaults to false. Callers without the admin role receive masked values even when true.",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxReady"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "UpdateSandbox",
                "summary": "Update a sandbox",
                "description": "Partially update configuration. Omitted fields remain unchanged; supplied arrays and maps replace their previous values. Structured objects update only supplied fields. The name, memory, network, region, image, and ports are immutable after creation. Supplying any of these fields returns 400, including unchanged, empty, or null values.",
                "tags": [
                    "Sandboxes"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateSandboxRequestV1"
                            },
                            "examples": {
                                "complete": {
                                    "$ref": "#/components/examples/UpdateSandbox"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxUpdated"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request, including attempts to change memory or network configuration.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "code": "INVALID_REQUEST",
                                    "message": "Memory and network configuration cannot be changed after creation."
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "409": {
                        "$ref": "#/components/responses/SandboxError409"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            },
            "delete": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "DeleteSandbox",
                "summary": "Delete a sandbox",
                "description": "Permanently delete the sandbox and its local data asynchronously. The returned resource has status DELETING.",
                "tags": [
                    "Sandboxes"
                ],
                "responses": {
                    "202": {
                        "description": "Request accepted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxDeleting"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "409": {
                        "$ref": "#/components/responses/SandboxError409"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/library_images": {
            "get": {
                "operationId": "ListSandboxLibraryImages",
                "summary": "List built-in sandbox images",
                "description": "Return the built-in sandbox images, the same for every team, so no team is selected. Use the image field directly as the image of a sandbox, without building or pushing it. Hidden and upcoming images are excluded.",
                "tags": [
                    "Images"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxLibraryImagesResponseV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxLibraryImages"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/images": {
            "get": {
                "operationId": "ListImages",
                "summary": "List sandbox images",
                "description": "Return one cursor-paginated page of image repository summaries. Tags are listed separately. Pages can be empty when non-sandbox repositories are excluded; follow pagination.cursor while pagination.has_more is true. Prefix search forces ascending name order.",
                "tags": [
                    "Images"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort by repository name or creation time: name:asc, name:desc, createdAt:asc, or createdAt:desc. Keep the same sort when following a cursor.",
                        "schema": {
                            "type": "string",
                            "default": "createdAt:desc"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Case-sensitive repository name prefix. Search is applied before pagination.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxImagesResponseV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/ImagesList"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "PushImage",
                "summary": "Push a sandbox image",
                "description": "With image supplied, import the registry image asynchronously. Otherwise return an upload URL for a ZIP source archive containing its Dockerfile and build context. The uploaded ZIP archive must not exceed 5 GB. Processing starts after upload. No sandbox is created. Poll the image until BUILT or FAILED.",
                "tags": [
                    "Images"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PushSandboxImageRequestV1"
                            },
                            "examples": {
                                "archive": {
                                    "$ref": "#/components/examples/PushArchive"
                                },
                                "registry": {
                                    "$ref": "#/components/examples/PushRegistry"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Request accepted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PushSandboxImageResponseV1"
                                },
                                "examples": {
                                    "archive": {
                                        "$ref": "#/components/examples/PushArchiveAccepted"
                                    },
                                    "registry": {
                                        "$ref": "#/components/examples/PushRegistryAccepted"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/cleanup_images": {
            "post": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "CleanupImages",
                "summary": "Clean up unused images",
                "description": "Remove unused sandbox image versions. Versions referenced by active deployments are preserved.",
                "tags": [
                    "Images"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CleanupSandboxImagesResponseV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/CleanupImages"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/images/{image_name}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxImageName"
                }
            ],
            "get": {
                "operationId": "GetImage",
                "summary": "Get a sandbox image",
                "description": "Return the repository summary and processing status. Use the tag listing endpoint for image versions.",
                "tags": [
                    "Images"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxImageV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/ImageSummary"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            },
            "delete": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "DeleteImage",
                "summary": "Delete a sandbox image",
                "description": "Delete the image repository and all its tags. Reject deletion if any version is referenced by an active deployment. Return the deleted image.",
                "tags": [
                    "Images"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxImageV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/ImageReady"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "409": {
                        "$ref": "#/components/responses/SandboxError409"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/images/{image_name}/logs": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxImageName"
                }
            ],
            "get": {
                "operationId": "GetImageBuildLogs",
                "summary": "Get image build logs",
                "description": "Return one page of logs from the latest recorded build of this image, including failed builds, newest first. Logs may take a short time to appear. Defaults to the last 24 hours; the requested time range must not exceed 7 days. Keep start_time and end_time fixed when paging with offset. A new build changes the log source; this endpoint does not retrieve a historical build by ID. While a new upload is waiting to start, logs may still refer to the preceding build. Older builds without a recorded environment use image-level build logs within the requested time range.",
                "tags": [
                    "Images"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "name": "start_time",
                        "in": "query",
                        "description": "Inclusive RFC 3339 start time. Defaults to 24 hours before end_time.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "end_time",
                        "in": "query",
                        "description": "RFC 3339 end time. Defaults to the current time.",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of log entries to return.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000,
                            "default": 100
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "description": "Number of log entries to skip. Narrow the time range beyond 10000 entries.",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 10000,
                            "default": 0
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Build logs in the requested time range. An empty array means no logs are available in that range.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxImageBuildLogsResponseV1"
                                },
                                "example": {
                                    "logs": [
                                        {
                                            "timestamp": "2026-09-29T12:00:00Z",
                                            "message": "Step 1/2: loading build context",
                                            "severity": 9
                                        }
                                    ],
                                    "total_count": 1
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    },
                    "503": {
                        "description": "Build log service is temporarily unavailable. Returns a JSON error with code and message."
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/images/{image_name}/tags": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxImageName"
                }
            ],
            "get": {
                "operationId": "ListImageTags",
                "summary": "List image tags",
                "description": "Return one cursor-paginated page of image versions.",
                "tags": [
                    "Images"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "description": "Sort by tag name: name:asc or name:desc. Keep the same sort when following a cursor.",
                        "schema": {
                            "type": "string",
                            "default": "name:asc"
                        }
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Case-sensitive tag name prefix. Cannot be combined with name. Forces ascending name order.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Exact tag name. Cannot be combined with q. Forces ascending name order.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxImageTagsResponseV1"
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/images/{image_name}/tags/{tag_name}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxImageName"
                },
                {
                    "$ref": "#/components/parameters/TagName"
                }
            ],
            "delete": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "DeleteImageTag",
                "summary": "Delete an image tag",
                "description": "Delete a specific image version. Reject deletion if the version is referenced by an active deployment. Return the updated image with its remaining tags, possibly empty.",
                "tags": [
                    "Images"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxImageV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/ImageAfterTagDeletion"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "404": {
                        "$ref": "#/components/responses/SandboxError404"
                    },
                    "409": {
                        "$ref": "#/components/responses/SandboxError409"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        }
    },
    "openapi": "3.1.0",
    "components": {
        "schemas": {
            "PaginationResponseV1": {
                "properties": {
                    "has_more": {
                        "description": "Whether more items exist after this page.",
                        "title": "Has More",
                        "type": "boolean"
                    },
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor to pass into the next request. Null when there is no next page.",
                        "title": "Cursor"
                    }
                },
                "required": [
                    "has_more"
                ],
                "title": "PaginationResponseV1",
                "type": "object"
            },
            "VolumeTagV1": {
                "properties": {
                    "name": {
                        "description": "Tag name. Tags are case-sensitive.",
                        "title": "Name",
                        "type": "string"
                    },
                    "digest": {
                        "description": "Digest of the version the tag points at, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the tag stops resolving and leaves the volume, in ISO 8601 format. Null for a tag that never expires. The version it points at is not affected.",
                        "title": "Expires At"
                    }
                },
                "required": [
                    "name",
                    "digest",
                    "expires_at"
                ],
                "title": "VolumeTagV1",
                "type": "object"
            },
            "VolumeV1": {
                "properties": {
                    "namespace": {
                        "description": "Namespace the volume belongs to, in lowercase.",
                        "title": "Namespace",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the volume, in lowercase.",
                        "title": "Name",
                        "type": "string"
                    },
                    "version_ref": {
                        "description": "Full address of the volume, as `bdn:<namespace>/<volume>`. Paste this into the `bdn.mounts` section of a config.yaml.",
                        "title": "Version Ref",
                        "type": "string"
                    },
                    "sequence": {
                        "description": "Revision counter for the volume, incremented on every commit, tag change, delete, and restore. A tag or version that expires leaves without changing it; the next write then increments it once. Use it to detect that a volume was written to.",
                        "title": "Sequence",
                        "type": "integer"
                    },
                    "updated_at": {
                        "description": "When the volume was last written to, in ISO 8601 format. An expiry does not update it.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the whole volume expires, in ISO 8601 format. At that instant every live version is deleted, every tag drops, and the volume leaves the volume listing; each version then stays restorable until its recovery deadline passes. Null for a volume that never expires.",
                        "title": "Expires At"
                    },
                    "head": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeVersionSummaryV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Version that the reserved `head` tag points at, which a reference with no tag or digest resolves to. Never an expiring version. Null when the volume has no head, or when your API key cannot read it."
                    },
                    "tags": {
                        "description": "Tags on the volume that your API key can read. A tag with `expires_at` leaves this list at that instant.",
                        "items": {
                            "$ref": "#/components/schemas/VolumeTagV1"
                        },
                        "title": "Tags",
                        "type": "array"
                    },
                    "tag_count": {
                        "description": "Total number of tags on the volume, which can exceed the length of `tags` when your API key cannot read all of them. Counts only tags that have not expired.",
                        "title": "Tag Count",
                        "type": "integer"
                    },
                    "versions_alive": {
                        "description": "Number of versions that have not been deleted or expired.",
                        "title": "Versions Alive",
                        "type": "integer"
                    },
                    "versions_tombstoned": {
                        "description": "Number of versions that have been deleted or expired and are still within their recovery window.",
                        "title": "Versions Tombstoned",
                        "type": "integer"
                    },
                    "versions_untagged": {
                        "description": "Number of live versions that no tag points at.",
                        "title": "Versions Untagged",
                        "type": "integer"
                    },
                    "versions_expiring": {
                        "description": "Number of live versions with an expiry still ahead of them. A version that has already expired counts in `versions_tombstoned` instead.",
                        "title": "Versions Expiring",
                        "type": "integer"
                    },
                    "versions_earliest_expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Earliest expiry among the live versions, in ISO 8601 format. Null when no live version is scheduled to expire.",
                        "title": "Versions Earliest Expires At"
                    }
                },
                "required": [
                    "namespace",
                    "name",
                    "version_ref",
                    "sequence",
                    "updated_at",
                    "expires_at",
                    "head",
                    "tags",
                    "tag_count",
                    "versions_alive",
                    "versions_tombstoned",
                    "versions_untagged",
                    "versions_expiring",
                    "versions_earliest_expires_at"
                ],
                "title": "VolumeV1",
                "type": "object"
            },
            "VolumeVersionSummaryV1": {
                "properties": {
                    "digest": {
                        "description": "Content digest of the version, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "total_size_bytes": {
                        "description": "Total size of the version's files in bytes.",
                        "title": "Total Size Bytes",
                        "type": "integer"
                    },
                    "created_at": {
                        "description": "When the version was committed, in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    }
                },
                "required": [
                    "digest",
                    "total_size_bytes",
                    "created_at"
                ],
                "title": "VolumeVersionSummaryV1",
                "type": "object"
            },
            "ListVolumesResponseV1": {
                "description": "A page of volumes in one namespace.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/VolumeV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ListVolumesResponseV1",
                "type": "object"
            },
            "ListVolumesRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of volumes to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "namespace": {
                        "description": "Namespace to list volumes in. Required, because the volume service has no cross-namespace inventory.",
                        "title": "Namespace",
                        "type": "string"
                    }
                },
                "required": [
                    "namespace"
                ],
                "title": "ListVolumesRequestV1",
                "type": "object"
            },
            "VolumeTokenScopeV1": {
                "description": "Capability a volume token grants.\n\n- ``PULL``: read volume data.\n- ``INSPECT``: read volume metadata without data access.\n- ``PUSH``: upload and commit volume versions.\n- ``TAG``: move or remove tags.",
                "enum": [
                    "PULL",
                    "INSPECT",
                    "PUSH",
                    "TAG"
                ],
                "title": "VolumeTokenScopeV1",
                "type": "string"
            },
            "CreateVolumeTokenRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "scopes": {
                        "description": "Capabilities the token grants, at least one. Requesting PUSH or TAG requires organization-level model management permission.",
                        "items": {
                            "$ref": "#/components/schemas/VolumeTokenScopeV1"
                        },
                        "minItems": 1,
                        "title": "Scopes",
                        "type": "array"
                    },
                    "namespaces": {
                        "description": "Volume namespaces the token is limited to, lowercase ASCII, at least one. Pass only the namespaces the operation needs.",
                        "items": {
                            "type": "string"
                        },
                        "minItems": 1,
                        "title": "Namespaces",
                        "type": "array"
                    },
                    "volumes": {
                        "description": "Volume names the token is limited to, lowercase ASCII, exact names only, at least one. The limit applies to every requested scope in every requested namespace.",
                        "items": {
                            "type": "string"
                        },
                        "minItems": 1,
                        "title": "Volumes",
                        "type": "array"
                    },
                    "correlation_id": {
                        "anyOf": [
                            {
                                "maxLength": 128,
                                "pattern": "^[\\x21-\\x7e]+$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional client-chosen identifier, at most 128 printable ASCII characters. Echoed into server logs to link the issued token to a client operation.",
                        "title": "Correlation Id"
                    }
                },
                "required": [
                    "scopes",
                    "namespaces",
                    "volumes"
                ],
                "title": "CreateVolumeTokenRequestV1",
                "type": "object"
            },
            "CreateVolumeTokenResponseV1": {
                "properties": {
                    "token": {
                        "description": "Volume access token. Pass as a bearer token to the volume APIs.",
                        "title": "Token",
                        "type": "string"
                    },
                    "expires_at": {
                        "description": "Token expiry in ISO 8601 format. Tokens cannot be renewed; exchange again for a fresh token.",
                        "format": "date-time",
                        "title": "Expires At",
                        "type": "string"
                    },
                    "scopes": {
                        "description": "Effective capabilities granted.",
                        "items": {
                            "$ref": "#/components/schemas/VolumeTokenScopeV1"
                        },
                        "title": "Scopes",
                        "type": "array"
                    },
                    "namespaces": {
                        "description": "Effective namespaces granted, in canonical lowercase form.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Namespaces",
                        "type": "array"
                    },
                    "volumes": {
                        "description": "Effective volume names granted, in canonical lowercase form.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Volumes",
                        "type": "array"
                    },
                    "bdn_endpoint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Base URL of the volume API this token authenticates against. Null when the environment does not expose a public volume API yet.",
                        "title": "Bdn Endpoint"
                    }
                },
                "required": [
                    "token",
                    "expires_at",
                    "scopes",
                    "namespaces",
                    "volumes",
                    "bdn_endpoint"
                ],
                "title": "CreateVolumeTokenResponseV1",
                "type": "object"
            },
            "ListVolumeNamespacesResponseV1": {
                "description": "A page of namespaces the caller can read.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ListVolumeNamespacesResponseV1",
                "type": "object"
            },
            "ListVolumeNamespacesRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of namespaces to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    }
                },
                "title": "ListVolumeNamespacesRequestV1",
                "type": "object"
            },
            "VolumeSyncAuthenticationAWSAssumeRoleV1": {
                "description": "Authentication using an AWS IAM role assumed by Baseten.",
                "properties": {
                    "role_arn": {
                        "description": "AWS IAM role ARN to assume.",
                        "minLength": 1,
                        "title": "Role Arn",
                        "type": "string"
                    },
                    "region": {
                        "description": "AWS region for the assumed role session.",
                        "minLength": 1,
                        "title": "Region",
                        "type": "string"
                    }
                },
                "required": [
                    "role_arn",
                    "region"
                ],
                "title": "VolumeSyncAuthenticationAWSAssumeRoleV1",
                "type": "object"
            },
            "VolumeSyncAuthenticationAWSOIDCV1": {
                "description": "Authentication using an AWS IAM role and Baseten workload identity.",
                "properties": {
                    "role_arn": {
                        "description": "AWS IAM role ARN to assume through OIDC.",
                        "minLength": 1,
                        "title": "Role Arn",
                        "type": "string"
                    },
                    "region": {
                        "description": "AWS region for the OIDC role session.",
                        "minLength": 1,
                        "title": "Region",
                        "type": "string"
                    }
                },
                "required": [
                    "role_arn",
                    "region"
                ],
                "title": "VolumeSyncAuthenticationAWSOIDCV1",
                "type": "object"
            },
            "VolumeSyncAuthenticationGCPOIDCV1": {
                "description": "Authentication using GCP Workload Identity Federation.",
                "properties": {
                    "service_account": {
                        "description": "GCP service account to impersonate through OIDC.",
                        "minLength": 1,
                        "title": "Service Account",
                        "type": "string"
                    },
                    "workload_identity_provider": {
                        "description": "Full resource name of the GCP workload identity provider.",
                        "minLength": 1,
                        "title": "Workload Identity Provider",
                        "type": "string"
                    }
                },
                "required": [
                    "service_account",
                    "workload_identity_provider"
                ],
                "title": "VolumeSyncAuthenticationGCPOIDCV1",
                "type": "object"
            },
            "VolumeSyncDestinationV1": {
                "description": "BDN destination for a volume sync.",
                "properties": {
                    "ref": {
                        "description": "Destination as bdn:<namespace>/<volume> with an optional tag.",
                        "title": "Ref",
                        "type": "string"
                    }
                },
                "required": [
                    "ref"
                ],
                "title": "VolumeSyncDestinationV1",
                "type": "object"
            },
            "VolumeSyncErrorV1": {
                "description": "Public failure details for a volume sync.",
                "properties": {
                    "code": {
                        "description": "Stable machine-readable failure classification.",
                        "title": "Code",
                        "type": "string"
                    },
                    "message": {
                        "description": "Redacted user-facing failure message.",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "code",
                    "message"
                ],
                "title": "VolumeSyncErrorV1",
                "type": "object"
            },
            "VolumeSyncSourceAzureV1": {
                "description": "Azure Blob Storage source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional workspace secret containing credentials for this source.",
                        "title": "Auth Secret Name"
                    },
                    "type": {
                        "const": "AZURE",
                        "description": "Azure Blob Storage source type.",
                        "title": "Type",
                        "type": "string"
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceAzureV1",
                "type": "object"
            },
            "VolumeSyncSourceBasetenTrainingV1": {
                "description": "Baseten training artifact source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "type": {
                        "const": "BASETEN_TRAINING",
                        "description": "Baseten training artifact source type.",
                        "title": "Type",
                        "type": "string"
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceBasetenTrainingV1",
                "type": "object"
            },
            "VolumeSyncSourceCoreWeaveV1": {
                "description": "CoreWeave object storage source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional workspace secret containing credentials for this source.",
                        "title": "Auth Secret Name"
                    },
                    "type": {
                        "const": "COREWEAVE",
                        "description": "CoreWeave object storage source type.",
                        "title": "Type",
                        "type": "string"
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceCoreWeaveV1",
                "type": "object"
            },
            "VolumeSyncSourceGCSV1": {
                "description": "Google Cloud Storage source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional workspace secret containing credentials for this source.",
                        "title": "Auth Secret Name"
                    },
                    "type": {
                        "const": "GCS",
                        "description": "Google Cloud Storage source type.",
                        "title": "Type",
                        "type": "string"
                    },
                    "gcp_oidc": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncAuthenticationGCPOIDCV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GCP OIDC authentication for this source. Cannot be combined with auth_secret_name."
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceGCSV1",
                "type": "object"
            },
            "VolumeSyncSourceHuggingFaceV1": {
                "description": "Hugging Face source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional workspace secret containing credentials for this source.",
                        "title": "Auth Secret Name"
                    },
                    "type": {
                        "const": "HUGGING_FACE",
                        "description": "Hugging Face source type.",
                        "title": "Type",
                        "type": "string"
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceHuggingFaceV1",
                "type": "object"
            },
            "VolumeSyncSourceR2V1": {
                "description": "Cloudflare R2 source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional workspace secret containing credentials for this source.",
                        "title": "Auth Secret Name"
                    },
                    "type": {
                        "const": "R2",
                        "description": "Cloudflare R2 source type.",
                        "title": "Type",
                        "type": "string"
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceR2V1",
                "type": "object"
            },
            "VolumeSyncSourceS3V1": {
                "description": "Amazon S3 source.",
                "properties": {
                    "uri": {
                        "description": "Remote source URI to materialize into the destination volume.",
                        "title": "Uri",
                        "type": "string"
                    },
                    "include": {
                        "description": "Glob patterns selecting files to include.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Glob patterns selecting files to exclude.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional workspace secret containing credentials for this source.",
                        "title": "Auth Secret Name"
                    },
                    "type": {
                        "const": "S3",
                        "description": "Amazon S3 source type.",
                        "title": "Type",
                        "type": "string"
                    },
                    "aws_assume_role": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncAuthenticationAWSAssumeRoleV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS AssumeRole authentication for this source. Cannot be combined with auth_secret_name."
                    },
                    "aws_oidc": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncAuthenticationAWSOIDCV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS OIDC authentication for this source. Cannot be combined with other authentication fields."
                    }
                },
                "required": [
                    "uri",
                    "type"
                ],
                "title": "VolumeSyncSourceS3V1",
                "type": "object"
            },
            "VolumeSyncStatusV1": {
                "enum": [
                    "PENDING",
                    "SYNCING",
                    "READY",
                    "FAILED",
                    "CANCELED"
                ],
                "title": "VolumeSyncStatusV1",
                "type": "string"
            },
            "VolumeSyncV1": {
                "description": "Current state and result of a volume sync.",
                "properties": {
                    "sync_id": {
                        "description": "Identifier of this sync operation.",
                        "title": "Sync Id",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/VolumeSyncStatusV1",
                        "description": "Current lifecycle state of the sync."
                    },
                    "source": {
                        "description": "Remote source being synced.",
                        "discriminator": {
                            "mapping": {
                                "AZURE": "#/components/schemas/VolumeSyncSourceAzureV1",
                                "BASETEN_TRAINING": "#/components/schemas/VolumeSyncSourceBasetenTrainingV1",
                                "COREWEAVE": "#/components/schemas/VolumeSyncSourceCoreWeaveV1",
                                "GCS": "#/components/schemas/VolumeSyncSourceGCSV1",
                                "HUGGING_FACE": "#/components/schemas/VolumeSyncSourceHuggingFaceV1",
                                "R2": "#/components/schemas/VolumeSyncSourceR2V1",
                                "S3": "#/components/schemas/VolumeSyncSourceS3V1"
                            },
                            "propertyName": "type"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceHuggingFaceV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceS3V1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceGCSV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceAzureV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceR2V1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceCoreWeaveV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceBasetenTrainingV1"
                            }
                        ],
                        "title": "Source"
                    },
                    "destination": {
                        "$ref": "#/components/schemas/VolumeSyncDestinationV1",
                        "description": "BDN volume being populated."
                    },
                    "volume_version_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Produced artifact identifier; null until the sync is ready.",
                        "title": "Volume Version Id"
                    },
                    "version_ref": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Immutable BDN reference; null until the sync is ready.",
                        "title": "Version Ref"
                    },
                    "content_digest": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "BLAKE3 digest of the synced content; null until available.",
                        "title": "Content Digest"
                    },
                    "total_size_bytes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Total size of the synced content in bytes; null until available.",
                        "title": "Total Size Bytes"
                    },
                    "created_at": {
                        "description": "Time at which the sync was created.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "completed_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Time at which the sync reached a terminal state.",
                        "title": "Completed At"
                    },
                    "error": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncErrorV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Redacted failure details; null unless the sync failed."
                    }
                },
                "required": [
                    "sync_id",
                    "status",
                    "source",
                    "destination",
                    "created_at"
                ],
                "title": "VolumeSyncV1",
                "type": "object"
            },
            "VolumeSyncsV1": {
                "description": "A page of volume syncs in the active workspace.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/VolumeSyncV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "VolumeSyncsV1",
                "type": "object"
            },
            "VolumeSyncsRequestV1": {
                "description": "Filters and pagination for listing volume syncs in the active workspace.",
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "ref": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exact destination reference to match.",
                        "title": "Ref"
                    }
                },
                "title": "VolumeSyncsRequestV1",
                "type": "object"
            },
            "CreateVolumeSyncRequestV1": {
                "additionalProperties": false,
                "description": "Request to start an asynchronous volume sync.",
                "properties": {
                    "source": {
                        "description": "Remote source to sync from.",
                        "discriminator": {
                            "mapping": {
                                "AZURE": "#/components/schemas/VolumeSyncSourceAzureV1",
                                "BASETEN_TRAINING": "#/components/schemas/VolumeSyncSourceBasetenTrainingV1",
                                "COREWEAVE": "#/components/schemas/VolumeSyncSourceCoreWeaveV1",
                                "GCS": "#/components/schemas/VolumeSyncSourceGCSV1",
                                "HUGGING_FACE": "#/components/schemas/VolumeSyncSourceHuggingFaceV1",
                                "R2": "#/components/schemas/VolumeSyncSourceR2V1",
                                "S3": "#/components/schemas/VolumeSyncSourceS3V1"
                            },
                            "propertyName": "type"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceHuggingFaceV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceS3V1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceGCSV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceAzureV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceR2V1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceCoreWeaveV1"
                            },
                            {
                                "$ref": "#/components/schemas/VolumeSyncSourceBasetenTrainingV1"
                            }
                        ],
                        "title": "Source"
                    },
                    "destination": {
                        "$ref": "#/components/schemas/VolumeSyncDestinationV1",
                        "description": "BDN volume to sync into."
                    }
                },
                "required": [
                    "source",
                    "destination"
                ],
                "title": "CreateVolumeSyncRequestV1",
                "type": "object"
            },
            "DeleteVolumeRequestV1": {
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Revision the volume is expected to be at. When set, the delete fails with a conflict if the volume has changed since, so it cannot act on a volume someone else has pushed to. Take the value from a volume's sequence, or from volume_sequence.",
                        "title": "Expected Sequence"
                    }
                },
                "title": "DeleteVolumeRequestV1",
                "type": "object"
            },
            "DeleteVolumeResponseV1": {
                "properties": {
                    "namespace": {
                        "description": "Namespace the volume belongs to, in lowercase.",
                        "title": "Namespace",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the volume, in lowercase.",
                        "title": "Name",
                        "type": "string"
                    },
                    "versions_deleted": {
                        "description": "Number of versions this request deleted. Zero when the volume had no live versions left, which is not an error.",
                        "title": "Versions Deleted",
                        "type": "integer"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume after the delete.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "namespace",
                    "name",
                    "versions_deleted",
                    "volume_sequence"
                ],
                "title": "DeleteVolumeResponseV1",
                "type": "object"
            },
            "VolumeVersionV1": {
                "properties": {
                    "namespace": {
                        "description": "Namespace the volume belongs to, in lowercase.",
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume": {
                        "description": "Name of the volume, in lowercase.",
                        "title": "Volume",
                        "type": "string"
                    },
                    "version_ref": {
                        "description": "Full address of this version, as `bdn:<namespace>/<volume>@<digest>`. Paste this into the `bdn.mounts` section of a config.yaml to pin to it.",
                        "title": "Version Ref",
                        "type": "string"
                    },
                    "digest": {
                        "description": "Content digest of the version, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "sequence": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Revision the version was committed at. Null for versions committed before the volume service recorded it.",
                        "title": "Sequence"
                    },
                    "lifecycle": {
                        "description": "Lifecycle state of the version: ALIVE, or TOMBSTONED once it has been deleted or has expired.",
                        "title": "Lifecycle",
                        "type": "string"
                    },
                    "is_head": {
                        "description": "Whether the reserved `head` tag points at this version.",
                        "title": "Is Head",
                        "type": "boolean"
                    },
                    "tags": {
                        "description": "Tags pointing at this version that your API key can read.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Tags",
                        "type": "array"
                    },
                    "total_size_bytes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Total size of the version's files in bytes. Null when not recorded.",
                        "title": "Total Size Bytes"
                    },
                    "created_at": {
                        "description": "When the version was committed, in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the version expires, in ISO 8601 format. At that instant it becomes TOMBSTONED with `tombstoned_at` set to this value, and every tag pointing at it drops. Null for a version that never expires, and null once the lifecycle is TOMBSTONED.",
                        "title": "Expires At"
                    },
                    "tombstoned_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the version was deleted or expired, in ISO 8601 format. Null unless the lifecycle is TOMBSTONED.",
                        "title": "Tombstoned At"
                    },
                    "delete_after": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the version stops being restorable, in ISO 8601 format. Null unless the lifecycle is TOMBSTONED.",
                        "title": "Delete After"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "version_ref",
                    "digest",
                    "sequence",
                    "lifecycle",
                    "is_head",
                    "tags",
                    "total_size_bytes",
                    "created_at",
                    "expires_at",
                    "tombstoned_at",
                    "delete_after"
                ],
                "title": "VolumeVersionV1",
                "type": "object"
            },
            "ListVolumeVersionsResponseV1": {
                "description": "Every version of a volume, newest first.\n\nUnpaginated: `limit` and `cursor` are absent rather than accepted and\nignored, so adding them once the volume service pages this listing is a\npurely additive change.",
                "properties": {
                    "versions": {
                        "description": "Versions of the volume, newest first.",
                        "items": {
                            "$ref": "#/components/schemas/VolumeVersionV1"
                        },
                        "title": "Versions",
                        "type": "array"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume as a whole when the versions were read. Pass it as expected_sequence on a later delete to make that delete conditional on the volume not having changed since. Distinct from the per-version sequence, which is the revision a version was committed at.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "versions",
                    "volume_sequence"
                ],
                "title": "ListVolumeVersionsResponseV1",
                "type": "object"
            },
            "ListVolumeVersionsRequestV1": {
                "properties": {
                    "include_tombstoned": {
                        "default": false,
                        "description": "Whether to include deleted and expired versions. Such a version carries a TOMBSTONED lifecycle and stays restorable until its recovery deadline passes.",
                        "title": "Include Tombstoned",
                        "type": "boolean"
                    }
                },
                "title": "ListVolumeVersionsRequestV1",
                "type": "object"
            },
            "DeleteVolumeVersionRequestV1": {
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Revision the volume is expected to be at. When set, the delete fails with a conflict if the volume has changed since, so a read followed by a delete cannot act on a version a tag has since been moved off. Take the value from volume_sequence.",
                        "title": "Expected Sequence"
                    }
                },
                "title": "DeleteVolumeVersionRequestV1",
                "type": "object"
            },
            "DeleteVolumeVersionResponseV1": {
                "properties": {
                    "namespace": {
                        "description": "Namespace the volume belongs to, in lowercase.",
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume": {
                        "description": "Name of the volume, in lowercase.",
                        "title": "Volume",
                        "type": "string"
                    },
                    "version_ref": {
                        "description": "Full address of the deleted version, as `bdn:<namespace>/<volume>@<digest>`.",
                        "title": "Version Ref",
                        "type": "string"
                    },
                    "digest": {
                        "description": "Content digest of the deleted version, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "lifecycle": {
                        "description": "Lifecycle state of the version after the delete.",
                        "title": "Lifecycle",
                        "type": "string"
                    },
                    "delete_after": {
                        "description": "When the version stops being restorable, in ISO 8601 format. Until then it can be returned to service.",
                        "format": "date-time",
                        "title": "Delete After",
                        "type": "string"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume after the delete.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "version_ref",
                    "digest",
                    "lifecycle",
                    "delete_after",
                    "volume_sequence"
                ],
                "title": "DeleteVolumeVersionResponseV1",
                "type": "object"
            },
            "VolumeVersionDetailV1": {
                "description": "One version, with the fields only a single-version read reports.",
                "properties": {
                    "namespace": {
                        "description": "Namespace the volume belongs to, in lowercase.",
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume": {
                        "description": "Name of the volume, in lowercase.",
                        "title": "Volume",
                        "type": "string"
                    },
                    "version_ref": {
                        "description": "Full address of this version, as `bdn:<namespace>/<volume>@<digest>`. Paste this into the `bdn.mounts` section of a config.yaml to pin to it.",
                        "title": "Version Ref",
                        "type": "string"
                    },
                    "digest": {
                        "description": "Content digest of the version, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "sequence": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Revision the version was committed at. Null for versions committed before the volume service recorded it.",
                        "title": "Sequence"
                    },
                    "lifecycle": {
                        "description": "Lifecycle state of the version: ALIVE, or TOMBSTONED once it has been deleted or has expired.",
                        "title": "Lifecycle",
                        "type": "string"
                    },
                    "is_head": {
                        "description": "Whether the reserved `head` tag points at this version.",
                        "title": "Is Head",
                        "type": "boolean"
                    },
                    "tags": {
                        "description": "Tags pointing at this version that your API key can read.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Tags",
                        "type": "array"
                    },
                    "total_size_bytes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Total size of the version's files in bytes. Null when not recorded.",
                        "title": "Total Size Bytes"
                    },
                    "created_at": {
                        "description": "When the version was committed, in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the version expires, in ISO 8601 format. At that instant it becomes TOMBSTONED with `tombstoned_at` set to this value, and every tag pointing at it drops. Null for a version that never expires, and null once the lifecycle is TOMBSTONED.",
                        "title": "Expires At"
                    },
                    "tombstoned_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the version was deleted or expired, in ISO 8601 format. Null unless the lifecycle is TOMBSTONED.",
                        "title": "Tombstoned At"
                    },
                    "delete_after": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the version stops being restorable, in ISO 8601 format. Null unless the lifecycle is TOMBSTONED.",
                        "title": "Delete After"
                    },
                    "entry_count": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Number of files in the version. Null when not recorded.",
                        "title": "Entry Count"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume as a whole when this version was read. Pass it as expected_sequence on a later delete to make that delete conditional on the volume not having changed since.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "version_ref",
                    "digest",
                    "sequence",
                    "lifecycle",
                    "is_head",
                    "tags",
                    "total_size_bytes",
                    "created_at",
                    "expires_at",
                    "tombstoned_at",
                    "delete_after",
                    "entry_count",
                    "volume_sequence"
                ],
                "title": "VolumeVersionDetailV1",
                "type": "object"
            },
            "RestoreVolumeVersionRequestV1": {
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Revision the volume is expected to be at. When set, the restore fails with a conflict if the volume has changed since. Take the value from volume_sequence.",
                        "title": "Expected Sequence"
                    }
                },
                "title": "RestoreVolumeVersionRequestV1",
                "type": "object"
            },
            "RestoreVolumeVersionResponseV1": {
                "properties": {
                    "namespace": {
                        "description": "Namespace the volume belongs to, in lowercase.",
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume": {
                        "description": "Name of the volume, in lowercase.",
                        "title": "Volume",
                        "type": "string"
                    },
                    "version_ref": {
                        "description": "Full address of the restored version, as `bdn:<namespace>/<volume>@<digest>`.",
                        "title": "Version Ref",
                        "type": "string"
                    },
                    "digest": {
                        "description": "Content digest of the restored version, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "lifecycle": {
                        "description": "Lifecycle state of the version after the restore.",
                        "title": "Lifecycle",
                        "type": "string"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume after the restore.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "version_ref",
                    "digest",
                    "lifecycle",
                    "volume_sequence"
                ],
                "title": "RestoreVolumeVersionResponseV1",
                "type": "object"
            },
            "TokenScopeV1": {
                "description": "What a token minted by POST /v1/token grants access to.",
                "enum": [
                    "sandboxes"
                ],
                "title": "TokenScopeV1",
                "type": "string"
            },
            "CreateTokenRequestV1": {
                "properties": {
                    "scopes": {
                        "description": "What the token should grant access to. Only `sandboxes` is supported today; the token then authenticates against the sandbox API.",
                        "examples": [
                            [
                                "sandboxes"
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/TokenScopeV1"
                        },
                        "minItems": 1,
                        "title": "Scopes",
                        "type": "array"
                    }
                },
                "required": [
                    "scopes"
                ],
                "title": "CreateTokenRequestV1",
                "type": "object"
            },
            "TokenV1": {
                "properties": {
                    "token": {
                        "description": "Short-lived bearer token for the sandbox API. Send it as Authorization: Bearer <token>.",
                        "title": "Token",
                        "type": "string"
                    },
                    "expires_at": {
                        "description": "Token expiry in ISO 8601 format. Tokens cannot be renewed; request a new one.",
                        "format": "date-time",
                        "title": "Expires At",
                        "type": "string"
                    }
                },
                "required": [
                    "token",
                    "expires_at"
                ],
                "title": "TokenV1",
                "type": "object"
            },
            "SecretV1": {
                "description": "A Baseten secret. Note that we do not support retrieving secret values.",
                "properties": {
                    "id": {
                        "description": "Stable identifier for the secret. Unchanged across rotation.",
                        "examples": [
                            "3kZ9xqd"
                        ],
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the secret was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the secret",
                        "title": "Name",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team the secret belongs to",
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "name",
                    "team_name"
                ],
                "title": "SecretV1",
                "type": "object"
            },
            "SecretsV1": {
                "description": "A list of Baseten secrets.",
                "properties": {
                    "secrets": {
                        "items": {
                            "$ref": "#/components/schemas/SecretV1"
                        },
                        "title": "Secrets",
                        "type": "array"
                    }
                },
                "required": [
                    "secrets"
                ],
                "title": "SecretsV1",
                "type": "object"
            },
            "UpsertSecretRequestV1": {
                "description": "A request to create or update a Baseten secret by name.",
                "properties": {
                    "name": {
                        "description": "Name of the new or existing secret",
                        "examples": [
                            "my_secret"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "value": {
                        "description": "Value of the secret",
                        "examples": [
                            "my_secret_value"
                        ],
                        "title": "Value",
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "value"
                ],
                "title": "UpsertSecretRequestV1",
                "type": "object"
            },
            "SecretTombstoneV1": {
                "description": "A secret tombstone.",
                "properties": {
                    "name": {
                        "description": "Name of the deleted secret",
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "SecretTombstoneV1",
                "type": "object"
            },
            "EnvironmentGroupManageAccessV1": {
                "description": "Who is allowed to manage an environment group.",
                "properties": {
                    "is_restricted": {
                        "description": "Whether the environment is restricted to a specific set of users.",
                        "title": "Is Restricted",
                        "type": "boolean"
                    },
                    "users": {
                        "description": "Users who can manage the environment while it is restricted, including organization and team admins who always have access. Empty when the environment is unrestricted.",
                        "items": {
                            "$ref": "#/components/schemas/EnvironmentGroupUserV1"
                        },
                        "title": "Users",
                        "type": "array"
                    }
                },
                "required": [
                    "is_restricted"
                ],
                "title": "EnvironmentGroupManageAccessV1",
                "type": "object"
            },
            "EnvironmentGroupUserV1": {
                "description": "A user referenced by an environment group's manage access.",
                "properties": {
                    "user_id": {
                        "description": "Unique identifier for the user.",
                        "title": "User Id",
                        "type": "string"
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Email address of the user.",
                        "title": "Email"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the user.",
                        "title": "Name"
                    }
                },
                "required": [
                    "user_id"
                ],
                "title": "EnvironmentGroupUserV1",
                "type": "object"
            },
            "EnvironmentGroupV1": {
                "description": "A team-scoped grouping of same-named environments (e.g. \"production\", \"staging\").\n\nRestricting an environment group limits who can manage the environment of that name\nacross every model and chain in the team.",
                "properties": {
                    "name": {
                        "description": "Name of the environment group, matching the environment name it governs.",
                        "examples": [
                            "staging"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "team_id": {
                        "description": "Unique identifier of the team the environment group belongs to.",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team the environment group belongs to.",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "manage_access": {
                        "$ref": "#/components/schemas/EnvironmentGroupManageAccessV1",
                        "description": "Settings controlling who can manage this environment group."
                    }
                },
                "required": [
                    "name",
                    "team_id",
                    "team_name",
                    "manage_access"
                ],
                "title": "EnvironmentGroupV1",
                "type": "object"
            },
            "EnvironmentGroupsV1": {
                "description": "A page of environment groups.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/EnvironmentGroupV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "EnvironmentGroupsV1",
                "type": "object"
            },
            "UpdateEnvironmentGroupManageAccessV1": {
                "description": "Manage-access settings to apply to an environment group.",
                "properties": {
                    "is_restricted": {
                        "description": "Whether to restrict this environment to a specific set of users.",
                        "title": "Is Restricted",
                        "type": "boolean"
                    },
                    "user_ids": {
                        "description": "IDs of users granted manage access while restricted. Only meaningful when is_restricted is true.",
                        "items": {
                            "type": "string"
                        },
                        "title": "User Ids",
                        "type": "array"
                    }
                },
                "required": [
                    "is_restricted"
                ],
                "title": "UpdateEnvironmentGroupManageAccessV1",
                "type": "object"
            },
            "UpdateEnvironmentGroupRequestV1": {
                "description": "A request to update an existing environment group.",
                "properties": {
                    "manage_access": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateEnvironmentGroupManageAccessV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Manage-access settings to apply. Omit to leave manage access unchanged."
                    }
                },
                "title": "UpdateEnvironmentGroupRequestV1",
                "type": "object"
            },
            "TeamV1": {
                "description": "A team.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the team",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the team",
                        "title": "Name",
                        "type": "string"
                    },
                    "default": {
                        "type": "boolean",
                        "description": "Whether this is the default team for the organization",
                        "title": "Default"
                    },
                    "created_at": {
                        "description": "Time the team was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "default",
                    "created_at"
                ],
                "title": "TeamV1",
                "type": "object"
            },
            "TeamsV1": {
                "description": "A list of teams.",
                "properties": {
                    "teams": {
                        "description": "A list of teams",
                        "items": {
                            "$ref": "#/components/schemas/TeamV1"
                        },
                        "title": "Teams",
                        "type": "array"
                    }
                },
                "required": [
                    "teams"
                ],
                "title": "TeamsV1",
                "type": "object"
            },
            "TeamsRequestV1": {
                "description": "Request parameters for listing teams.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When set, returns only the team with this exact name, if any.",
                        "title": "Name"
                    }
                },
                "title": "TeamsRequestV1",
                "type": "object"
            },
            "RegionV1": {
                "description": "A region that deployments can be placed in.",
                "properties": {
                    "slug": {
                        "description": "Stable identifier for the region, used when selecting a deployment region.",
                        "examples": [
                            "us"
                        ],
                        "title": "Slug",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Human-readable name of the region.",
                        "examples": [
                            "United States"
                        ],
                        "title": "Display Name",
                        "type": "string"
                    }
                },
                "required": [
                    "slug",
                    "display_name"
                ],
                "title": "RegionV1",
                "type": "object"
            },
            "RegionsV1": {
                "description": "A list of regions.",
                "properties": {
                    "regions": {
                        "items": {
                            "$ref": "#/components/schemas/RegionV1"
                        },
                        "title": "Regions",
                        "type": "array"
                    }
                },
                "required": [
                    "regions"
                ],
                "title": "RegionsV1",
                "type": "object"
            },
            "InstanceTypeV1": {
                "description": "An instance type.",
                "properties": {
                    "id": {
                        "description": "Identifier string for the instance type",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Display name of the instance type",
                        "title": "Name",
                        "type": "string"
                    },
                    "memory_limit_mib": {
                        "description": "Memory limit of the instance type in Mebibytes",
                        "title": "Memory Limit Mib",
                        "type": "integer"
                    },
                    "millicpu_limit": {
                        "description": "CPU limit of the instance type in millicpu",
                        "title": "Millicpu Limit",
                        "type": "integer"
                    },
                    "gpu_count": {
                        "description": "Number of GPUs on the instance type",
                        "title": "Gpu Count",
                        "type": "integer"
                    },
                    "gpu_type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Type of GPU on the instance type",
                        "title": "Gpu Type"
                    },
                    "gpu_memory_limit_mib": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Memory limit of the GPU on the instance type in Mebibytes",
                        "title": "Gpu Memory Limit Mib"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "memory_limit_mib",
                    "millicpu_limit",
                    "gpu_count",
                    "gpu_type",
                    "gpu_memory_limit_mib"
                ],
                "title": "InstanceTypeV1",
                "type": "object"
            },
            "InstanceTypesV1": {
                "description": "A list of instance types.",
                "properties": {
                    "instance_types": {
                        "items": {
                            "$ref": "#/components/schemas/InstanceTypeV1"
                        },
                        "title": "Instance Types",
                        "type": "array"
                    }
                },
                "required": [
                    "instance_types"
                ],
                "title": "InstanceTypesV1",
                "type": "object"
            },
            "LoopsUserConfigV1": {
                "description": "The caller's Loops user-level config (accelerator priorities).",
                "properties": {
                    "trainer_accelerator_priority": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Ordered allowlist of GPU types for your Loops trainer deployments, highest priority first. Intersected with the org-level allowlist (org acts as a ceiling). Null means 'inherit the org-level allowlist'.",
                        "examples": [
                            [
                                "H100",
                                "H200"
                            ]
                        ],
                        "title": "Trainer Accelerator Priority"
                    },
                    "sampler_accelerator_priority": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Ordered allowlist of GPU types for your Loops sampler deployments, highest priority first. Intersected with the org-level allowlist (org acts as a ceiling). Null means 'inherit the org-level allowlist'.",
                        "examples": [
                            [
                                "H100",
                                "H200"
                            ]
                        ],
                        "title": "Sampler Accelerator Priority"
                    }
                },
                "required": [
                    "trainer_accelerator_priority",
                    "sampler_accelerator_priority"
                ],
                "title": "LoopsUserConfigV1",
                "type": "object"
            },
            "GetLoopsUserConfigResponseV1": {
                "description": "Response for ``GET /v1/loops/user_config``.",
                "properties": {
                    "user_config": {
                        "$ref": "#/components/schemas/LoopsUserConfigV1",
                        "description": "The caller's Loops user config."
                    }
                },
                "required": [
                    "user_config"
                ],
                "title": "GetLoopsUserConfigResponseV1",
                "type": "object"
            },
            "PatchLoopsUserConfigRequestV1": {
                "description": "Request body for ``PATCH /v1/loops/user_config``.\n\nFollows JSON Merge Patch (RFC 7396) semantics per field: omit the field\nto leave it unchanged, send ``null`` to clear and inherit the org-level\nallowlist, send a list to set the allowlist. Empty lists are rejected\nbecause the storage layer normalizes ``null`` and ``[]`` identically, so\naccepting both would create two ways to spell the same intent.",
                "properties": {
                    "trainer_accelerator_priority": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Ordered list of GPU types for trainer deployments, highest priority first. Send a list to set; send null to clear (inherit org allowlist); omit to leave unchanged. Empty list is rejected.",
                        "examples": [
                            [
                                "H100",
                                "H200"
                            ]
                        ],
                        "title": "Trainer Accelerator Priority",
                        "x-null-distinct": true
                    },
                    "sampler_accelerator_priority": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Ordered list of GPU types for sampler deployments, highest priority first. Send a list to set; send null to clear (inherit org allowlist); omit to leave unchanged. Empty list is rejected.",
                        "examples": [
                            [
                                "H100",
                                "H200"
                            ]
                        ],
                        "title": "Sampler Accelerator Priority",
                        "x-null-distinct": true
                    }
                },
                "title": "PatchLoopsUserConfigRequestV1",
                "type": "object"
            },
            "PatchLoopsUserConfigResponseV1": {
                "description": "Response for ``PATCH /v1/loops/user_config``.",
                "properties": {
                    "user_config": {
                        "$ref": "#/components/schemas/LoopsUserConfigV1",
                        "description": "The updated Loops user config."
                    }
                },
                "required": [
                    "user_config"
                ],
                "title": "PatchLoopsUserConfigResponseV1",
                "type": "object"
            },
            "InstanceTypeWithPriceV1": {
                "properties": {
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type properties."
                    },
                    "price": {
                        "description": "Usage price in USD / minute.",
                        "title": "Price",
                        "type": "number"
                    }
                },
                "required": [
                    "instance_type",
                    "price"
                ],
                "title": "InstanceTypeWithPriceV1",
                "type": "object"
            },
            "InstanceTypePricesV1": {
                "description": "A list of instance types.",
                "properties": {
                    "instance_types": {
                        "items": {
                            "$ref": "#/components/schemas/InstanceTypeWithPriceV1"
                        },
                        "title": "Instance Types",
                        "type": "array"
                    }
                },
                "required": [
                    "instance_types"
                ],
                "title": "InstanceTypePricesV1",
                "type": "object"
            },
            "DeploymentArchivePayloadV1": {
                "description": "Deployment-level fields for a model-archive push.\n\nShared by every endpoint that creates a deployment from an uploaded archive:\n`POST /v1/prepare_model_upload`, the `model_archive` source on `POST\n/v1/models`, and `POST /v1/models/{model_id}/deployments`.",
                "properties": {
                    "config": {
                        "additionalProperties": true,
                        "description": "Parsed model config as a JSON object.",
                        "title": "Config",
                        "type": "object"
                    },
                    "raw_config": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Original config.yaml text, persisted as-is on the deployment. Best-effort: invalid raw configs are logged and dropped without failing the request.",
                        "title": "Raw Config"
                    },
                    "user_env": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Client environment metadata (e.g. client version, Python version). Validated server-side.",
                        "title": "User Env"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Stable environment to push to (e.g. `production`). If unset, the deployment is created without environment selection. Caller must have push permission for the named environment.",
                        "title": "Environment Name"
                    },
                    "create_environment_if_missing": {
                        "default": true,
                        "description": "Create the environment named by `environment_name` if it does not exist yet. If false, a push to an environment that does not exist is rejected. Only meaningful when `environment_name` is set to something other than `production`, which always exists. This field currently defaults to true, but that default will change to false in a future release. Set it explicitly to avoid a behavior change.",
                        "title": "Create Environment If Missing",
                        "type": "boolean"
                    },
                    "region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Region in which to deploy the model",
                        "title": "Region"
                    },
                    "preserve_env_instance_type": {
                        "default": true,
                        "description": "Retain the target environment's current instance type rather than the one in `config`. Only meaningful when `environment_name` is set and that environment already exists.",
                        "title": "Preserve Env Instance Type",
                        "type": "boolean"
                    },
                    "deploy_timeout_minutes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Deploy timeout in minutes; allowed range 10 to 1440. Server default applies if unset.",
                        "title": "Deploy Timeout Minutes"
                    },
                    "deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional human-readable name for the deployment.",
                        "title": "Deployment Name"
                    },
                    "labels": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-provided key-value labels for the deployment.",
                        "title": "Labels"
                    },
                    "is_development": {
                        "default": false,
                        "description": "If true, push as a development deployment: the model's single mutable dev slot, created if absent and overwritten in place otherwise. The following fields must be left at their defaults: `environment_name`, `preserve_env_instance_type`, `deployment_name`.",
                        "title": "Is Development",
                        "type": "boolean"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "DeploymentArchivePayloadV1",
                "type": "object"
            },
            "PrepareModelUploadRequestV1": {
                "description": "Body for `POST /v1/prepare_model_upload`.\n\nValidates the same payload the commit endpoint will validate, and on\n`dry_run=false` issues STS upload credentials. Exactly one of `name` or\n`model_id` is required: `name` validates the new-model path (`POST\n/v1/models`); `model_id` validates the add-deployment path (`POST\n/v1/models/{model_id}/deployments`).",
                "properties": {
                    "deployment": {
                        "$ref": "#/components/schemas/DeploymentArchivePayloadV1",
                        "description": "Deployment-level payload, identical to the payload sent at commit."
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Set to validate a new-model push. Exactly one of `name` or `model_id` is required.",
                        "title": "Name"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team the new model will belong to. Only valid when `name` is set; defaults to the organization's default team when omitted. Must not be set when `model_id` is set (the existing model already has a team).",
                        "title": "Team Id"
                    },
                    "model_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Set to validate an add-deployment push to an existing model. Exactly one of `name` or `model_id` is required.",
                        "title": "Model Id"
                    },
                    "dry_run": {
                        "default": false,
                        "description": "If true, validate the payload only and do not issue upload credentials. The response sets `creds`, `s3_bucket`, and `s3_key` to `null`.",
                        "title": "Dry Run",
                        "type": "boolean"
                    }
                },
                "required": [
                    "deployment"
                ],
                "title": "PrepareModelUploadRequestV1",
                "type": "object"
            },
            "AWSCredentialsV1": {
                "description": "AWS credentials",
                "properties": {
                    "aws_access_key_id": {
                        "description": "The AWS access key ID",
                        "title": "Aws Access Key Id",
                        "type": "string"
                    },
                    "aws_secret_access_key": {
                        "description": "The AWS secret access key",
                        "title": "Aws Secret Access Key",
                        "type": "string"
                    },
                    "aws_session_token": {
                        "description": "The AWS session token",
                        "title": "Aws Session Token",
                        "type": "string"
                    }
                },
                "required": [
                    "aws_access_key_id",
                    "aws_secret_access_key",
                    "aws_session_token"
                ],
                "title": "AWSCredentialsV1",
                "type": "object"
            },
            "PrepareModelUploadResponseV1": {
                "description": "Response from `POST /v1/prepare_model_upload`.\n\nReturns STS upload credentials when the push requires an archive upload. All\nfour fields (`creds`, `s3_bucket`, `s3_key`, `s3_region`) are `null` when no\nupload is needed: either `dry_run=true` (validation only) or a model format\nthat is not built from an uploaded archive (for example, BIS-LLM, which is\nbuilt from its config alone).",
                "properties": {
                    "creds": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AWSCredentialsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "STS credentials to upload the model archive. Null when no archive upload is required."
                    },
                    "s3_bucket": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "S3 bucket the credentials are scoped to. Null when no archive upload is required.",
                        "title": "S3 Bucket"
                    },
                    "s3_key": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "S3 key the credentials are scoped to. Pass this to `POST /v1/models` (in the `model_archive` source) once the upload completes. Null when no archive upload is required.",
                        "title": "S3 Key"
                    },
                    "s3_region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS region the S3 bucket resides in. Null when no archive upload is required.",
                        "title": "S3 Region"
                    }
                },
                "title": "PrepareModelUploadResponseV1",
                "type": "object"
            },
            "AuditLogActorTypeV1": {
                "description": "Kind of actor that performed an audited action.",
                "enum": [
                    "USER",
                    "API_KEY",
                    "BASETEN_USER",
                    "BASETEN_SYSTEM",
                    "TOMBSTONE_USER"
                ],
                "title": "AuditLogActorTypeV1",
                "type": "string"
            },
            "AuditLogActorV1": {
                "description": "The actor that performed an audited action.",
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/AuditLogActorTypeV1",
                        "description": "Kind of actor that performed the action."
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Email of the acting user, when the actor is a user.",
                        "title": "Email"
                    },
                    "api_key_prefix": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Prefix of the acting API key, when the actor is an API key.",
                        "title": "Api Key Prefix"
                    },
                    "api_key_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the acting API key, when the actor is an API key.",
                        "title": "Api Key Name"
                    }
                },
                "required": [
                    "type"
                ],
                "title": "AuditLogActorV1",
                "type": "object"
            },
            "AuditLogApiKeyTypeV1": {
                "description": "Type of API key recorded on an API-key event.",
                "enum": [
                    "PERSONAL",
                    "CREATOR_SERVICE_ACCOUNT",
                    "MANAGE_API_KEYS_SERVICE_ACCOUNT",
                    "INVOKE_ALL_MODELS_SERVICE_ACCOUNT",
                    "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT",
                    "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT",
                    "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT",
                    "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT",
                    "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT",
                    "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT",
                    "INVOKE_ALL_ROUTES"
                ],
                "title": "AuditLogApiKeyTypeV1",
                "type": "string"
            },
            "AuditLogEntryV1": {
                "description": "A single audit-log entry.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the audit-log entry.",
                        "title": "Id",
                        "type": "string"
                    },
                    "created": {
                        "description": "Time the action occurred, in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created",
                        "type": "string"
                    },
                    "event_type": {
                        "$ref": "#/components/schemas/AuditLogEventTypeV1",
                        "description": "Type of action that was recorded."
                    },
                    "event_data": {
                        "description": "Structured details of the action, discriminated by `event_type`.",
                        "discriminator": {
                            "mapping": {
                                "API_KEY_CREATED": "#/components/schemas/AuditLogEventApiKeyCreatedV1",
                                "API_KEY_DELETED": "#/components/schemas/AuditLogEventApiKeyDeletedV1",
                                "CHAINLET_AUTOSCALING_SETTINGS_CHANGED": "#/components/schemas/AuditLogEventChainletAutoscalingSettingsChangedV1",
                                "CHAINLET_INSTANCE_TYPE_CHANGED": "#/components/schemas/AuditLogEventChainletInstanceTypeChangedV1",
                                "CHAIN_DELETED": "#/components/schemas/AuditLogEventChainDeletedV1",
                                "CHAIN_DEPLOYED": "#/components/schemas/AuditLogEventChainDeployedV1",
                                "CHAIN_DEPLOYMENT_ACTIVATED": "#/components/schemas/AuditLogEventChainDeploymentActivatedV1",
                                "CHAIN_DEPLOYMENT_DEACTIVATED": "#/components/schemas/AuditLogEventChainDeploymentDeactivatedV1",
                                "CHAIN_DEPLOYMENT_DELETED": "#/components/schemas/AuditLogEventChainDeploymentDeletedV1",
                                "CHAIN_DEPLOYMENT_PROMOTED": "#/components/schemas/AuditLogEventChainDeploymentPromotedV1",
                                "CHAIN_ENVIRONMENT_CREATED": "#/components/schemas/AuditLogEventChainEnvironmentCreatedV1",
                                "CHAIN_ENVIRONMENT_UPDATED": "#/components/schemas/AuditLogEventChainEnvironmentUpdatedV1",
                                "DIRECTORY_GROUP_ROLE_UPDATED": "#/components/schemas/AuditLogEventDirectoryGroupRoleUpdatedV1",
                                "ENVIRONMENT_CREATED": "#/components/schemas/AuditLogEventEnvironmentCreatedV1",
                                "ENVIRONMENT_DELETED": "#/components/schemas/AuditLogEventEnvironmentDeletedV1",
                                "ENVIRONMENT_UPDATED": "#/components/schemas/AuditLogEventEnvironmentUpdatedV1",
                                "GATEWAY_ENDPOINT_CREATED": "#/components/schemas/AuditLogEventGatewayEndpointCreatedV1",
                                "GATEWAY_ENDPOINT_DELETED": "#/components/schemas/AuditLogEventGatewayEndpointDeletedV1",
                                "GATEWAY_ENDPOINT_UPDATED": "#/components/schemas/AuditLogEventGatewayEndpointUpdatedV1",
                                "MODEL_DELETED": "#/components/schemas/AuditLogEventModelDeletedV1",
                                "MODEL_DEPLOYED": "#/components/schemas/AuditLogEventModelDeployedV1",
                                "MODEL_DEPLOYMENT_ACTIVATED": "#/components/schemas/AuditLogEventModelDeploymentActivatedV1",
                                "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED": "#/components/schemas/AuditLogEventModelDeploymentAutoscalingSettingsChangedV1",
                                "MODEL_DEPLOYMENT_DEACTIVATED": "#/components/schemas/AuditLogEventModelDeploymentDeactivatedV1",
                                "MODEL_DEPLOYMENT_DELETED": "#/components/schemas/AuditLogEventModelDeploymentDeletedV1",
                                "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED": "#/components/schemas/AuditLogEventModelDeploymentInstanceTypeChangedV1",
                                "MODEL_DEPLOYMENT_PROMOTED": "#/components/schemas/AuditLogEventModelDeploymentPromotedV1",
                                "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED": "#/components/schemas/AuditLogEventModelDeploymentRequestBackpressureSettingsChangedV1",
                                "MODEL_DEPLOYMENT_RETRIED": "#/components/schemas/AuditLogEventModelDeploymentRetriedV1",
                                "MODEL_PROMOTION_CONTROL_ACTION": "#/components/schemas/AuditLogEventModelPromotionControlActionV1",
                                "MODEL_RENAMED": "#/components/schemas/AuditLogEventModelRenamedV1",
                                "PROVIDER_CONNECTION_CREATED": "#/components/schemas/AuditLogEventProviderConnectionCreatedV1",
                                "PROVIDER_CONNECTION_DELETED": "#/components/schemas/AuditLogEventProviderConnectionDeletedV1",
                                "PROVIDER_CONNECTION_UPDATED": "#/components/schemas/AuditLogEventProviderConnectionUpdatedV1",
                                "REPLICA_TERMINATED": "#/components/schemas/AuditLogEventReplicaTerminatedV1",
                                "REQUIRE_GROUP_BASED_ADMINS_ENABLED": "#/components/schemas/AuditLogEventRequireGroupBasedAdminsEnabledV1",
                                "SECRET_DELETED": "#/components/schemas/AuditLogEventSecretDeletedV1",
                                "SECRET_UPDATED": "#/components/schemas/AuditLogEventSecretUpdatedV1",
                                "SSH_CERTIFICATE_SIGNED": "#/components/schemas/AuditLogEventSshCertificateSignedV1",
                                "USER_INVITED": "#/components/schemas/AuditLogEventUserInvitedV1",
                                "USER_JOINED_ORGANIZATION": "#/components/schemas/AuditLogEventUserJoinedOrganizationV1",
                                "USER_REMOVED": "#/components/schemas/AuditLogEventUserRemovedV1",
                                "USER_ROLE_UPDATED": "#/components/schemas/AuditLogEventUserRoleUpdatedV1",
                                "USER_TEAM_ROLE_UPDATED": "#/components/schemas/AuditLogEventUserTeamRoleUpdatedV1",
                                "VOLUME_DELETED": "#/components/schemas/AuditLogEventVolumeDeletedV1",
                                "VOLUME_VERSION_DELETED": "#/components/schemas/AuditLogEventVolumeVersionDeletedV1",
                                "VOLUME_VERSION_RESTORED": "#/components/schemas/AuditLogEventVolumeVersionRestoredV1",
                                "WEBHOOK_SIGNING_SECRET_CREATED": "#/components/schemas/AuditLogEventWebhookSigningSecretCreatedV1",
                                "WEBHOOK_SIGNING_SECRET_DELETED": "#/components/schemas/AuditLogEventWebhookSigningSecretDeletedV1",
                                "WEBHOOK_SIGNING_SECRET_ROTATED": "#/components/schemas/AuditLogEventWebhookSigningSecretRotatedV1"
                            },
                            "propertyName": "event_type"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeployedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentActivatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentDeactivatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentRetriedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentPromotedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentAutoscalingSettingsChangedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentRequestBackpressureSettingsChangedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentInstanceTypeChangedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeploymentDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelRenamedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainDeployedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainDeploymentActivatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainDeploymentDeactivatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainDeploymentPromotedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainletAutoscalingSettingsChangedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainletInstanceTypeChangedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainDeploymentDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainEnvironmentCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventChainEnvironmentUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventSecretUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventSecretDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventApiKeyCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventApiKeyDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGatewayEndpointCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGatewayEndpointUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGatewayEndpointDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventProviderConnectionCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventProviderConnectionUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventProviderConnectionDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventUserInvitedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventUserJoinedOrganizationV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventWebhookSigningSecretCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventWebhookSigningSecretRotatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventWebhookSigningSecretDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventUserRoleUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventUserTeamRoleUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventUserRemovedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventDirectoryGroupRoleUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventRequireGroupBasedAdminsEnabledV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventEnvironmentCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventEnvironmentUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventEnvironmentDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventReplicaTerminatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventModelPromotionControlActionV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventSshCertificateSignedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventVolumeDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventVolumeVersionDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventVolumeVersionRestoredV1"
                            }
                        ],
                        "title": "Event Data"
                    },
                    "source": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogSourceV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Surface that issued the action, if known."
                    },
                    "actor": {
                        "$ref": "#/components/schemas/AuditLogActorV1",
                        "description": "The actor that performed the action."
                    },
                    "client_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the client that issued the action, if known.",
                        "title": "Client Name"
                    },
                    "client_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Version of the client that issued the action, if known.",
                        "title": "Client Version"
                    },
                    "client_session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque identifier grouping actions from the same client session, if known.",
                        "title": "Client Session Id"
                    }
                },
                "required": [
                    "id",
                    "created",
                    "event_type",
                    "event_data",
                    "actor"
                ],
                "title": "AuditLogEntryV1",
                "type": "object"
            },
            "AuditLogEventApiKeyCreatedV1": {
                "description": "An API key was created.",
                "properties": {
                    "event_type": {
                        "const": "API_KEY_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "api_key_id": {
                        "title": "Api Key Id",
                        "type": "string"
                    },
                    "api_key_type": {
                        "$ref": "#/components/schemas/AuditLogApiKeyTypeV1"
                    },
                    "prefix": {
                        "title": "Prefix",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "api_key_id",
                    "api_key_type",
                    "prefix"
                ],
                "title": "AuditLogEventApiKeyCreatedV1",
                "type": "object"
            },
            "AuditLogEventApiKeyDeletedV1": {
                "description": "An API key was revoked.",
                "properties": {
                    "event_type": {
                        "const": "API_KEY_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "api_key_id": {
                        "title": "Api Key Id",
                        "type": "string"
                    },
                    "api_key_type": {
                        "$ref": "#/components/schemas/AuditLogApiKeyTypeV1"
                    },
                    "prefix": {
                        "title": "Prefix",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "api_key_id",
                    "api_key_type",
                    "prefix"
                ],
                "title": "AuditLogEventApiKeyDeletedV1",
                "type": "object"
            },
            "AuditLogEventAutoscalingScheduleActionV1": {
                "description": "What an autoscaling change did to one schedule.",
                "enum": [
                    "CREATED",
                    "UPDATED",
                    "DELETED",
                    "UNCHANGED"
                ],
                "title": "AuditLogEventAutoscalingScheduleActionV1",
                "type": "string"
            },
            "AuditLogEventAutoscalingScheduleChangeV1": {
                "description": "What an autoscaling change did to one schedule, and the schedule on either side of it.\n`previous` is null on a create, `current` on a delete, and an unchanged schedule carries only\n`current`. Not itself a payload in the discriminated union.",
                "properties": {
                    "action": {
                        "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleActionV1"
                    },
                    "schedule_id": {
                        "title": "Schedule Id",
                        "type": "string"
                    },
                    "previous": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "current": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "action",
                    "schedule_id",
                    "previous",
                    "current"
                ],
                "title": "AuditLogEventAutoscalingScheduleChangeV1",
                "type": "object"
            },
            "AuditLogEventAutoscalingScheduleSettingsV1": {
                "description": "One autoscaling schedule's timing and autoscaling settings. Not itself a union payload.",
                "properties": {
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Concurrency Target"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    },
                    "schedule_name": {
                        "title": "Schedule Name",
                        "type": "string"
                    },
                    "enabled": {
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "cadence": {
                        "title": "Cadence",
                        "type": "string"
                    },
                    "timezone": {
                        "title": "Timezone",
                        "type": "string"
                    },
                    "weekdays": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Weekdays"
                    },
                    "start_hour": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Start Hour"
                    },
                    "start_minute": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Start Minute"
                    },
                    "end_hour": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "End Hour"
                    },
                    "end_minute": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "End Minute"
                    },
                    "start_at": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Start At"
                    },
                    "end_at": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "End At"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "schedule_name",
                    "enabled",
                    "cadence",
                    "timezone",
                    "weekdays",
                    "start_hour",
                    "start_minute",
                    "end_hour",
                    "end_minute"
                ],
                "title": "AuditLogEventAutoscalingScheduleSettingsV1",
                "type": "object"
            },
            "AuditLogEventAutoscalingSettingsV1": {
                "description": "Autoscaling settings for a deployment or environment.",
                "properties": {
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate"
                ],
                "title": "AuditLogEventAutoscalingSettingsV1",
                "type": "object"
            },
            "AuditLogEventChainDeletedV1": {
                "description": "A chain was deleted.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_name"
                ],
                "title": "AuditLogEventChainDeletedV1",
                "type": "object"
            },
            "AuditLogEventChainDeployedV1": {
                "description": "A chain deployment was created.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_DEPLOYED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    },
                    "is_primary": {
                        "title": "Is Primary",
                        "type": "boolean"
                    },
                    "publish": {
                        "title": "Publish",
                        "type": "boolean"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "chain_deployment_name",
                    "is_primary",
                    "publish"
                ],
                "title": "AuditLogEventChainDeployedV1",
                "type": "object"
            },
            "AuditLogEventChainDeploymentActivatedV1": {
                "description": "A chain deployment was activated.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_DEPLOYMENT_ACTIVATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "chain_deployment_name"
                ],
                "title": "AuditLogEventChainDeploymentActivatedV1",
                "type": "object"
            },
            "AuditLogEventChainDeploymentDeactivatedV1": {
                "description": "A chain deployment was deactivated.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_DEPLOYMENT_DEACTIVATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "chain_deployment_name"
                ],
                "title": "AuditLogEventChainDeploymentDeactivatedV1",
                "type": "object"
            },
            "AuditLogEventChainDeploymentDeletedV1": {
                "description": "A chain deployment was deleted.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_DEPLOYMENT_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Deployment Name"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "deployment_name"
                ],
                "title": "AuditLogEventChainDeploymentDeletedV1",
                "type": "object"
            },
            "AuditLogEventChainDeploymentPromotedV1": {
                "description": "A chain deployment was promoted to an environment.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_DEPLOYMENT_PROMOTED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Environment Name"
                    },
                    "environment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Environment Id"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "chain_deployment_name",
                    "environment_name",
                    "environment_id"
                ],
                "title": "AuditLogEventChainDeploymentPromotedV1",
                "type": "object"
            },
            "AuditLogEventChainEnvironmentCreatedV1": {
                "description": "A chain environment was created.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_ENVIRONMENT_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "title": "Environment Name",
                        "type": "string"
                    },
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "environment_name",
                    "redeploy_on_promotion",
                    "ramp_up_while_promoting",
                    "ramp_up_duration_seconds"
                ],
                "title": "AuditLogEventChainEnvironmentCreatedV1",
                "type": "object"
            },
            "AuditLogEventChainEnvironmentUpdatedV1": {
                "description": "A chain environment was updated.",
                "properties": {
                    "event_type": {
                        "const": "CHAIN_ENVIRONMENT_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "title": "Environment Name",
                        "type": "string"
                    },
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "environment_name",
                    "redeploy_on_promotion",
                    "ramp_up_while_promoting",
                    "ramp_up_duration_seconds"
                ],
                "title": "AuditLogEventChainEnvironmentUpdatedV1",
                "type": "object"
            },
            "AuditLogEventChainletAutoscalingSettingsChangedV1": {
                "description": "A chainlet's autoscaling settings were changed.",
                "properties": {
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    },
                    "event_type": {
                        "const": "CHAINLET_AUTOSCALING_SETTINGS_CHANGED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    },
                    "chainlet_name": {
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "chainlet_id": {
                        "title": "Chainlet Id",
                        "type": "string"
                    },
                    "previous_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "chain_deployment_name",
                    "chainlet_name",
                    "chainlet_id",
                    "previous_settings"
                ],
                "title": "AuditLogEventChainletAutoscalingSettingsChangedV1",
                "type": "object"
            },
            "AuditLogEventChainletInstanceTypeChangedV1": {
                "description": "A chainlet's instance type was changed.",
                "properties": {
                    "event_type": {
                        "const": "CHAINLET_INSTANCE_TYPE_CHANGED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "chain_id": {
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "title": "Chain Name",
                        "type": "string"
                    },
                    "chain_deployment_id": {
                        "title": "Chain Deployment Id",
                        "type": "string"
                    },
                    "chain_deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Chain Deployment Name"
                    },
                    "chainlet_name": {
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "chainlet_id": {
                        "title": "Chainlet Id",
                        "type": "string"
                    },
                    "instance_type_name": {
                        "title": "Instance Type Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "chain_id",
                    "chain_name",
                    "chain_deployment_id",
                    "chain_deployment_name",
                    "chainlet_name",
                    "chainlet_id",
                    "instance_type_name"
                ],
                "title": "AuditLogEventChainletInstanceTypeChangedV1",
                "type": "object"
            },
            "AuditLogEventDirectoryGroupRoleUpdatedV1": {
                "description": "A directory group's role was updated.",
                "properties": {
                    "event_type": {
                        "const": "DIRECTORY_GROUP_ROLE_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "directory_group_id": {
                        "title": "Directory Group Id",
                        "type": "string"
                    },
                    "directory_group_name": {
                        "title": "Directory Group Name",
                        "type": "string"
                    },
                    "new_role_name": {
                        "title": "New Role Name",
                        "type": "string"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Team Name"
                    }
                },
                "required": [
                    "event_type",
                    "directory_group_id",
                    "directory_group_name",
                    "new_role_name",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventDirectoryGroupRoleUpdatedV1",
                "type": "object"
            },
            "AuditLogEventEnvironmentCreatedV1": {
                "description": "A model environment was created.",
                "properties": {
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    },
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Rolling Deploy"
                    },
                    "rolling_deploy_strategy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Rolling Deploy Strategy"
                    },
                    "max_unavailable_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Unavailable Percent"
                    },
                    "max_surge_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Surge Percent"
                    },
                    "stabilization_time_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stabilization Time Seconds"
                    },
                    "replica_overhead_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Replica Overhead Percent"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Promotion Cleanup Strategy"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Duration Seconds"
                    },
                    "ramp_up_step_size": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Step Size"
                    },
                    "request_backpressure_policy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Request Backpressure Policy"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "title": "Environment Name",
                        "type": "string"
                    },
                    "deployment_type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Deployment Type"
                    },
                    "event_type": {
                        "const": "ENVIRONMENT_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy",
                    "ramp_up_while_promoting",
                    "ramp_up_duration_seconds",
                    "ramp_up_step_size",
                    "model_id",
                    "model_name",
                    "environment_name",
                    "deployment_type",
                    "event_type"
                ],
                "title": "AuditLogEventEnvironmentCreatedV1",
                "type": "object"
            },
            "AuditLogEventEnvironmentDeletedV1": {
                "description": "A model environment was deleted.",
                "properties": {
                    "event_type": {
                        "const": "ENVIRONMENT_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "title": "Environment Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "environment_name"
                ],
                "title": "AuditLogEventEnvironmentDeletedV1",
                "type": "object"
            },
            "AuditLogEventEnvironmentSettingsV1": {
                "description": "Full environment settings (autoscaling + rolling promotion + deprecated canary);\nshared base for the environment events and the type of their previous_settings\nsnapshots. Not itself a payload in the discriminated union.",
                "properties": {
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    },
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Rolling Deploy"
                    },
                    "rolling_deploy_strategy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Rolling Deploy Strategy"
                    },
                    "max_unavailable_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Unavailable Percent"
                    },
                    "max_surge_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Surge Percent"
                    },
                    "stabilization_time_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stabilization Time Seconds"
                    },
                    "replica_overhead_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Replica Overhead Percent"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Promotion Cleanup Strategy"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Duration Seconds"
                    },
                    "ramp_up_step_size": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Step Size"
                    },
                    "request_backpressure_policy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Request Backpressure Policy"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy",
                    "ramp_up_while_promoting",
                    "ramp_up_duration_seconds",
                    "ramp_up_step_size"
                ],
                "title": "AuditLogEventEnvironmentSettingsV1",
                "type": "object"
            },
            "AuditLogEventEnvironmentUpdatedV1": {
                "description": "A model environment's settings were updated.",
                "properties": {
                    "schedules": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleChangeV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Schedules"
                    },
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    },
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Rolling Deploy"
                    },
                    "rolling_deploy_strategy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Rolling Deploy Strategy"
                    },
                    "max_unavailable_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Unavailable Percent"
                    },
                    "max_surge_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Surge Percent"
                    },
                    "stabilization_time_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Stabilization Time Seconds"
                    },
                    "replica_overhead_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Replica Overhead Percent"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Promotion Cleanup Strategy"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Duration Seconds"
                    },
                    "ramp_up_step_size": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Ramp Up Step Size"
                    },
                    "request_backpressure_policy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Request Backpressure Policy"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "title": "Environment Name",
                        "type": "string"
                    },
                    "deployment_type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Deployment Type"
                    },
                    "event_type": {
                        "const": "ENVIRONMENT_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "previous_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventEnvironmentSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "schedules",
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy",
                    "ramp_up_while_promoting",
                    "ramp_up_duration_seconds",
                    "ramp_up_step_size",
                    "model_id",
                    "model_name",
                    "environment_name",
                    "deployment_type",
                    "event_type",
                    "previous_settings"
                ],
                "title": "AuditLogEventEnvironmentUpdatedV1",
                "type": "object"
            },
            "AuditLogEventGatewayEndpointCreatedV1": {
                "description": "A Frontier Gateway endpoint was created.",
                "properties": {
                    "event_type": {
                        "const": "GATEWAY_ENDPOINT_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "gateway_endpoint_id": {
                        "title": "Gateway Endpoint Id",
                        "type": "string"
                    },
                    "slug": {
                        "title": "Slug",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "gateway_endpoint_id",
                    "slug"
                ],
                "title": "AuditLogEventGatewayEndpointCreatedV1",
                "type": "object"
            },
            "AuditLogEventGatewayEndpointDeletedV1": {
                "description": "A Frontier Gateway endpoint was deleted.",
                "properties": {
                    "event_type": {
                        "const": "GATEWAY_ENDPOINT_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "gateway_endpoint_id": {
                        "title": "Gateway Endpoint Id",
                        "type": "string"
                    },
                    "slug": {
                        "title": "Slug",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "gateway_endpoint_id",
                    "slug"
                ],
                "title": "AuditLogEventGatewayEndpointDeletedV1",
                "type": "object"
            },
            "AuditLogEventGatewayEndpointUpdatedV1": {
                "description": "A Frontier Gateway endpoint was updated.",
                "properties": {
                    "event_type": {
                        "const": "GATEWAY_ENDPOINT_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "gateway_endpoint_id": {
                        "title": "Gateway Endpoint Id",
                        "type": "string"
                    },
                    "slug": {
                        "title": "Slug",
                        "type": "string"
                    },
                    "previous_slug": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Previous Slug"
                    }
                },
                "required": [
                    "event_type",
                    "gateway_endpoint_id",
                    "slug",
                    "previous_slug"
                ],
                "title": "AuditLogEventGatewayEndpointUpdatedV1",
                "type": "object"
            },
            "AuditLogEventModelDeletedV1": {
                "description": "A model was deleted.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name"
                ],
                "title": "AuditLogEventModelDeletedV1",
                "type": "object"
            },
            "AuditLogEventModelDeployedV1": {
                "description": "A model deployment was created.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "scale_previous_to_zero": {
                        "title": "Scale Previous To Zero",
                        "type": "boolean"
                    },
                    "trusted": {
                        "title": "Trusted",
                        "type": "boolean"
                    },
                    "publish": {
                        "title": "Publish",
                        "type": "boolean"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Environment Name"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "scale_previous_to_zero",
                    "trusted",
                    "publish",
                    "environment_name"
                ],
                "title": "AuditLogEventModelDeployedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentActivatedV1": {
                "description": "A model deployment was activated.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_ACTIVATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name"
                ],
                "title": "AuditLogEventModelDeploymentActivatedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentAutoscalingSettingsChangedV1": {
                "description": "A model deployment's autoscaling settings were changed.",
                "properties": {
                    "schedules": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleChangeV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Schedules"
                    },
                    "min_replica": {
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "concurrency_target": {
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Scale Down Delay"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Scale Down Rate"
                    },
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "deployment_type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Deployment Type"
                    },
                    "previous_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "schedules",
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "deployment_type",
                    "previous_settings"
                ],
                "title": "AuditLogEventModelDeploymentAutoscalingSettingsChangedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentDeactivatedV1": {
                "description": "A model deployment was deactivated.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_DEACTIVATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name"
                ],
                "title": "AuditLogEventModelDeploymentDeactivatedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentDeletedV1": {
                "description": "A model deployment was deleted.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name"
                ],
                "title": "AuditLogEventModelDeploymentDeletedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentInstanceTypeChangedV1": {
                "description": "A model deployment's instance type was changed.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "instance_type_name": {
                        "title": "Instance Type Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "instance_type_name"
                ],
                "title": "AuditLogEventModelDeploymentInstanceTypeChangedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentPromotedV1": {
                "description": "A model deployment was promoted to an environment.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_PROMOTED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Environment Name"
                    },
                    "environment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Environment Id"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "environment_name",
                    "environment_id"
                ],
                "title": "AuditLogEventModelDeploymentPromotedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentRequestBackpressureSettingsChangedV1": {
                "description": "A model deployment's request backpressure settings were changed.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "policy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Policy"
                    },
                    "previous_policy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Previous Policy"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name"
                ],
                "title": "AuditLogEventModelDeploymentRequestBackpressureSettingsChangedV1",
                "type": "object"
            },
            "AuditLogEventModelDeploymentRetriedV1": {
                "description": "A model deployment build was retried.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_DEPLOYMENT_RETRIED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "retried": {
                        "title": "Retried",
                        "type": "boolean"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "retried"
                ],
                "title": "AuditLogEventModelDeploymentRetriedV1",
                "type": "object"
            },
            "AuditLogEventModelPromotionControlActionV1": {
                "description": "A user-initiated promotion control signal was sent to a rolling promotion.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_PROMOTION_CONTROL_ACTION",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "title": "Environment Name",
                        "type": "string"
                    },
                    "environment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Environment Id"
                    },
                    "action": {
                        "$ref": "#/components/schemas/AuditLogPromotionControlActionV1"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "environment_name",
                    "environment_id",
                    "action"
                ],
                "title": "AuditLogEventModelPromotionControlActionV1",
                "type": "object"
            },
            "AuditLogEventModelRenamedV1": {
                "description": "A model was renamed. `model_name` is the new name.",
                "properties": {
                    "event_type": {
                        "const": "MODEL_RENAMED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "previous_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Previous Name"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "previous_name"
                ],
                "title": "AuditLogEventModelRenamedV1",
                "type": "object"
            },
            "AuditLogEventProviderConnectionCreatedV1": {
                "properties": {
                    "event_type": {
                        "const": "PROVIDER_CONNECTION_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "provider_connection_id": {
                        "title": "Provider Connection Id",
                        "type": "string"
                    },
                    "provider": {
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "provider_connection_id",
                    "provider",
                    "secret_name"
                ],
                "title": "AuditLogEventProviderConnectionCreatedV1",
                "type": "object"
            },
            "AuditLogEventProviderConnectionDeletedV1": {
                "properties": {
                    "event_type": {
                        "const": "PROVIDER_CONNECTION_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "provider_connection_id": {
                        "title": "Provider Connection Id",
                        "type": "string"
                    },
                    "provider": {
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "provider_connection_id",
                    "provider",
                    "secret_name"
                ],
                "title": "AuditLogEventProviderConnectionDeletedV1",
                "type": "object"
            },
            "AuditLogEventProviderConnectionUpdatedV1": {
                "properties": {
                    "event_type": {
                        "const": "PROVIDER_CONNECTION_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "provider_connection_id": {
                        "title": "Provider Connection Id",
                        "type": "string"
                    },
                    "provider": {
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "provider_connection_id",
                    "provider",
                    "secret_name"
                ],
                "title": "AuditLogEventProviderConnectionUpdatedV1",
                "type": "object"
            },
            "AuditLogEventReplicaTerminatedV1": {
                "description": "A replica of a model deployment was terminated.",
                "properties": {
                    "event_type": {
                        "const": "REPLICA_TERMINATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "model_id": {
                        "title": "Model Id",
                        "type": "string"
                    },
                    "model_name": {
                        "title": "Model Name",
                        "type": "string"
                    },
                    "deployment_id": {
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "replica_id": {
                        "title": "Replica Id",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "replica_id"
                ],
                "title": "AuditLogEventReplicaTerminatedV1",
                "type": "object"
            },
            "AuditLogEventRequireGroupBasedAdminsEnabledV1": {
                "description": "Group-based admin enforcement was enabled for the organization.",
                "properties": {
                    "event_type": {
                        "const": "REQUIRE_GROUP_BASED_ADMINS_ENABLED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "organization_id": {
                        "title": "Organization Id",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "organization_id"
                ],
                "title": "AuditLogEventRequireGroupBasedAdminsEnabledV1",
                "type": "object"
            },
            "AuditLogEventSecretDeletedV1": {
                "description": "A secret was deleted.",
                "properties": {
                    "event_type": {
                        "const": "SECRET_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "secret_id": {
                        "title": "Secret Id",
                        "type": "string"
                    },
                    "secret_name": {
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "secret_id",
                    "secret_name"
                ],
                "title": "AuditLogEventSecretDeletedV1",
                "type": "object"
            },
            "AuditLogEventSecretUpdatedV1": {
                "description": "A secret was created or updated.",
                "properties": {
                    "event_type": {
                        "const": "SECRET_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "secret_id": {
                        "title": "Secret Id",
                        "type": "string"
                    },
                    "secret_name": {
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "secret_id",
                    "secret_name"
                ],
                "title": "AuditLogEventSecretUpdatedV1",
                "type": "object"
            },
            "AuditLogEventSshCertificateSignedV1": {
                "description": "An SSH certificate was signed for a workload.",
                "properties": {
                    "event_type": {
                        "const": "SSH_CERTIFICATE_SIGNED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "workload_type": {
                        "title": "Workload Type",
                        "type": "string"
                    },
                    "workload_id": {
                        "title": "Workload Id",
                        "type": "string"
                    },
                    "project_id": {
                        "title": "Project Id",
                        "type": "string"
                    },
                    "replica_id": {
                        "title": "Replica Id",
                        "type": "string"
                    },
                    "proxy_address": {
                        "title": "Proxy Address",
                        "type": "string"
                    },
                    "expires_at": {
                        "title": "Expires At",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "workload_type",
                    "workload_id",
                    "project_id",
                    "replica_id",
                    "proxy_address",
                    "expires_at"
                ],
                "title": "AuditLogEventSshCertificateSignedV1",
                "type": "object"
            },
            "AuditLogEventTypeV1": {
                "description": "Type of action recorded by an audit-log entry.",
                "enum": [
                    "MODEL_DEPLOYED",
                    "MODEL_DEPLOYMENT_ACTIVATED",
                    "MODEL_DEPLOYMENT_DEACTIVATED",
                    "MODEL_DEPLOYMENT_RETRIED",
                    "MODEL_DEPLOYMENT_PROMOTED",
                    "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED",
                    "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED",
                    "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED",
                    "MODEL_DEPLOYMENT_DELETED",
                    "MODEL_DELETED",
                    "MODEL_RENAMED",
                    "CHAIN_DEPLOYED",
                    "CHAIN_DEPLOYMENT_ACTIVATED",
                    "CHAIN_DEPLOYMENT_DEACTIVATED",
                    "CHAIN_DEPLOYMENT_PROMOTED",
                    "CHAINLET_AUTOSCALING_SETTINGS_CHANGED",
                    "CHAINLET_INSTANCE_TYPE_CHANGED",
                    "CHAIN_DEPLOYMENT_DELETED",
                    "CHAIN_DELETED",
                    "CHAIN_ENVIRONMENT_CREATED",
                    "CHAIN_ENVIRONMENT_UPDATED",
                    "SECRET_UPDATED",
                    "SECRET_DELETED",
                    "API_KEY_CREATED",
                    "API_KEY_DELETED",
                    "GATEWAY_ENDPOINT_CREATED",
                    "GATEWAY_ENDPOINT_UPDATED",
                    "GATEWAY_ENDPOINT_DELETED",
                    "PROVIDER_CONNECTION_CREATED",
                    "PROVIDER_CONNECTION_UPDATED",
                    "PROVIDER_CONNECTION_DELETED",
                    "USER_INVITED",
                    "USER_JOINED_ORGANIZATION",
                    "WEBHOOK_SIGNING_SECRET_CREATED",
                    "WEBHOOK_SIGNING_SECRET_ROTATED",
                    "WEBHOOK_SIGNING_SECRET_DELETED",
                    "USER_ROLE_UPDATED",
                    "USER_TEAM_ROLE_UPDATED",
                    "USER_REMOVED",
                    "DIRECTORY_GROUP_ROLE_UPDATED",
                    "REQUIRE_GROUP_BASED_ADMINS_ENABLED",
                    "ENVIRONMENT_CREATED",
                    "ENVIRONMENT_UPDATED",
                    "ENVIRONMENT_DELETED",
                    "REPLICA_TERMINATED",
                    "MODEL_PROMOTION_CONTROL_ACTION",
                    "SSH_CERTIFICATE_SIGNED",
                    "VOLUME_DELETED",
                    "VOLUME_VERSION_DELETED",
                    "VOLUME_VERSION_RESTORED"
                ],
                "title": "AuditLogEventTypeV1",
                "type": "string"
            },
            "AuditLogEventUserInvitedV1": {
                "description": "A user was invited to the organization.",
                "properties": {
                    "event_type": {
                        "const": "USER_INVITED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "invited_user_email": {
                        "title": "Invited User Email",
                        "type": "string"
                    },
                    "role_name": {
                        "title": "Role Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "invited_user_email",
                    "role_name"
                ],
                "title": "AuditLogEventUserInvitedV1",
                "type": "object"
            },
            "AuditLogEventUserJoinedOrganizationV1": {
                "description": "A user joined the organization.",
                "properties": {
                    "event_type": {
                        "const": "USER_JOINED_ORGANIZATION",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "new_user_email": {
                        "title": "New User Email",
                        "type": "string"
                    },
                    "user_id": {
                        "title": "User Id",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "new_user_email",
                    "user_id"
                ],
                "title": "AuditLogEventUserJoinedOrganizationV1",
                "type": "object"
            },
            "AuditLogEventUserRemovedV1": {
                "description": "A user was removed from the organization.",
                "properties": {
                    "event_type": {
                        "const": "USER_REMOVED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "removed_user_email": {
                        "title": "Removed User Email",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "removed_user_email"
                ],
                "title": "AuditLogEventUserRemovedV1",
                "type": "object"
            },
            "AuditLogEventUserRoleUpdatedV1": {
                "description": "A user's organization role was updated.",
                "properties": {
                    "event_type": {
                        "const": "USER_ROLE_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "user_id": {
                        "title": "User Id",
                        "type": "string"
                    },
                    "user_email": {
                        "title": "User Email",
                        "type": "string"
                    },
                    "new_role_name": {
                        "title": "New Role Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "user_id",
                    "user_email",
                    "new_role_name"
                ],
                "title": "AuditLogEventUserRoleUpdatedV1",
                "type": "object"
            },
            "AuditLogEventUserTeamRoleUpdatedV1": {
                "description": "A user's team role was updated.",
                "properties": {
                    "event_type": {
                        "const": "USER_TEAM_ROLE_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "user_id": {
                        "title": "User Id",
                        "type": "string"
                    },
                    "user_email": {
                        "title": "User Email",
                        "type": "string"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    },
                    "new_role_name": {
                        "title": "New Role Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "user_id",
                    "user_email",
                    "team_id",
                    "team_name",
                    "new_role_name"
                ],
                "title": "AuditLogEventUserTeamRoleUpdatedV1",
                "type": "object"
            },
            "AuditLogEventVolumeDeletedV1": {
                "description": "A volume was deleted, tombstoning every version it still held.",
                "properties": {
                    "event_type": {
                        "const": "VOLUME_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "namespace": {
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume_name": {
                        "title": "Volume Name",
                        "type": "string"
                    },
                    "versions_deleted": {
                        "title": "Versions Deleted",
                        "type": "integer"
                    }
                },
                "required": [
                    "event_type",
                    "volume_ref",
                    "namespace",
                    "volume_name",
                    "versions_deleted"
                ],
                "title": "AuditLogEventVolumeDeletedV1",
                "type": "object"
            },
            "AuditLogEventVolumeVersionDeletedV1": {
                "description": "One version of a volume was deleted.",
                "properties": {
                    "event_type": {
                        "const": "VOLUME_VERSION_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "namespace": {
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume_name": {
                        "title": "Volume Name",
                        "type": "string"
                    },
                    "version": {
                        "title": "Version",
                        "type": "string"
                    },
                    "digest": {
                        "title": "Digest",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "volume_ref",
                    "namespace",
                    "volume_name",
                    "version",
                    "digest"
                ],
                "title": "AuditLogEventVolumeVersionDeletedV1",
                "type": "object"
            },
            "AuditLogEventVolumeVersionRestoredV1": {
                "description": "A deleted version of a volume was restored.",
                "properties": {
                    "event_type": {
                        "const": "VOLUME_VERSION_RESTORED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "namespace": {
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume_name": {
                        "title": "Volume Name",
                        "type": "string"
                    },
                    "version": {
                        "title": "Version",
                        "type": "string"
                    },
                    "digest": {
                        "title": "Digest",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "volume_ref",
                    "namespace",
                    "volume_name",
                    "version",
                    "digest"
                ],
                "title": "AuditLogEventVolumeVersionRestoredV1",
                "type": "object"
            },
            "AuditLogEventWebhookSigningSecretCreatedV1": {
                "description": "A webhook signing secret was created.",
                "properties": {
                    "event_type": {
                        "const": "WEBHOOK_SIGNING_SECRET_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "webhook_signing_secret_id": {
                        "title": "Webhook Signing Secret Id",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "webhook_signing_secret_id"
                ],
                "title": "AuditLogEventWebhookSigningSecretCreatedV1",
                "type": "object"
            },
            "AuditLogEventWebhookSigningSecretDeletedV1": {
                "description": "A webhook signing secret was deleted.",
                "properties": {
                    "event_type": {
                        "const": "WEBHOOK_SIGNING_SECRET_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "webhook_signing_secret_id": {
                        "title": "Webhook Signing Secret Id",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "webhook_signing_secret_id"
                ],
                "title": "AuditLogEventWebhookSigningSecretDeletedV1",
                "type": "object"
            },
            "AuditLogEventWebhookSigningSecretRotatedV1": {
                "description": "A webhook signing secret was rotated.",
                "properties": {
                    "event_type": {
                        "const": "WEBHOOK_SIGNING_SECRET_ROTATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "webhook_signing_secret_id": {
                        "title": "Webhook Signing Secret Id",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "webhook_signing_secret_id"
                ],
                "title": "AuditLogEventWebhookSigningSecretRotatedV1",
                "type": "object"
            },
            "AuditLogPromotionControlActionV1": {
                "description": "User-initiated promotion control signal recorded on a promotion-control event.",
                "enum": [
                    "PAUSE",
                    "RESUME",
                    "FORCE_CANCEL",
                    "FORCE_ROLL_FORWARD",
                    "GRACEFUL_CANCEL"
                ],
                "title": "AuditLogPromotionControlActionV1",
                "type": "string"
            },
            "AuditLogSourceV1": {
                "description": "Surface that issued the audited action.",
                "enum": [
                    "UI",
                    "API",
                    "MCP",
                    "SYSTEM",
                    "OTHER"
                ],
                "title": "AuditLogSourceV1",
                "type": "string"
            },
            "ListAuditLogsResponseV1": {
                "description": "A page of audit-log entries, newest first by default.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/AuditLogEntryV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ListAuditLogsResponseV1",
                "type": "object"
            },
            "AuditLogEventTypeGroupV1": {
                "description": "Coarse grouping of event types, used to filter the audit log.",
                "enum": [
                    "DEPLOYED",
                    "PROMOTED",
                    "ACTIVATED_DEACTIVATED",
                    "AUTOSCALING_SETTINGS",
                    "REQUEST_BACKPRESSURE_SETTINGS",
                    "INSTANCE_TYPE_CHANGED",
                    "ENVIRONMENT_SETTINGS",
                    "REPLICA_TERMINATED",
                    "DELETED",
                    "METADATA",
                    "SECRETS",
                    "API_KEYS",
                    "GATEWAY",
                    "CODE",
                    "WEBHOOK_SIGNING_SECRETS",
                    "USER_MANAGEMENT",
                    "DIRECTORY_GROUP_MANAGEMENT",
                    "SSH"
                ],
                "title": "AuditLogEventTypeGroupV1",
                "type": "string"
            },
            "AuditLogSortDirectionV1": {
                "description": "Sort order of returned entries, by creation time.",
                "enum": [
                    "DESC",
                    "ASC"
                ],
                "title": "AuditLogSortDirectionV1",
                "type": "string"
            },
            "ListAuditLogsRequestV1": {
                "description": "Query params for listing audit-log entries.",
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 20,
                        "description": "Maximum number of entries to return per page. Defaults to 20, and must be between 1 and 200.",
                        "maximum": 200,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "direction": {
                        "$ref": "#/components/schemas/AuditLogSortDirectionV1",
                        "default": "DESC",
                        "description": "Sort order by the time the action occurred. Defaults to DESC (newest first). Ignored when paginating with a cursor."
                    },
                    "search": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Case-insensitive substring matched against resource names and IDs in the entry.",
                        "title": "Search"
                    },
                    "event_type_groups": {
                        "description": "When set, returns only entries whose event type falls in one of these groups.",
                        "items": {
                            "$ref": "#/components/schemas/AuditLogEventTypeGroupV1"
                        },
                        "title": "Event Type Groups",
                        "type": "array"
                    },
                    "user_ids": {
                        "description": "When set, returns only entries whose acting user is one of these IDs.",
                        "items": {
                            "type": "string"
                        },
                        "title": "User Ids",
                        "type": "array"
                    },
                    "deployment_ids": {
                        "description": "When set, returns only entries referencing one of these model deployment IDs.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Deployment Ids",
                        "type": "array"
                    },
                    "chain_deployment_ids": {
                        "description": "When set, returns only entries referencing one of these chain deployment IDs.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Chain Deployment Ids",
                        "type": "array"
                    },
                    "environment_names": {
                        "description": "When set, returns only entries for one of these environments.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Environment Names",
                        "type": "array"
                    },
                    "sources": {
                        "description": "When set, returns only entries issued from one of these surfaces.",
                        "items": {
                            "$ref": "#/components/schemas/AuditLogSourceV1"
                        },
                        "title": "Sources",
                        "type": "array"
                    },
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds for the start of the window. Defaults to the beginning of the audit-log history.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds for the end of the window. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    }
                },
                "title": "ListAuditLogsRequestV1",
                "type": "object"
            },
            "ModelV1": {
                "description": "A model.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the model",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the model was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the model",
                        "title": "Name",
                        "type": "string"
                    },
                    "deployments_count": {
                        "description": "Number of deployments of the model",
                        "title": "Deployments Count",
                        "type": "integer"
                    },
                    "production_deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Unique identifier of the production deployment of the model",
                        "title": "Production Deployment Id"
                    },
                    "development_deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Unique identifier of the development deployment of the model",
                        "title": "Development Deployment Id"
                    },
                    "instance_type_name": {
                        "description": "Name of the instance type for the production deployment of the model",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team associated with the model.",
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "name",
                    "deployments_count",
                    "production_deployment_id",
                    "development_deployment_id",
                    "instance_type_name",
                    "team_name"
                ],
                "title": "ModelV1",
                "type": "object"
            },
            "ModelsV1": {
                "description": "A list of models.",
                "properties": {
                    "models": {
                        "items": {
                            "$ref": "#/components/schemas/ModelV1"
                        },
                        "title": "Models",
                        "type": "array"
                    }
                },
                "required": [
                    "models"
                ],
                "title": "ModelsV1",
                "type": "object"
            },
            "ModelsRequestV1": {
                "description": "Request parameters for listing models.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When set, returns only models with this exact name, if any. On a team-scoped route this matches at most one model; on the org-wide route it may match models in multiple teams, since names are unique only within a team.",
                        "title": "Name"
                    }
                },
                "title": "ModelsRequestV1",
                "type": "object"
            },
            "LibraryListingSourceV1": {
                "description": "Create a model by forking a library listing accessible to the caller's organization.",
                "properties": {
                    "kind": {
                        "const": "library_listing",
                        "default": "library_listing",
                        "title": "Kind",
                        "type": "string"
                    },
                    "lab_display_name": {
                        "description": "Identifier of the publishing organization, as returned by `GET /v1/library_models`.",
                        "title": "Lab Display Name",
                        "type": "string"
                    },
                    "user_defined_listing_id": {
                        "description": "Listing identifier within the publishing organization.",
                        "title": "User Defined Listing Id",
                        "type": "string"
                    },
                    "deployed_model_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional name for the new deployed model. Defaults to the listing's configured name.",
                        "title": "Deployed Model Name"
                    }
                },
                "required": [
                    "lab_display_name",
                    "user_defined_listing_id"
                ],
                "title": "LibraryListingSourceV1",
                "type": "object"
            },
            "ModelArchiveSourceV1": {
                "description": "Create a model from an archive previously uploaded via the credentials\nissued by `POST /v1/prepare_model_upload`.",
                "properties": {
                    "kind": {
                        "const": "model_archive",
                        "default": "model_archive",
                        "title": "Kind",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the new model.",
                        "title": "Name",
                        "type": "string"
                    },
                    "deployment": {
                        "$ref": "#/components/schemas/DeploymentArchivePayloadV1",
                        "description": "Deployment-level configuration for the model's first deployment."
                    },
                    "s3_key": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "S3 key of the uploaded archive, from the credentials returned by `POST /v1/prepare_model_upload`. Omit for model formats that are not built from an archive (for example, BIS-LLM), where prepare issues no upload target.",
                        "title": "S3 Key"
                    },
                    "disable_archive_download": {
                        "default": false,
                        "description": "If true, the uploaded archive is not downloadable after creation. Locked at model creation; cannot be changed by subsequent deployments.",
                        "title": "Disable Archive Download",
                        "type": "boolean"
                    }
                },
                "required": [
                    "name",
                    "deployment"
                ],
                "title": "ModelArchiveSourceV1",
                "type": "object"
            },
            "CreateModelRequestV1": {
                "description": "Body for creating a model via `POST /v1/models`.",
                "properties": {
                    "source": {
                        "description": "Where the new model is created from.",
                        "discriminator": {
                            "mapping": {
                                "library_listing": "#/components/schemas/LibraryListingSourceV1",
                                "model_archive": "#/components/schemas/ModelArchiveSourceV1"
                            },
                            "propertyName": "kind"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/LibraryListingSourceV1"
                            },
                            {
                                "$ref": "#/components/schemas/ModelArchiveSourceV1"
                            }
                        ],
                        "title": "Source"
                    }
                },
                "required": [
                    "source"
                ],
                "title": "CreateModelRequestV1",
                "type": "object"
            },
            "AutoscalingSettingsV1": {
                "description": "Autoscaling settings for a deployment.",
                "properties": {
                    "min_replica": {
                        "description": "Minimum number of replicas",
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "description": "Maximum number of replicas",
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Timeframe of traffic considered for autoscaling decisions",
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Waiting period before scaling down any active replica",
                        "title": "Scale Down Delay"
                    },
                    "concurrency_target": {
                        "description": "Number of requests per replica before scaling up",
                        "title": "Concurrency Target",
                        "type": "integer"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Target utilization percentage for scaling up/down.",
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target number of in-flight tokens for autoscaling decisions. Early access only.",
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum percentage of replicas that can be removed per autoscaling window (1\u201350). E.g. 20 means at most 20% of replicas are removed per window.",
                        "title": "Max Scale Down Rate"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "autoscaling_window",
                    "scale_down_delay",
                    "concurrency_target",
                    "target_utilization_percentage"
                ],
                "title": "AutoscalingSettingsV1",
                "type": "object"
            },
            "DeploymentStatusV1": {
                "description": "The status of a deployment.",
                "enum": [
                    "BUILDING",
                    "DEPLOYING",
                    "DEPLOY_FAILED",
                    "LOADING_MODEL",
                    "ACTIVE",
                    "UNHEALTHY",
                    "BUILD_FAILED",
                    "BUILD_STOPPED",
                    "DEACTIVATING",
                    "INACTIVE",
                    "FAILED",
                    "UPDATING",
                    "SCALED_TO_ZERO",
                    "WAKING_UP"
                ],
                "title": "DeploymentStatusV1",
                "type": "string"
            },
            "DeploymentV1": {
                "description": "A deployment of a model.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the deployment",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the deployment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the deployment",
                        "title": "Name",
                        "type": "string"
                    },
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "is_production": {
                        "description": "Whether the deployment is the production deployment of the model",
                        "title": "Is Production",
                        "type": "boolean"
                    },
                    "is_development": {
                        "description": "Whether the deployment is the development deployment of the model",
                        "title": "Is Development",
                        "type": "boolean"
                    },
                    "status": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "Status of the deployment"
                    },
                    "active_replica_count": {
                        "description": "Number of active replicas",
                        "title": "Active Replica Count",
                        "type": "integer"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Autoscaling settings for the deployment. If null, the model has not finished deploying"
                    },
                    "instance_type_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Name of the instance type the model deployment is running on",
                        "title": "Instance Type Name"
                    },
                    "environment": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The environment associated with the deployment",
                        "title": "Environment"
                    },
                    "labels": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-provided key-value labels for the deployment",
                        "title": "Labels"
                    },
                    "region": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RegionV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The selected region for the deployment, if any"
                    },
                    "request_backpressure_settings": {
                        "$ref": "#/components/schemas/RequestBackpressureSettingsV1",
                        "description": "Effective request backpressure settings for the deployment."
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "name",
                    "model_id",
                    "is_production",
                    "is_development",
                    "status",
                    "active_replica_count",
                    "autoscaling_settings",
                    "instance_type_name",
                    "environment",
                    "request_backpressure_settings"
                ],
                "title": "DeploymentV1",
                "type": "object"
            },
            "RequestBackpressurePolicyV1": {
                "enum": [
                    "QUEUE_ON_FULL",
                    "REJECT_ON_FULL"
                ],
                "title": "RequestBackpressurePolicyV1",
                "type": "string"
            },
            "RequestBackpressureSettingsV1": {
                "description": "Request backpressure settings for a deployment or environment.",
                "properties": {
                    "policy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RequestBackpressurePolicyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Backpressure policy. Null when no policy is set."
                    }
                },
                "title": "RequestBackpressureSettingsV1",
                "type": "object"
            },
            "CreatedModelDeploymentV1": {
                "description": "A newly created deployment and its model.",
                "properties": {
                    "model": {
                        "$ref": "#/components/schemas/ModelV1",
                        "description": "The model the deployment belongs to. May have been created by this call."
                    },
                    "deployment": {
                        "$ref": "#/components/schemas/DeploymentV1",
                        "description": "The newly created deployment."
                    }
                },
                "required": [
                    "model",
                    "deployment"
                ],
                "title": "CreatedModelDeploymentV1",
                "type": "object"
            },
            "ModelTombstoneV1": {
                "description": "A model tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the model",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the model was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "ModelTombstoneV1",
                "type": "object"
            },
            "UpdateModelRequestV1": {
                "additionalProperties": false,
                "description": "A request to update a model.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New name for the model, unique within its team. Renaming does not change the model ID, endpoints, or deployments. Pushes that still use the old model_name create another model or target a model that now uses that name, so update config.yaml after renaming.",
                        "examples": [
                            "my-model"
                        ],
                        "title": "Name"
                    }
                },
                "title": "UpdateModelRequestV1",
                "type": "object"
            },
            "DeploymentsV1": {
                "description": "A list of deployments of a model.",
                "properties": {
                    "deployments": {
                        "description": "A list of deployments of a model",
                        "items": {
                            "$ref": "#/components/schemas/DeploymentV1"
                        },
                        "title": "Deployments",
                        "type": "array"
                    }
                },
                "required": [
                    "deployments"
                ],
                "title": "DeploymentsV1",
                "type": "object"
            },
            "DeploymentsRequestV1": {
                "description": "Request parameters for listing a model's deployments.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When set, returns only the deployment with this exact name, if any.",
                        "title": "Name"
                    }
                },
                "title": "DeploymentsRequestV1",
                "type": "object"
            },
            "DeploymentArchiveSourceV1": {
                "description": "Add a deployment from an archive previously uploaded via the credentials\nissued by `POST /v1/prepare_model_upload`.",
                "properties": {
                    "kind": {
                        "const": "model_archive",
                        "default": "model_archive",
                        "title": "Kind",
                        "type": "string"
                    },
                    "deployment": {
                        "$ref": "#/components/schemas/DeploymentArchivePayloadV1",
                        "description": "Deployment-level configuration."
                    },
                    "s3_key": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "S3 key of the uploaded archive, from the credentials returned by `POST /v1/prepare_model_upload`. Omit for model formats that are not built from an archive (for example, BIS-LLM), where prepare issues no upload target.",
                        "title": "S3 Key"
                    }
                },
                "required": [
                    "deployment"
                ],
                "title": "DeploymentArchiveSourceV1",
                "type": "object"
            },
            "CreateModelDeploymentRequestV1": {
                "description": "Body for adding a deployment to an existing model via\n`POST /v1/models/{model_id}/deployments`.",
                "properties": {
                    "source": {
                        "description": "Where the new deployment is created from.",
                        "discriminator": {
                            "mapping": {
                                "model_archive": "#/components/schemas/DeploymentArchiveSourceV1"
                            },
                            "propertyName": "kind"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/DeploymentArchiveSourceV1"
                            }
                        ],
                        "title": "Source"
                    }
                },
                "required": [
                    "source"
                ],
                "title": "CreateModelDeploymentRequestV1",
                "type": "object"
            },
            "DeploymentTombstoneV1": {
                "description": "A model deployment tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the deployment",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the deployment was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    },
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "deleted",
                    "model_id"
                ],
                "title": "DeploymentTombstoneV1",
                "type": "object"
            },
            "UpdateDeploymentRequestV1": {
                "additionalProperties": false,
                "description": "A request to update a deployment.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New name for the deployment, unique among the model's deployments. Only alphanumeric characters, hyphens, underscores, and periods are allowed.",
                        "examples": [
                            "my-deployment"
                        ],
                        "title": "Name"
                    }
                },
                "title": "UpdateDeploymentRequestV1",
                "type": "object"
            },
            "UpdateAutoscalingSettingsV1": {
                "additionalProperties": false,
                "description": "A request to update autoscaling settings for a deployment. All fields are optional, and we only update ones passed in.",
                "properties": {
                    "min_replica": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum number of replicas",
                        "examples": [
                            0
                        ],
                        "title": "Min Replica"
                    },
                    "max_replica": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum number of replicas",
                        "examples": [
                            7
                        ],
                        "title": "Max Replica"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Timeframe of traffic considered for autoscaling decisions",
                        "examples": [
                            600
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Waiting period before scaling down any active replica",
                        "examples": [
                            120
                        ],
                        "title": "Scale Down Delay"
                    },
                    "concurrency_target": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Number of requests per replica before scaling up",
                        "examples": [
                            2
                        ],
                        "title": "Concurrency Target"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target utilization percentage for scaling up/down.",
                        "examples": [
                            70
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target number of in-flight tokens for autoscaling decisions. Early access only.",
                        "examples": [
                            40000
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "maximum": 50,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum percentage of replicas that can be removed per autoscaling window (1\u201350). E.g. 20 means at most 20% of replicas are removed per window.",
                        "examples": [
                            20
                        ],
                        "title": "Max Scale Down Rate"
                    }
                },
                "title": "UpdateAutoscalingSettingsV1",
                "type": "object"
            },
            "UpdateAutoscalingSettingsStatusV1": {
                "description": "The status of a request to update autoscaling settings.",
                "enum": [
                    "ACCEPTED",
                    "QUEUED",
                    "UNCHANGED"
                ],
                "title": "UpdateAutoscalingSettingsStatusV1",
                "type": "string"
            },
            "UpdateAutoscalingSettingsResponseV1": {
                "description": "The response to a request to update autoscaling settings.",
                "properties": {
                    "status": {
                        "$ref": "#/components/schemas/UpdateAutoscalingSettingsStatusV1",
                        "description": "Status of the request to update autoscaling settings"
                    },
                    "message": {
                        "description": "A message describing the status of the request to update autoscaling settings",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "status",
                    "message"
                ],
                "title": "UpdateAutoscalingSettingsResponseV1",
                "type": "object"
            },
            "UpdateRequestBackpressureSettingsV1": {
                "additionalProperties": false,
                "description": "A request to update request backpressure settings.",
                "properties": {
                    "policy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RequestBackpressurePolicyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Backpressure policy to apply. Null indicates no policy (on update, clears an existing one).",
                        "examples": [
                            "REJECT_ON_FULL"
                        ],
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRequestBackpressureSettingsV1",
                "type": "object"
            },
            "PromoteRequestV1": {
                "description": "A request to promote a deployment to production.",
                "properties": {
                    "scale_down_previous_production": {
                        "default": true,
                        "description": "Whether to scale down the previous production deployment after promoting",
                        "examples": [
                            true
                        ],
                        "title": "Scale Down Previous Production",
                        "type": "boolean"
                    },
                    "preserve_env_instance_type": {
                        "default": true,
                        "description": "Whether to use the promoting deployment's instance type or preserve target environment's instance type",
                        "examples": [
                            true
                        ],
                        "title": "Preserve Env Instance Type",
                        "type": "boolean"
                    }
                },
                "title": "PromoteRequestV1",
                "type": "object"
            },
            "ActivateResponseV1": {
                "description": "The response to a request to activate a deployment.",
                "properties": {
                    "success": {
                        "default": true,
                        "description": "Whether the deployment was successfully activated",
                        "title": "Success",
                        "type": "boolean"
                    },
                    "no_op": {
                        "default": false,
                        "description": "Whether the request did nothing because the deployment was already active or on its way to becoming active",
                        "title": "No Op",
                        "type": "boolean"
                    }
                },
                "title": "ActivateResponseV1",
                "type": "object"
            },
            "DeactivateResponseV1": {
                "description": "The response to a request to deactivate a deployment.",
                "properties": {
                    "success": {
                        "default": true,
                        "description": "Whether the deployment was successfully deactivated",
                        "title": "Success",
                        "type": "boolean"
                    },
                    "no_op": {
                        "default": false,
                        "description": "Whether the request did nothing because the deployment was already inactive",
                        "title": "No Op",
                        "type": "boolean"
                    }
                },
                "title": "DeactivateResponseV1",
                "type": "object"
            },
            "RetryDeploymentResponseV1": {
                "description": "The response to a request to retry a deployment.",
                "properties": {
                    "retried": {
                        "description": "Whether the retry was successfully initiated",
                        "title": "Retried",
                        "type": "boolean"
                    },
                    "reason": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Explanation of the result. Provided when retried is false to explain why retry was not possible.",
                        "title": "Reason"
                    },
                    "deployment": {
                        "$ref": "#/components/schemas/DeploymentV1",
                        "description": "The deployment that was retried"
                    }
                },
                "required": [
                    "retried",
                    "deployment"
                ],
                "title": "RetryDeploymentResponseV1",
                "type": "object"
            },
            "DownloadDeploymentResponseV1": {
                "description": "The response to a request to download a deployment's truss.",
                "properties": {
                    "download_url": {
                        "description": "Presigned URL to download the truss tar file",
                        "title": "Download Url",
                        "type": "string"
                    }
                },
                "required": [
                    "download_url"
                ],
                "title": "DownloadDeploymentResponseV1",
                "type": "object"
            },
            "DeploymentConfigResponseV1": {
                "description": "The config of a deployment. Fields are populated per `output_format`.",
                "properties": {
                    "config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The parsed config of the deployment.",
                        "title": "Config"
                    },
                    "raw_config": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The original config.yaml text \u2014 preserves comments, ordering, formatting.",
                        "title": "Raw Config"
                    }
                },
                "title": "DeploymentConfigResponseV1",
                "type": "object"
            },
            "DeploymentConfigOutputFormat": {
                "enum": [
                    "raw",
                    "parsed",
                    "both"
                ],
                "title": "DeploymentConfigOutputFormat",
                "type": "string"
            },
            "GetDeploymentConfigRequestV1": {
                "description": "Query params for ``GET /v1/models/.../deployments/.../config``.",
                "properties": {
                    "output_format": {
                        "$ref": "#/components/schemas/DeploymentConfigOutputFormat",
                        "default": "both",
                        "description": "'raw': verbatim config.yaml with comments (not available for deployments created before 2026-04-30). 'parsed': dict with server-side defaults applied (always available). 'both': both fields populated."
                    }
                },
                "title": "GetDeploymentConfigRequestV1",
                "type": "object"
            },
            "LogLevelV1": {
                "description": "A log severity level.",
                "enum": [
                    "DEBUG",
                    "INFO",
                    "WARNING",
                    "ERROR"
                ],
                "title": "LogLevelV1",
                "type": "string"
            },
            "LogV1": {
                "properties": {
                    "timestamp": {
                        "description": "Epoch nanosecond timestamp of the log message.",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "message": {
                        "description": "The contents of the log message. When the logger captured an exception, the traceback is appended after the message.",
                        "title": "Message",
                        "type": "string"
                    },
                    "replica": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The replica the log line was emitted from.",
                        "title": "Replica"
                    },
                    "request_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The request ID associated with an inference request.",
                        "title": "Request Id"
                    },
                    "level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Severity of the log line, if one was detected. null when unknown."
                    }
                },
                "required": [
                    "timestamp",
                    "message",
                    "replica"
                ],
                "title": "LogV1",
                "type": "object"
            },
            "GetLogsResponseV1": {
                "description": "A response to querying logs.",
                "properties": {
                    "logs": {
                        "description": "Logs for a specific entity.",
                        "items": {
                            "$ref": "#/components/schemas/LogV1"
                        },
                        "title": "Logs",
                        "type": "array"
                    }
                },
                "required": [
                    "logs"
                ],
                "title": "GetLogsResponseV1",
                "type": "object"
            },
            "SortOrderV1": {
                "enum": [
                    "asc",
                    "desc"
                ],
                "title": "SortOrderV1",
                "type": "string"
            },
            "GetDeploymentLogsRequestV1": {
                "description": "A request to fetch deployment logs.",
                "properties": {
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort order for logs"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 500,
                        "description": "Limit of logs to fetch in a single request",
                        "title": "Limit"
                    },
                    "min_level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level."
                    },
                    "replica": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only return logs emitted by this replica (5-char short ID).",
                        "title": "Replica"
                    },
                    "request_id": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only return logs tagged with this inference request ID.",
                        "title": "Request Id"
                    },
                    "component": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only return logs from this component.",
                        "title": "Component"
                    },
                    "search_pattern": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "RE2 regular expression matched against the log message. Prefer `includes` and `excludes` for plain substring matches.",
                        "title": "Search Pattern"
                    },
                    "includes": {
                        "description": "Case-sensitive substrings that must all appear in the log message.",
                        "items": {
                            "type": "string"
                        },
                        "maxItems": 8,
                        "title": "Includes",
                        "type": "array"
                    },
                    "excludes": {
                        "description": "Case-sensitive substrings; lines containing any of these are dropped.",
                        "items": {
                            "type": "string"
                        },
                        "maxItems": 8,
                        "title": "Excludes",
                        "type": "array"
                    }
                },
                "title": "GetDeploymentLogsRequestV1",
                "type": "object"
            },
            "DeploymentPatchActionV1": {
                "description": "How a patch op changes its target.",
                "enum": [
                    "ADD",
                    "UPDATE",
                    "REMOVE"
                ],
                "title": "DeploymentPatchActionV1",
                "type": "string"
            },
            "DeploymentPatchOpConfigV1": {
                "description": "Replace the config when config.yaml changes.\n\nConfig has no action: it is always a full replacement of the parsed config.\nDerived changes (environment variables, external data, requirements) are\nemitted as their own ops alongside this one.",
                "properties": {
                    "type": {
                        "const": "config",
                        "default": "config",
                        "title": "Type",
                        "type": "string"
                    },
                    "config": {
                        "additionalProperties": true,
                        "description": "The full parsed config as a JSON object.",
                        "title": "Config",
                        "type": "object"
                    },
                    "path": {
                        "default": "config.yaml",
                        "description": "Config file path within the source.",
                        "title": "Path",
                        "type": "string"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "DeploymentPatchOpConfigV1",
                "type": "object"
            },
            "DeploymentPatchOpEnvVarV1": {
                "description": "Add, update, or remove a single environment variable.",
                "properties": {
                    "type": {
                        "const": "environment_variable",
                        "default": "environment_variable",
                        "title": "Type",
                        "type": "string"
                    },
                    "action": {
                        "$ref": "#/components/schemas/DeploymentPatchActionV1",
                        "description": "How this op changes the variable."
                    },
                    "name": {
                        "description": "The environment variable name.",
                        "title": "Name",
                        "type": "string"
                    },
                    "value": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The environment variable value. Required for add and update.",
                        "title": "Value"
                    }
                },
                "required": [
                    "action",
                    "name"
                ],
                "title": "DeploymentPatchOpEnvVarV1",
                "type": "object"
            },
            "DeploymentPatchOpExternalDataV1": {
                "description": "Add, update, or remove a single external data item.\n\nExternal data is referenced by config, not stored in the source. The backend\nonly adds or removes it, where adding re-downloads (overwriting any existing\nfile), so `update` is accepted and treated identically to `add`.",
                "properties": {
                    "type": {
                        "const": "external_data",
                        "default": "external_data",
                        "title": "Type",
                        "type": "string"
                    },
                    "action": {
                        "$ref": "#/components/schemas/DeploymentPatchActionV1",
                        "description": "How this op changes the item. `UPDATE` is treated identically to `ADD`."
                    },
                    "item": {
                        "additionalProperties": {
                            "type": "string"
                        },
                        "description": "The single external data item descriptor.",
                        "title": "Item",
                        "type": "object"
                    }
                },
                "required": [
                    "action",
                    "item"
                ],
                "title": "DeploymentPatchOpExternalDataV1",
                "type": "object"
            },
            "DeploymentPatchOpModelCodeV1": {
                "description": "Add, update, or remove a file under the model code directory.",
                "properties": {
                    "type": {
                        "const": "model_code",
                        "default": "model_code",
                        "title": "Type",
                        "type": "string"
                    },
                    "action": {
                        "$ref": "#/components/schemas/DeploymentPatchActionV1",
                        "description": "How this op changes the file."
                    },
                    "path": {
                        "description": "File path relative to the model code directory.",
                        "title": "Path",
                        "type": "string"
                    },
                    "content": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "UTF-8 file content. Null for removals and binary files.",
                        "title": "Content"
                    },
                    "content_bytes": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Base64-encoded content for binary files.",
                        "title": "Content Bytes"
                    },
                    "hot_reload": {
                        "default": false,
                        "description": "Whether the running server can pick up this change without a restart.",
                        "title": "Hot Reload",
                        "type": "boolean"
                    }
                },
                "required": [
                    "action",
                    "path"
                ],
                "title": "DeploymentPatchOpModelCodeV1",
                "type": "object"
            },
            "DeploymentPatchOpPackageV1": {
                "description": "Add, update, or remove a file under the bundled packages directory.",
                "properties": {
                    "type": {
                        "const": "package",
                        "default": "package",
                        "title": "Type",
                        "type": "string"
                    },
                    "action": {
                        "$ref": "#/components/schemas/DeploymentPatchActionV1",
                        "description": "How this op changes the file."
                    },
                    "path": {
                        "description": "File path relative to the bundled packages directory.",
                        "title": "Path",
                        "type": "string"
                    },
                    "content": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "UTF-8 file content. Null for removals and binary files.",
                        "title": "Content"
                    },
                    "content_bytes": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Base64-encoded content for binary files.",
                        "title": "Content Bytes"
                    }
                },
                "required": [
                    "action",
                    "path"
                ],
                "title": "DeploymentPatchOpPackageV1",
                "type": "object"
            },
            "DeploymentPatchOpPythonRequirementV1": {
                "description": "Add, update, or remove a single Python requirement.",
                "properties": {
                    "type": {
                        "const": "python_requirement",
                        "default": "python_requirement",
                        "title": "Type",
                        "type": "string"
                    },
                    "action": {
                        "$ref": "#/components/schemas/DeploymentPatchActionV1",
                        "description": "How this op changes the requirement."
                    },
                    "requirement": {
                        "description": "The requirement to apply. For removals this is the package name; otherwise the full requirements.txt-style line.",
                        "title": "Requirement",
                        "type": "string"
                    }
                },
                "required": [
                    "action",
                    "requirement"
                ],
                "title": "DeploymentPatchOpPythonRequirementV1",
                "type": "object"
            },
            "DeploymentPatchPointV1": {
                "description": "A patch point: the source state the next patch is computed against.\n\nThe content hash that identifies a point is derived from this state (see\n`DeploymentPatchPointWithHashV1.hash`), so a request only sends the state and\nthe server stamps the hash. A previous point's hash plus the current local\nsource is enough to compute the next patch, so the watch client reads the\npoint it is patching off of.",
                "properties": {
                    "content_hashes": {
                        "additionalProperties": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "description": "Map of every non-ignored source path, relative and forward-slash, to its content hash: files map to the hex blake3 digest of their bytes, directories map to null. This is the full signature of the source tree and what the content hash is derived from.",
                        "title": "Content Hashes",
                        "type": "object"
                    },
                    "config": {
                        "description": "The verbatim config.yaml text for this source state.",
                        "title": "Config",
                        "type": "string"
                    },
                    "requirements": {
                        "description": "Requirements resolved from the config's requirements file, when it points at one. Empty when requirements are declared inline in the config.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Requirements",
                        "type": "array"
                    }
                },
                "required": [
                    "content_hashes",
                    "config"
                ],
                "title": "DeploymentPatchPointV1",
                "type": "object"
            },
            "CreateDeploymentPatchRequestV1": {
                "description": "A patch to stage against the development deployment.\n\nStaging is durable on its own: the patch is persisted independently of the\nlater sync, so a failed sync does not lose it.",
                "properties": {
                    "prev_patch_hash": {
                        "description": "Content hash of the patch point this patch is applied on - the link the staged patch must build on. A stale value (the base moved underneath the client) is rejected with a conflict.",
                        "title": "Prev Patch Hash",
                        "type": "string"
                    },
                    "next_patch_point": {
                        "$ref": "#/components/schemas/DeploymentPatchPointV1",
                        "description": "The source state after this patch. The server derives its content hash from `content_hashes`."
                    },
                    "patch_ops": {
                        "description": "The ordered ops that make up this patch. At least one op is required; a patch that changes nothing is not a valid request. There is no op for a directory: a directory comes into existence when the first file under it is added, and is removed when its last file is removed, so directory creation and deletion happen implicitly through the file ops. Adding or removing an otherwise empty directory therefore produces no ops even though it changes the source hash; do not send a patch request for such a change.",
                        "items": {
                            "discriminator": {
                                "mapping": {
                                    "config": "#/components/schemas/DeploymentPatchOpConfigV1",
                                    "environment_variable": "#/components/schemas/DeploymentPatchOpEnvVarV1",
                                    "external_data": "#/components/schemas/DeploymentPatchOpExternalDataV1",
                                    "model_code": "#/components/schemas/DeploymentPatchOpModelCodeV1",
                                    "package": "#/components/schemas/DeploymentPatchOpPackageV1",
                                    "python_requirement": "#/components/schemas/DeploymentPatchOpPythonRequirementV1"
                                },
                                "propertyName": "type"
                            },
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/DeploymentPatchOpModelCodeV1"
                                },
                                {
                                    "$ref": "#/components/schemas/DeploymentPatchOpPackageV1"
                                },
                                {
                                    "$ref": "#/components/schemas/DeploymentPatchOpConfigV1"
                                },
                                {
                                    "$ref": "#/components/schemas/DeploymentPatchOpPythonRequirementV1"
                                },
                                {
                                    "$ref": "#/components/schemas/DeploymentPatchOpEnvVarV1"
                                },
                                {
                                    "$ref": "#/components/schemas/DeploymentPatchOpExternalDataV1"
                                }
                            ]
                        },
                        "minItems": 1,
                        "title": "Patch Ops",
                        "type": "array"
                    }
                },
                "required": [
                    "prev_patch_hash",
                    "next_patch_point",
                    "patch_ops"
                ],
                "title": "CreateDeploymentPatchRequestV1",
                "type": "object"
            },
            "DeploymentPatchPointWithHashV1": {
                "description": "A patch point plus its server-assigned content hash, returned in responses.\n\nRequests omit the hash (the server derives it from the source state); responses\ninclude it so the watch client can echo it back as the next patch's\n`prev_patch_hash` without having to recompute the fold itself.",
                "properties": {
                    "content_hashes": {
                        "additionalProperties": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "description": "Map of every non-ignored source path, relative and forward-slash, to its content hash: files map to the hex blake3 digest of their bytes, directories map to null. This is the full signature of the source tree and what the content hash is derived from.",
                        "title": "Content Hashes",
                        "type": "object"
                    },
                    "config": {
                        "description": "The verbatim config.yaml text for this source state.",
                        "title": "Config",
                        "type": "string"
                    },
                    "requirements": {
                        "description": "Requirements resolved from the config's requirements file, when it points at one. Empty when requirements are declared inline in the config.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Requirements",
                        "type": "array"
                    },
                    "hash": {
                        "description": "Content hash identifying this exact source state, and the link patches build on. It is derived deterministically from `content_hashes`, so a request need not send it - the server derives it. It is derived by sorting the `content_hashes` keys as paths, splitting each key on '/' into its path components and ordering the keys by comparing those component lists element by element, each component compared by Unicode code point (equivalently UTF-8 byte order). Treating '/' as a path separator this way, rather than as the ordinary character U+002F, means a key that is an ancestor path sorts before a sibling whose name extends the first differing component (so e.g. 'a/b' sorts before 'a.b'). A blake3 hasher is then built, and for each key in that order updated with the blake3 digest (32 raw bytes) of the key encoded as UTF-8, then, when the entry is a file (non-null value), with that file's digest as 32 raw bytes. The stream uses raw digest bytes, but the values in `content_hashes` are those digests hex-encoded (64 hex chars), so decode each value from hex first. Directory entries (null value) contribute only their key digest. The result is the hasher's own hex digest.",
                        "title": "Hash",
                        "type": "string"
                    }
                },
                "required": [
                    "content_hashes",
                    "config",
                    "hash"
                ],
                "title": "DeploymentPatchPointWithHashV1",
                "type": "object"
            },
            "CreateDeploymentPatchResponseV1": {
                "description": "The created patch, represented by the patch point it produced.",
                "properties": {
                    "patch_point": {
                        "$ref": "#/components/schemas/DeploymentPatchPointWithHashV1",
                        "description": "The resulting patch point the staged patch produced; matches the pending point a subsequent state read returns."
                    }
                },
                "required": [
                    "patch_point"
                ],
                "title": "CreateDeploymentPatchResponseV1",
                "type": "object"
            },
            "GetDeploymentPatchesStateResponseV1": {
                "description": "The patch state of the development deployment.\n\nThe watch client computes its next patch off `pending_patch_point` when present,\nelse `running_patch_point`.",
                "properties": {
                    "running_patch_point": {
                        "$ref": "#/components/schemas/DeploymentPatchPointWithHashV1",
                        "description": "The patch point the deployment is recorded as running."
                    },
                    "pending_patch_point": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DeploymentPatchPointWithHashV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The latest staged-but-unsynced patch point, or null when the deployment is recorded as caught up."
                    }
                },
                "required": [
                    "running_patch_point"
                ],
                "title": "GetDeploymentPatchesStateResponseV1",
                "type": "object"
            },
            "SyncDeploymentPatchesRequestV1": {
                "description": "Triggers a sync of any staged patches to the running deployment. Takes no\nfields: the deployment and its staged patches fully determine the sync.",
                "properties": {},
                "title": "SyncDeploymentPatchesRequestV1",
                "type": "object"
            },
            "SyncDeploymentPatchesResponseV1": {
                "description": "The outcome of a sync that ran.\n\nOperational failures (a transient patch failure, an invalid patch sequence)\nare surfaced as HTTP errors rather than fields here, so a 2xx means the sync\nreached a verdict.",
                "properties": {
                    "needs_full_deploy_reason": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "If set, the change cannot be patched and a full push is required; the value explains why. If null, the deployment is now in sync.",
                        "title": "Needs Full Deploy Reason"
                    }
                },
                "title": "SyncDeploymentPatchesResponseV1",
                "type": "object"
            },
            "ModelMetricDescriptorV1": {
                "description": "Describes one metric. Its position in the response ``metric_descriptors``\nlist is the index used to read that metric out of each value set's ``values``.\n\nA metric may break down into multiple labeled series (e.g. latency quantiles,\nor volume by status). ``label_sets`` enumerates those series in order; each\nvalue set's value for this metric is a list aligned to that order.",
                "properties": {
                    "name": {
                        "description": "Canonical metric name.",
                        "title": "Name",
                        "type": "string"
                    },
                    "unit_hint": {
                        "$ref": "#/components/schemas/ModelMetricUnitHintV1",
                        "description": "Advisory unit of the metric's values."
                    },
                    "kind": {
                        "$ref": "#/components/schemas/ModelMetricKindV1",
                        "description": "Semantic hint for how the metric behaves (GAUGE, COUNTER, HISTOGRAM)."
                    },
                    "label_sets": {
                        "description": "The metric's series, in order. Each entry is the set of labels identifying one series; the value at the same index in each value set's ``values`` is that series' value. A plain metric has a single entry with no labels (`{}`). A histogram has one entry per quantile plus an average, e.g. {'quantile': '0.5'} \u2026 {'quantile': '0.99'}, {'stat': 'avg'}. A by-status metric has one entry per status, e.g. {'status': '2xx'}.",
                        "items": {
                            "additionalProperties": {
                                "type": "string"
                            },
                            "type": "object"
                        },
                        "title": "Label Sets",
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "unit_hint",
                    "kind",
                    "label_sets"
                ],
                "title": "ModelMetricDescriptorV1",
                "type": "object"
            },
            "ModelMetricKindV1": {
                "description": "Semantic hint for how a metric behaves, to aid client rendering and\naggregation. It does not describe the value's shape (that is carried by the\ndescriptor's ``label_sets``; a metric may break down into multiple series).\n\n- ``GAUGE``: an instantaneous value (e.g. queue size, running requests).\n- ``COUNTER``: a cumulative total over the step (e.g. tokens, restarts).\n- ``HISTOGRAM``: a distribution, exposed as quantile/average series.",
                "enum": [
                    "GAUGE",
                    "COUNTER",
                    "HISTOGRAM"
                ],
                "title": "ModelMetricKindV1",
                "type": "string"
            },
            "ModelMetricModeV1": {
                "description": "How metric values are aggregated over the request.",
                "enum": [
                    "CURRENT",
                    "SUMMARY",
                    "SERIES"
                ],
                "title": "ModelMetricModeV1",
                "type": "string"
            },
            "ModelMetricUnitHintV1": {
                "description": "Advisory unit of a metric's values. Values are reported as scraped, so the\nhint describes the raw value (e.g. GPU memory is reported in mebibytes).\n\n- ``PER_SECOND``: a rate per second.\n- ``SECONDS``: a duration in seconds.\n- ``BYTES``: a size in bytes.\n- ``MEBIBYTES``: a size in mebibytes (MiB).\n- ``COUNT``: a dimensionless tally of discrete things.\n- ``RATIO``: a dimensionless ratio. Usually in ``[0, 1]`` but may exceed 1\n  (e.g. CPU usage in cores = cpu-seconds/second).",
                "enum": [
                    "PER_SECOND",
                    "SECONDS",
                    "BYTES",
                    "MEBIBYTES",
                    "COUNT",
                    "RATIO"
                ],
                "title": "ModelMetricUnitHintV1",
                "type": "string"
            },
            "ModelMetricValueSetV1": {
                "description": "The metric values for one time step. ``values`` is aligned by index to the\nresponse ``metric_descriptors`` list.",
                "properties": {
                    "start_epoch_millis": {
                        "description": "Start of the step. The step spans until the next value set's start, or the window end for the last one; a summary has a single value set starting at the window start.",
                        "title": "Start Epoch Millis",
                        "type": "integer"
                    },
                    "values": {
                        "description": "Metric values aligned to the ``metric_descriptors`` index. Each entry is a list aligned to that descriptor's ``label_sets`` (a single-element list for a plain metric). A series with no data in this step is null.",
                        "items": {
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "number"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            },
                            "type": "array"
                        },
                        "title": "Values",
                        "type": "array"
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "values"
                ],
                "title": "ModelMetricValueSetV1",
                "type": "object"
            },
            "GetModelMetricsResponseV1": {
                "description": "Model metrics over a time window, index-mapped: metric descriptors appear once\nin ``metric_descriptors``; each value set's ``values`` are aligned to that order.",
                "properties": {
                    "start_epoch_millis": {
                        "description": "Start of the returned window.",
                        "title": "Start Epoch Millis",
                        "type": "integer"
                    },
                    "end_epoch_millis": {
                        "description": "End of the returned window.",
                        "title": "End Epoch Millis",
                        "type": "integer"
                    },
                    "mode": {
                        "$ref": "#/components/schemas/ModelMetricModeV1",
                        "description": "The aggregation mode used."
                    },
                    "step_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Seconds per step; populated only in SERIES mode, null otherwise.",
                        "title": "Step Seconds"
                    },
                    "metric_descriptors": {
                        "description": "Descriptors for each metric; position defines the values index.",
                        "items": {
                            "$ref": "#/components/schemas/ModelMetricDescriptorV1"
                        },
                        "title": "Metric Descriptors",
                        "type": "array"
                    },
                    "metric_values": {
                        "description": "Metric values per time step covering the window. In summary mode this always contains exactly one value set spanning the whole window.",
                        "items": {
                            "$ref": "#/components/schemas/ModelMetricValueSetV1"
                        },
                        "title": "Metric Values",
                        "type": "array"
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis",
                    "mode",
                    "step_seconds",
                    "metric_descriptors",
                    "metric_values"
                ],
                "title": "GetModelMetricsResponseV1",
                "type": "object"
            },
            "GetDeploymentMetricsRequestV1": {
                "description": "Query params for ``GET /v1/models/.../deployments/.../metrics``.",
                "properties": {
                    "mode": {
                        "$ref": "#/components/schemas/ModelMetricModeV1",
                        "default": "CURRENT",
                        "description": "'CURRENT': a single instantaneous snapshot at now; start/end must be omitted. 'SUMMARY': a single value set aggregating the whole window. 'SERIES': evenly-spaced value sets across the window, with the step derived from the window duration."
                    },
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to start fetching metrics. Defaults to one hour before the end.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to end fetching metrics. Defaults to the current time. The window between start and end must not exceed 7 days.",
                        "title": "End Epoch Millis"
                    },
                    "metrics": {
                        "description": "Names of the metrics to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. When omitted, a default set is returned: baseten_replicas_active, baseten_inference_requests_total, and baseten_end_to_end_response_time_seconds. Unknown names are rejected; valid names that do not apply are omitted from the response.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Metrics",
                        "type": "array"
                    }
                },
                "title": "GetDeploymentMetricsRequestV1",
                "type": "object"
            },
            "TerminateReplicaResponseV1": {
                "description": "The response to a request to terminate a replica in a deployment.",
                "properties": {
                    "success": {
                        "default": true,
                        "description": "Whether the replica was successfully terminated",
                        "title": "Success",
                        "type": "boolean"
                    }
                },
                "title": "TerminateReplicaResponseV1",
                "type": "object"
            },
            "SignSSHCertificateRequestV1": {
                "description": "Request to sign an SSH certificate for accessing a workload pod.",
                "properties": {
                    "public_key": {
                        "description": "The user's SSH public key (e.g., 'ssh-ed25519 AAAA... user@host').",
                        "title": "Public Key",
                        "type": "string"
                    },
                    "replica_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The replica to connect to. Required for training jobs (e.g. '0'). Optional for inference (server picks a running replica if omitted).",
                        "title": "Replica Id"
                    }
                },
                "required": [
                    "public_key"
                ],
                "title": "SignSSHCertificateRequestV1",
                "type": "object"
            },
            "SignSSHCertificateResponseV1": {
                "description": "Response containing a signed SSH certificate for proxy authentication.",
                "properties": {
                    "ssh_certificate": {
                        "description": "The signed SSH certificate in OpenSSH format.",
                        "title": "Ssh Certificate",
                        "type": "string"
                    },
                    "jwt": {
                        "description": "Signed JWT (ES256) for SSH proxy authorization.",
                        "title": "Jwt",
                        "type": "string"
                    },
                    "proxy_address": {
                        "description": "Address of the SSH proxy to connect to (host:port).",
                        "title": "Proxy Address",
                        "type": "string"
                    },
                    "ssh_cert_expires_at": {
                        "description": "When the certificate expires, in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Ssh Cert Expires At",
                        "type": "string"
                    }
                },
                "required": [
                    "ssh_certificate",
                    "jwt",
                    "proxy_address",
                    "ssh_cert_expires_at"
                ],
                "title": "SignSSHCertificateResponseV1",
                "type": "object"
            },
            "AutoscalingScheduleSettingsV1": {
                "properties": {
                    "min_replica": {
                        "description": "Minimum number of replicas",
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "description": "Maximum number of replicas",
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Timeframe of traffic considered for autoscaling decisions. Null inherits the environment value.",
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Waiting period before scaling down any active replica. Null inherits the environment value.",
                        "title": "Scale Down Delay"
                    },
                    "concurrency_target": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Number of requests per replica before scaling up. Null inherits the environment value.",
                        "title": "Concurrency Target"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Target utilization percentage for scaling up/down. Null inherits the environment value.",
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Target number of in-flight tokens for autoscaling decisions. Null inherits the environment value. Early access only.",
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Maximum percentage of replicas that can be removed per autoscaling window. Null inherits the environment value.",
                        "title": "Max Scale Down Rate"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "autoscaling_window",
                    "scale_down_delay",
                    "concurrency_target",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate"
                ],
                "title": "AutoscalingScheduleSettingsV1",
                "type": "object"
            },
            "AutoscalingScheduleStateV1": {
                "properties": {
                    "schedule_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Stable schedule identifier, or null when the baseline settings apply",
                        "title": "Schedule Id"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingSettingsV1",
                        "description": "Autoscaling settings on the current serving deployment. In a PATCH response, this snapshot can precede asynchronous schedule reconciliation; poll the GET endpoint for the applied state."
                    }
                },
                "required": [
                    "schedule_id",
                    "autoscaling_settings"
                ],
                "title": "AutoscalingScheduleStateV1",
                "type": "object"
            },
            "AutoscalingScheduleV1": {
                "properties": {
                    "id": {
                        "description": "Stable unique identifier of the schedule",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the schedule",
                        "title": "Name",
                        "type": "string"
                    },
                    "enabled": {
                        "description": "Whether the schedule is enabled",
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingScheduleSettingsV1",
                        "description": "Raw autoscaling overrides applied during the schedule window"
                    },
                    "cadence": {
                        "description": "Cadence of the schedule. DAILY runs once per selected weekday; HOURLY repeats the minute window every hour on selected weekdays.",
                        "enum": [
                            "DAILY",
                            "HOURLY"
                        ],
                        "title": "Cadence",
                        "type": "string"
                    },
                    "weekdays": {
                        "description": "Weekdays on which the schedule runs",
                        "items": {
                            "$ref": "#/components/schemas/AutoscalingScheduleWeekdayV1"
                        },
                        "title": "Weekdays",
                        "type": "array"
                    },
                    "start_hour": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Start hour in the environment schedule timezone. Omitted for unrestricted HOURLY schedules.",
                        "title": "Start Hour"
                    },
                    "start_minute": {
                        "description": "Start minute of the schedule window",
                        "title": "Start Minute",
                        "type": "integer"
                    },
                    "end_hour": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "End hour in the environment schedule timezone. Omitted for unrestricted HOURLY schedules.",
                        "title": "End Hour"
                    },
                    "end_minute": {
                        "description": "End minute of the schedule window",
                        "title": "End Minute",
                        "type": "integer"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "enabled",
                    "autoscaling_settings",
                    "cadence",
                    "weekdays",
                    "start_minute",
                    "end_minute"
                ],
                "title": "AutoscalingScheduleV1",
                "type": "object"
            },
            "AutoscalingScheduleWeekdayV1": {
                "enum": [
                    "SUNDAY",
                    "MONDAY",
                    "TUESDAY",
                    "WEDNESDAY",
                    "THURSDAY",
                    "FRIDAY",
                    "SATURDAY"
                ],
                "title": "AutoscalingScheduleWeekdayV1",
                "type": "string"
            },
            "EnvironmentAutoscalingSchedulesV1": {
                "properties": {
                    "timezone": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "IANA timezone shared by all schedules. Omitted when no schedules exist.",
                        "title": "Timezone"
                    },
                    "schedules": {
                        "description": "Autoscaling schedules ordered by creation time and stable identifier",
                        "items": {
                            "discriminator": {
                                "mapping": {
                                    "DAILY": "#/components/schemas/AutoscalingScheduleV1",
                                    "HOURLY": "#/components/schemas/AutoscalingScheduleV1",
                                    "ONE_TIME": "#/components/schemas/OneTimeAutoscalingScheduleV1"
                                },
                                "propertyName": "cadence"
                            },
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/AutoscalingScheduleV1"
                                },
                                {
                                    "$ref": "#/components/schemas/OneTimeAutoscalingScheduleV1"
                                }
                            ]
                        },
                        "title": "Schedules",
                        "type": "array"
                    },
                    "applied_state": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AutoscalingScheduleStateV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Autoscaling state on the current serving deployment, or null when no deployment exists"
                    }
                },
                "required": [
                    "schedules",
                    "applied_state"
                ],
                "title": "EnvironmentAutoscalingSchedulesV1",
                "type": "object"
            },
            "EnvironmentV1": {
                "description": "Environment for oracles.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "title": "Name",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the environment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "current_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Current deployment of the environment"
                    },
                    "candidate_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Candidate deployment being promoted to the environment, if a promotion is in progress"
                    },
                    "in_progress_promotion": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/InProgressPromotionV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Details of the in-progress promotion, if any"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingSettingsV1",
                        "description": "Autoscaling settings for the environment"
                    },
                    "promotion_settings": {
                        "$ref": "#/components/schemas/PromotionSettingsV1",
                        "description": "Promotion settings for the environment"
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type for the environment"
                    },
                    "request_backpressure_settings": {
                        "$ref": "#/components/schemas/RequestBackpressureSettingsV1",
                        "description": "Request backpressure settings for the environment."
                    },
                    "autoscaling_schedules": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/EnvironmentAutoscalingSchedulesV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling schedules and their evaluated state"
                    }
                },
                "required": [
                    "name",
                    "created_at",
                    "model_id",
                    "current_deployment",
                    "autoscaling_settings",
                    "promotion_settings",
                    "instance_type",
                    "request_backpressure_settings"
                ],
                "title": "EnvironmentV1",
                "type": "object"
            },
            "InProgressPromotionStatusV1": {
                "enum": [
                    "RELEASING",
                    "RAMPING_UP",
                    "RAMPING_DOWN",
                    "PAUSED",
                    "SUCCEEDED",
                    "FAILED",
                    "CANCELED"
                ],
                "title": "InProgressPromotionStatusV1",
                "type": "string"
            },
            "InProgressPromotionV1": {
                "description": "Details of an in-progress promotion.",
                "properties": {
                    "status": {
                        "$ref": "#/components/schemas/InProgressPromotionStatusV1",
                        "description": "Status of the promotion"
                    },
                    "percent_traffic_to_new_version": {
                        "description": "Percentage of traffic routed to the candidate deployment",
                        "title": "Percent Traffic To New Version",
                        "type": "integer"
                    },
                    "error_message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Error message if promotion failed",
                        "title": "Error Message"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether this is a rolling deploy",
                        "title": "Rolling Deploy"
                    }
                },
                "required": [
                    "status",
                    "percent_traffic_to_new_version"
                ],
                "title": "InProgressPromotionV1",
                "type": "object"
            },
            "OneTimeAutoscalingScheduleV1": {
                "properties": {
                    "id": {
                        "description": "Stable unique identifier of the schedule",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the schedule",
                        "title": "Name",
                        "type": "string"
                    },
                    "enabled": {
                        "description": "Whether the schedule is enabled",
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingScheduleSettingsV1",
                        "description": "Raw autoscaling overrides applied during the schedule window"
                    },
                    "cadence": {
                        "const": "ONE_TIME",
                        "description": "One-time schedule cadence",
                        "title": "Cadence",
                        "type": "string"
                    },
                    "start_at": {
                        "description": "Inclusive start of the schedule window",
                        "format": "date-time",
                        "title": "Start At",
                        "type": "string"
                    },
                    "end_at": {
                        "description": "Exclusive end of the schedule window",
                        "format": "date-time",
                        "title": "End At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "enabled",
                    "autoscaling_settings",
                    "cadence",
                    "start_at",
                    "end_at"
                ],
                "title": "OneTimeAutoscalingScheduleV1",
                "type": "object"
            },
            "PromotionCleanupStrategyV1": {
                "description": "The promotion cleanup strategy.",
                "enum": [
                    "KEEP",
                    "SCALE_TO_ZERO",
                    "DEACTIVATE"
                ],
                "title": "PromotionCleanupStrategyV1",
                "type": "string"
            },
            "PromotionSettingsV1": {
                "description": "Promotion settings for promoting chains and oracles",
                "properties": {
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": false,
                        "description": "Whether to deploy on all promotions. Enabling this flag allows model code to safely handle environment-specific logic. When a deployment is promoted, a new deployment will be created with a copy of the image.",
                        "examples": [
                            true
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": false,
                        "description": "Whether the environment should rely on rolling deploy orchestration.",
                        "examples": [
                            true
                        ],
                        "title": "Rolling Deploy"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PromotionCleanupStrategyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": "SCALE_TO_ZERO",
                        "description": "The cleanup strategy to use after a promotion completes.",
                        "examples": [
                            "SCALE_TO_ZERO"
                        ]
                    },
                    "rolling_deploy_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RollingDeployConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Rolling deploy configuration for promotions"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": false,
                        "description": "Whether to ramp up traffic while promoting",
                        "examples": [
                            true
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 600,
                        "description": "Duration of the ramp up in seconds",
                        "examples": [
                            600
                        ],
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "title": "PromotionSettingsV1",
                "type": "object"
            },
            "RollingDeployConfigV1": {
                "description": "Rolling deploy config for promoting chains and oracles",
                "properties": {
                    "rolling_deploy_strategy": {
                        "$ref": "#/components/schemas/RollingDeployStrategyV1",
                        "default": "REPLICA",
                        "description": "The rolling deploy strategy to use for promotions.",
                        "examples": [
                            "REPLICA"
                        ]
                    },
                    "max_surge_percent": {
                        "default": 25,
                        "description": "The maximum surge percentage for rolling deploys.",
                        "examples": [
                            25
                        ],
                        "title": "Max Surge Percent",
                        "type": "integer"
                    },
                    "max_unavailable_percent": {
                        "default": 0,
                        "description": "The maximum unavailable percentage for rolling deploys.",
                        "examples": [
                            10
                        ],
                        "title": "Max Unavailable Percent",
                        "type": "integer"
                    },
                    "stabilization_time_seconds": {
                        "default": 0,
                        "description": "The stabilization time in seconds for rolling deploys.",
                        "examples": [
                            300
                        ],
                        "title": "Stabilization Time Seconds",
                        "type": "integer"
                    },
                    "replica_overhead_percent": {
                        "default": 0,
                        "description": "The replica overhead percentage for rolling deploys.",
                        "examples": [
                            0
                        ],
                        "title": "Replica Overhead Percent",
                        "type": "integer"
                    }
                },
                "title": "RollingDeployConfigV1",
                "type": "object"
            },
            "RollingDeployStrategyV1": {
                "description": "The rolling deploy strategy.",
                "enum": [
                    "REPLICA"
                ],
                "title": "RollingDeployStrategyV1",
                "type": "string"
            },
            "EnvironmentsV1": {
                "description": "list of environments",
                "properties": {
                    "environments": {
                        "items": {
                            "$ref": "#/components/schemas/EnvironmentV1"
                        },
                        "title": "Environments",
                        "type": "array"
                    }
                },
                "required": [
                    "environments"
                ],
                "title": "EnvironmentsV1",
                "type": "object"
            },
            "UpdatePromotionSettingsV1": {
                "description": "Promotion settings for model promotion",
                "properties": {
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether to deploy on all promotions. Enabling this flag allows model code to safely handle environment-specific logic. When a deployment is promoted, a new deployment will be created with a copy of the image.",
                        "examples": [
                            true
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether the environment should rely on rolling deploy orchestration.",
                        "examples": [
                            true
                        ],
                        "title": "Rolling Deploy"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PromotionCleanupStrategyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The cleanup strategy to use after a promotion completes.",
                        "examples": [
                            "SCALE_TO_ZERO"
                        ]
                    },
                    "rolling_deploy_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRollingDeployConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Rolling deploy configuration for promotions"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether to ramp up traffic while promoting",
                        "examples": [
                            true
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Duration of the ramp up in seconds",
                        "examples": [
                            600
                        ],
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "title": "UpdatePromotionSettingsV1",
                "type": "object"
            },
            "UpdateRollingDeployConfigV1": {
                "description": "Rolling deploy config for promoting chains and oracles",
                "properties": {
                    "rolling_deploy_strategy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RollingDeployStrategyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The rolling deploy strategy to use for promotions.",
                        "examples": [
                            "REPLICA"
                        ]
                    },
                    "max_surge_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The maximum surge percentage for rolling deploys.",
                        "examples": [
                            25
                        ],
                        "title": "Max Surge Percent"
                    },
                    "max_unavailable_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The maximum unavailable percentage for rolling deploys.",
                        "examples": [
                            10
                        ],
                        "title": "Max Unavailable Percent"
                    },
                    "stabilization_time_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The stabilization time in seconds for rolling deploys.",
                        "examples": [
                            300
                        ],
                        "title": "Stabilization Time Seconds"
                    },
                    "replica_overhead_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The replica overhead percentage for rolling deploys.",
                        "examples": [
                            0
                        ],
                        "title": "Replica Overhead Percent"
                    }
                },
                "title": "UpdateRollingDeployConfigV1",
                "type": "object"
            },
            "CreateEnvironmentRequestV1": {
                "description": "A request to create an environment.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "examples": [
                            "staging"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the environment",
                        "examples": [
                            {
                                "autoscaling_window": 800,
                                "concurrency_target": 3,
                                "max_replica": 2,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 60,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment. New Model environments use rolling promotions by default. Set `rolling_deploy` to `false` to opt out.",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": false,
                                "rolling_deploy_config": null
                            }
                        ]
                    },
                    "request_backpressure_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRequestBackpressureSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Request backpressure settings for the environment."
                    }
                },
                "required": [
                    "name"
                ],
                "title": "CreateEnvironmentRequestV1",
                "type": "object"
            },
            "EnvironmentTombstoneV1": {
                "description": "An environment tombstone.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "title": "Name",
                        "type": "string"
                    },
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the environment was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "name",
                    "model_id",
                    "deleted"
                ],
                "title": "EnvironmentTombstoneV1",
                "type": "object"
            },
            "AutoscalingScheduleSettingsRequestV1": {
                "additionalProperties": false,
                "description": "A complete set of raw autoscaling overrides for a schedule.",
                "properties": {
                    "min_replica": {
                        "description": "Minimum number of replicas",
                        "title": "Min Replica",
                        "type": "integer"
                    },
                    "max_replica": {
                        "description": "Maximum number of replicas",
                        "title": "Max Replica",
                        "type": "integer"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Timeframe of traffic considered for autoscaling decisions. Null stores no schedule override and follows the current environment value.",
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Waiting period before scaling down any active replica. Null stores no schedule override and follows the current environment value.",
                        "title": "Scale Down Delay"
                    },
                    "concurrency_target": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Number of requests per replica before scaling up. Null stores no schedule override and follows the current environment value.",
                        "title": "Concurrency Target"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Target utilization percentage for scaling up/down. Null stores no schedule override and follows the current environment value.",
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Target number of in-flight tokens for autoscaling decisions. Null stores no schedule override and follows the current environment value. Early access only.",
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "maximum": 50,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Maximum percentage of replicas that can be removed per autoscaling window. Null stores no schedule override and follows the current environment value.",
                        "title": "Max Scale Down Rate"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "autoscaling_window",
                    "scale_down_delay",
                    "concurrency_target",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate"
                ],
                "title": "AutoscalingScheduleSettingsRequestV1",
                "type": "object"
            },
            "AutoscalingScheduleUpsertV1": {
                "additionalProperties": false,
                "description": "A complete recurring schedule submitted for create or replacement.",
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Stable schedule identifier. Omit this field to create a schedule.",
                        "title": "Id"
                    },
                    "name": {
                        "description": "Name of the schedule",
                        "title": "Name",
                        "type": "string"
                    },
                    "enabled": {
                        "description": "Whether the schedule is enabled",
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingScheduleSettingsRequestV1",
                        "description": "Complete raw autoscaling overrides for the schedule. Every field is required; nullable fields store no schedule override and follow the current environment value."
                    },
                    "cadence": {
                        "description": "Recurring schedule cadence",
                        "enum": [
                            "DAILY",
                            "HOURLY"
                        ],
                        "title": "Cadence",
                        "type": "string"
                    },
                    "weekdays": {
                        "description": "Weekdays on which the schedule runs",
                        "items": {
                            "$ref": "#/components/schemas/AutoscalingScheduleWeekdayV1"
                        },
                        "title": "Weekdays",
                        "type": "array"
                    },
                    "start_hour": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Start hour in the environment schedule timezone. Omit for unrestricted HOURLY schedules.",
                        "title": "Start Hour"
                    },
                    "start_minute": {
                        "description": "Start minute of the schedule window",
                        "title": "Start Minute",
                        "type": "integer"
                    },
                    "end_hour": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "End hour in the environment schedule timezone. Omit for unrestricted HOURLY schedules.",
                        "title": "End Hour"
                    },
                    "end_minute": {
                        "description": "End minute of the schedule window",
                        "title": "End Minute",
                        "type": "integer"
                    }
                },
                "required": [
                    "name",
                    "enabled",
                    "autoscaling_settings",
                    "cadence",
                    "weekdays",
                    "start_minute",
                    "end_minute"
                ],
                "title": "AutoscalingScheduleUpsertV1",
                "type": "object"
            },
            "OneTimeAutoscalingScheduleUpsertV1": {
                "additionalProperties": false,
                "description": "A complete one-time schedule submitted for create or replacement.",
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Stable schedule identifier. Omit this field to create a schedule.",
                        "title": "Id"
                    },
                    "name": {
                        "description": "Name of the schedule",
                        "title": "Name",
                        "type": "string"
                    },
                    "enabled": {
                        "description": "Whether the schedule is enabled",
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingScheduleSettingsRequestV1",
                        "description": "Complete raw autoscaling overrides for the schedule. Every field is required; nullable fields store no schedule override and follow the current environment value."
                    },
                    "cadence": {
                        "const": "ONE_TIME",
                        "description": "One-time schedule cadence",
                        "title": "Cadence",
                        "type": "string"
                    },
                    "start_at": {
                        "description": "Inclusive start of the schedule window in ISO 8601 format. New schedules must start in the future.",
                        "format": "date-time",
                        "title": "Start At",
                        "type": "string"
                    },
                    "end_at": {
                        "description": "Exclusive end of the schedule window in ISO 8601 format",
                        "format": "date-time",
                        "title": "End At",
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "enabled",
                    "autoscaling_settings",
                    "cadence",
                    "start_at",
                    "end_at"
                ],
                "title": "OneTimeAutoscalingScheduleUpsertV1",
                "type": "object"
            },
            "UpdateAutoscalingScheduleSettingsV1": {
                "additionalProperties": false,
                "description": "Partial mutation of an environment's autoscaling schedule collection.",
                "properties": {
                    "timezone": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "IANA timezone shared by the resulting collection. Omission preserves the current timezone; null is allowed only when deleting every schedule.",
                        "title": "Timezone",
                        "x-null-distinct": true
                    },
                    "schedules": {
                        "description": "Complete schedules to create or replace. Existing schedules omitted from this list are unchanged.",
                        "items": {
                            "discriminator": {
                                "mapping": {
                                    "DAILY": "#/components/schemas/AutoscalingScheduleUpsertV1",
                                    "HOURLY": "#/components/schemas/AutoscalingScheduleUpsertV1",
                                    "ONE_TIME": "#/components/schemas/OneTimeAutoscalingScheduleUpsertV1"
                                },
                                "propertyName": "cadence"
                            },
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/AutoscalingScheduleUpsertV1"
                                },
                                {
                                    "$ref": "#/components/schemas/OneTimeAutoscalingScheduleUpsertV1"
                                }
                            ]
                        },
                        "title": "Schedules",
                        "type": "array"
                    },
                    "delete_schedules": {
                        "description": "Stable identifiers of schedules to delete. To clear all schedules, include every existing schedule identifier.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Delete Schedules",
                        "type": "array"
                    }
                },
                "title": "UpdateAutoscalingScheduleSettingsV1",
                "type": "object"
            },
            "UpdateEnvironmentRequestV1": {
                "additionalProperties": false,
                "description": "A request to update an environment.",
                "properties": {
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the environment",
                        "examples": [
                            {
                                "autoscaling_window": 800,
                                "concurrency_target": 3,
                                "max_replica": 2,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 60,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": null,
                                "rolling_deploy_config": null
                            }
                        ]
                    },
                    "autoscaling_schedule_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingScheduleSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Partial autoscaling schedule collection update. Omitted collection fields and existing schedules are unchanged; each submitted schedule is a complete create or replacement.",
                        "examples": [
                            {
                                "schedules": [
                                    {
                                        "autoscaling_settings": {
                                            "autoscaling_window": null,
                                            "concurrency_target": null,
                                            "max_replica": 8,
                                            "max_scale_down_rate": null,
                                            "min_replica": 2,
                                            "scale_down_delay": null,
                                            "target_in_flight_tokens": null,
                                            "target_utilization_percentage": null
                                        },
                                        "cadence": "DAILY",
                                        "enabled": true,
                                        "end_hour": 10,
                                        "end_minute": 0,
                                        "name": "weekday-peak",
                                        "start_hour": 8,
                                        "start_minute": 0,
                                        "weekdays": [
                                            "MONDAY",
                                            "TUESDAY",
                                            "WEDNESDAY",
                                            "THURSDAY",
                                            "FRIDAY"
                                        ]
                                    }
                                ],
                                "timezone": "America/Los_Angeles"
                            },
                            {
                                "delete_schedules": [
                                    "schedule-id"
                                ]
                            }
                        ]
                    },
                    "request_backpressure_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRequestBackpressureSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Request backpressure settings for the environment.",
                        "examples": [
                            {
                                "policy": "REJECT_ON_FULL"
                            }
                        ]
                    }
                },
                "title": "UpdateEnvironmentRequestV1",
                "type": "object"
            },
            "UpdateEnvironmentResponseV1": {
                "description": "The response to a request to update an environment's settings.",
                "properties": {
                    "environment": {
                        "$ref": "#/components/schemas/EnvironmentV1",
                        "description": "The environment after the update, matching the shape returned by GET."
                    },
                    "status": {
                        "$ref": "#/components/schemas/UpdateAutoscalingSettingsStatusV1",
                        "deprecated": true,
                        "description": "Deprecated. Kept for legacy autoscaling-only update operation behavior."
                    },
                    "message": {
                        "deprecated": true,
                        "description": "Deprecated. Kept for legacy autoscaling-only update operation behavior.",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "environment",
                    "status",
                    "message"
                ],
                "title": "UpdateEnvironmentResponseV1",
                "type": "object"
            },
            "GetEnvironmentLogsRequestV1": {
                "description": "A request to fetch logs for a model environment.\n\nReturns logs from every deployment that was active on the environment over\nthe requested time range, merged in timestamp order.",
                "properties": {
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort order for logs"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 500,
                        "description": "Limit of logs to fetch in a single request",
                        "title": "Limit"
                    },
                    "min_level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level."
                    },
                    "replica": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only return logs emitted by this replica (5-char short ID).",
                        "title": "Replica"
                    },
                    "request_id": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only return logs tagged with this inference request ID.",
                        "title": "Request Id"
                    },
                    "component": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only return logs from this component.",
                        "title": "Component"
                    },
                    "search_pattern": {
                        "anyOf": [
                            {
                                "maxLength": 256,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "RE2 regular expression matched against the log message. Prefer `includes` and `excludes` for plain substring matches.",
                        "title": "Search Pattern"
                    },
                    "includes": {
                        "description": "Case-sensitive substrings that must all appear in the log message.",
                        "items": {
                            "type": "string"
                        },
                        "maxItems": 8,
                        "title": "Includes",
                        "type": "array"
                    },
                    "excludes": {
                        "description": "Case-sensitive substrings; lines containing any of these are dropped.",
                        "items": {
                            "type": "string"
                        },
                        "maxItems": 8,
                        "title": "Excludes",
                        "type": "array"
                    }
                },
                "title": "GetEnvironmentLogsRequestV1",
                "type": "object"
            },
            "GetEnvironmentMetricsRequestV1": {
                "description": "Query params for ``GET /v1/models/.../environments/.../metrics``.",
                "properties": {
                    "mode": {
                        "$ref": "#/components/schemas/ModelMetricModeV1",
                        "default": "CURRENT",
                        "description": "'CURRENT': a single instantaneous snapshot at now; start/end must be omitted. 'SUMMARY': a single value set aggregating the whole window. 'SERIES': evenly-spaced value sets across the window, with the step derived from the window duration."
                    },
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to start fetching metrics. Defaults to one hour before the end.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to end fetching metrics. Defaults to the current time. The window between start and end must not exceed 7 days.",
                        "title": "End Epoch Millis"
                    },
                    "metrics": {
                        "description": "Names of the metrics to return; see https://docs.baseten.co/observability/export-metrics/supported-metrics for the available names. When omitted, a default set is returned: baseten_replicas_active, baseten_inference_requests_total, and baseten_end_to_end_response_time_seconds. Unknown names are rejected; valid names that do not apply are omitted from the response.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Metrics",
                        "type": "array"
                    }
                },
                "title": "GetEnvironmentMetricsRequestV1",
                "type": "object"
            },
            "PromoteToEnvironmentRequestV1": {
                "description": "A request to promote a deployment to a environment.",
                "properties": {
                    "scale_down_previous_deployment": {
                        "default": true,
                        "description": "Whether to scale down the previous deployment after promoting",
                        "examples": [
                            true
                        ],
                        "title": "Scale Down Previous Deployment",
                        "type": "boolean"
                    },
                    "deployment_id": {
                        "description": "The id of the deployment to promote",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "preserve_env_instance_type": {
                        "default": true,
                        "description": "Whether to use the promoting deployment's instance type or preserve target environment's instance type",
                        "examples": [
                            true
                        ],
                        "title": "Preserve Env Instance Type",
                        "type": "boolean"
                    }
                },
                "required": [
                    "deployment_id"
                ],
                "title": "PromoteToEnvironmentRequestV1",
                "type": "object"
            },
            "CancelPromotionStatusV1": {
                "description": "The status of a request to cancel a promotion.",
                "enum": [
                    "CANCELED",
                    "RAMPING_DOWN"
                ],
                "title": "CancelPromotionStatusV1",
                "type": "string"
            },
            "CancelPromotionResponseV1": {
                "description": "The response to a request to cancel a promotion.",
                "properties": {
                    "status": {
                        "$ref": "#/components/schemas/CancelPromotionStatusV1",
                        "description": "Status of the request to cancel a promotion. Can be CANCELED or RAMPING_DOWN."
                    },
                    "message": {
                        "description": "A message describing the status of the request to cancel a promotion",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "status",
                    "message"
                ],
                "title": "CancelPromotionResponseV1",
                "type": "object"
            },
            "SignalPromotionResponseV1": {
                "description": "The response to a request to signal a rolling promotion.",
                "properties": {
                    "success": {
                        "description": "Whether the signal was successfully sent",
                        "title": "Success",
                        "type": "boolean"
                    }
                },
                "required": [
                    "success"
                ],
                "title": "SignalPromotionResponseV1",
                "type": "object"
            },
            "ChainV1": {
                "description": "A chain.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the chain was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the chain",
                        "title": "Name",
                        "type": "string"
                    },
                    "deployments_count": {
                        "description": "Number of deployments of the chain",
                        "title": "Deployments Count",
                        "type": "integer"
                    },
                    "team_name": {
                        "description": "Name of the team associated with the chain",
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "name",
                    "deployments_count",
                    "team_name"
                ],
                "title": "ChainV1",
                "type": "object"
            },
            "ChainsV1": {
                "description": "A list of chains.",
                "properties": {
                    "chains": {
                        "items": {
                            "$ref": "#/components/schemas/ChainV1"
                        },
                        "title": "Chains",
                        "type": "array"
                    }
                },
                "required": [
                    "chains"
                ],
                "title": "ChainsV1",
                "type": "object"
            },
            "ChainTombstoneV1": {
                "description": "A chain tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the chain was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "ChainTombstoneV1",
                "type": "object"
            },
            "ChainDeploymentV1": {
                "description": "A deployment of a chain.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain deployment",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the chain deployment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "environment": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Environment the chain deployment is deployed in",
                        "title": "Environment"
                    },
                    "chainlets": {
                        "description": "Chainlets in the chain deployment",
                        "items": {
                            "$ref": "#/components/schemas/ChainletV1"
                        },
                        "title": "Chainlets",
                        "type": "array"
                    },
                    "status": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "Status of the chain deployment"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "chain_id",
                    "environment",
                    "chainlets",
                    "status"
                ],
                "title": "ChainDeploymentV1",
                "type": "object"
            },
            "ChainletV1": {
                "description": "A chainlet in a chain deployment.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chainlet",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the chainlet",
                        "title": "Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Autoscaling settings for the chainlet. If null, it has not finished deploying"
                    },
                    "instance_type_name": {
                        "description": "Name of the instance type the chainlet is deployed on",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "active_replica_count": {
                        "description": "Number of active replicas",
                        "title": "Active Replica Count",
                        "type": "integer"
                    },
                    "status": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "Status of the chainlet"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "autoscaling_settings",
                    "instance_type_name",
                    "active_replica_count",
                    "status"
                ],
                "title": "ChainletV1",
                "type": "object"
            },
            "ChainDeploymentsV1": {
                "description": "A list of chain deployments.",
                "properties": {
                    "deployments": {
                        "description": "A list of chain deployments",
                        "items": {
                            "$ref": "#/components/schemas/ChainDeploymentV1"
                        },
                        "title": "Deployments",
                        "type": "array"
                    }
                },
                "required": [
                    "deployments"
                ],
                "title": "ChainDeploymentsV1",
                "type": "object"
            },
            "ChainDeploymentTombstoneV1": {
                "description": "A chain deployment tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain deployment",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the chain deployment was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    },
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "deleted",
                    "chain_id"
                ],
                "title": "ChainDeploymentTombstoneV1",
                "type": "object"
            },
            "ChainletEnvironmentSettingsRequestV1": {
                "description": "Request to create environment settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "examples": [
                            "HelloWorld"
                        ],
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the chainlet",
                        "examples": [
                            {
                                "autoscaling_window": 60,
                                "concurrency_target": 1,
                                "max_replica": 1,
                                "max_scale_down_rate": null,
                                "min_replica": 0,
                                "scale_down_delay": 900,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": 70
                            }
                        ]
                    },
                    "instance_type_id": {
                        "default": "1x2",
                        "description": "ID of the instance type to use for the chainlet",
                        "examples": [
                            "1x4",
                            "2x8",
                            "A10G:2x24x96",
                            "H100:2x52x468"
                        ],
                        "title": "Instance Type Id",
                        "type": "string"
                    }
                },
                "required": [
                    "chainlet_name"
                ],
                "title": "ChainletEnvironmentSettingsRequestV1",
                "type": "object"
            },
            "CreateChainEnvironmentRequestV1": {
                "description": "A request to create a custom environment for a chain.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "examples": [
                            "staging"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": null,
                                "rolling_deploy_config": null
                            }
                        ]
                    },
                    "chainlet_settings": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/ChainletEnvironmentSettingsRequestV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Mapping of chainlet name to the desired chainlet environment settings",
                        "examples": [
                            [
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": 800,
                                        "concurrency_target": 4,
                                        "max_replica": 3,
                                        "max_scale_down_rate": null,
                                        "min_replica": 2,
                                        "scale_down_delay": 63,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "HelloWorld",
                                    "instance_type_id": "2x8"
                                },
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": null,
                                        "concurrency_target": null,
                                        "max_replica": 3,
                                        "max_scale_down_rate": null,
                                        "min_replica": 3,
                                        "scale_down_delay": null,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "RandInt",
                                    "instance_type_id": "A10Gx8x32"
                                }
                            ]
                        ],
                        "title": "Chainlet Settings"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "CreateChainEnvironmentRequestV1",
                "type": "object"
            },
            "ChainletEnvironmentSettingsV1": {
                "description": "Environment settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Autoscaling settings for the chainlet. If null, it has not finished deploying"
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type for the chainlet"
                    }
                },
                "required": [
                    "chainlet_name",
                    "autoscaling_settings",
                    "instance_type"
                ],
                "title": "ChainletEnvironmentSettingsV1",
                "type": "object"
            },
            "ChainEnvironmentV1": {
                "description": "Environment for oracles.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "title": "Name",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the environment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "promotion_settings": {
                        "$ref": "#/components/schemas/PromotionSettingsV1",
                        "description": "Promotion settings for the environment"
                    },
                    "chainlet_settings": {
                        "description": "Environment settings for the chainlets",
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentSettingsV1"
                        },
                        "title": "Chainlet Settings",
                        "type": "array"
                    },
                    "current_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainDeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Current chain deployment of the environment"
                    },
                    "candidate_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainDeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Candidate chain deployment being promoted to the environment, if a promotion is in progress"
                    },
                    "in_progress_promotion": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/InProgressPromotionV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Details of the in-progress promotion, if any"
                    }
                },
                "required": [
                    "name",
                    "created_at",
                    "chain_id",
                    "promotion_settings",
                    "chainlet_settings",
                    "current_deployment"
                ],
                "title": "ChainEnvironmentV1",
                "type": "object"
            },
            "UpdateChainEnvironmentRequestV1": {
                "description": "A request to update a chain environment.",
                "properties": {
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": null,
                                "rolling_deploy": null,
                                "rolling_deploy_config": null
                            }
                        ]
                    }
                },
                "title": "UpdateChainEnvironmentRequestV1",
                "type": "object"
            },
            "UpdateChainEnvironmentResponseV1": {
                "description": "A response to update a chain environment.",
                "properties": {
                    "ok": {
                        "description": "Whether the update was successful",
                        "title": "Ok",
                        "type": "boolean"
                    }
                },
                "required": [
                    "ok"
                ],
                "title": "UpdateChainEnvironmentResponseV1",
                "type": "object"
            },
            "PromoteToChainEnvironmentRequestV1": {
                "description": "A request to promote a deployment to a environment.",
                "properties": {
                    "scale_down_previous_deployment": {
                        "default": true,
                        "description": "Whether to scale down the previous deployment after promoting",
                        "examples": [
                            true
                        ],
                        "title": "Scale Down Previous Deployment",
                        "type": "boolean"
                    },
                    "deployment_id": {
                        "description": "The id of the chain deployment to promote",
                        "title": "Deployment Id",
                        "type": "string"
                    }
                },
                "required": [
                    "deployment_id"
                ],
                "title": "PromoteToChainEnvironmentRequestV1",
                "type": "object"
            },
            "ChainletEnvironmentAutoscalingSettingsUpdateV1": {
                "description": "The request to update the autoscaling settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "examples": [
                            "HelloWorld"
                        ],
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1",
                        "description": "Autoscaling settings for the chainlet",
                        "examples": [
                            {
                                "autoscaling_window": 800,
                                "concurrency_target": 3,
                                "max_replica": 2,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 60,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    }
                },
                "required": [
                    "chainlet_name",
                    "autoscaling_settings"
                ],
                "title": "ChainletEnvironmentAutoscalingSettingsUpdateV1",
                "type": "object"
            },
            "UpdateChainletEnvironmentAutoscalingSettingsRequestV1": {
                "description": "A request to update the autoscaling settings for a multiple chainlets in an environment.\nIf a chainlet name doesn't exist, an error is returned.",
                "properties": {
                    "updates": {
                        "description": "Mapping of chainlet name to the desired chainlet autoscaling settings. If the chainlet name doesn't exist, an error is returned.",
                        "examples": [
                            [
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": 800,
                                        "concurrency_target": 4,
                                        "max_replica": 3,
                                        "max_scale_down_rate": null,
                                        "min_replica": 2,
                                        "scale_down_delay": 63,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "HelloWorld"
                                }
                            ],
                            [
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": null,
                                        "concurrency_target": null,
                                        "max_replica": null,
                                        "max_scale_down_rate": null,
                                        "min_replica": 0,
                                        "scale_down_delay": null,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "HelloWorld"
                                },
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": null,
                                        "concurrency_target": null,
                                        "max_replica": null,
                                        "max_scale_down_rate": null,
                                        "min_replica": 0,
                                        "scale_down_delay": null,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "RandInt"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentAutoscalingSettingsUpdateV1"
                        },
                        "title": "Updates",
                        "type": "array"
                    }
                },
                "required": [
                    "updates"
                ],
                "title": "UpdateChainletEnvironmentAutoscalingSettingsRequestV1",
                "type": "object"
            },
            "ChainletEnvironmentInstanceTypeUpdateV1": {
                "description": "A request to update the environment settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "examples": [
                            "HelloWorld"
                        ],
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "instance_type_id": {
                        "description": "Key of the instance type to use for the chainlet",
                        "examples": [
                            "1x4",
                            "2x8",
                            "A10G:2x24x96"
                        ],
                        "title": "Instance Type Id",
                        "type": "string"
                    }
                },
                "required": [
                    "chainlet_name",
                    "instance_type_id"
                ],
                "title": "ChainletEnvironmentInstanceTypeUpdateV1",
                "type": "object"
            },
            "UpdateChainletEnvironmentInstanceTypeRequestV1": {
                "description": "A request to update the instance types for chainlets in an environment. Multiples\nupdates can be made in one request. The updates will be processed in batch and a new deployment\nwill be created, deployed and promoted into the environment.",
                "properties": {
                    "updates": {
                        "description": "Mapping of chainlet name to the desired chainlet instance type. If the chainlet name doesn't exist, an error is returned.",
                        "examples": [
                            [
                                {
                                    "chainlet_name": "HelloWorld",
                                    "instance_type_id": "1x4"
                                },
                                {
                                    "chainlet_name": "RandInt",
                                    "instance_type_id": "A10G:2x24x96"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentInstanceTypeUpdateV1"
                        },
                        "title": "Updates",
                        "type": "array"
                    }
                },
                "required": [
                    "updates"
                ],
                "title": "UpdateChainletEnvironmentInstanceTypeRequestV1",
                "type": "object"
            },
            "UpdateChainletEnvironmentInstanceTypeResponseV1": {
                "description": "A response to update the environment settings for a chainlet. If updating the instance type\nresulted in a re-deployment, `requires_redeployment` will be True and the resulting deployment\nwill be returned in the `chain_deployment` field.",
                "properties": {
                    "requires_redeployment": {
                        "description": "Whether the resource update requires a re-deployment to update the instance type.",
                        "title": "Requires Redeployment",
                        "type": "boolean"
                    },
                    "chain_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainDeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The chain deployment resulting from the resource update, if any."
                    },
                    "chainlet_environment_settings": {
                        "description": "The updated chainlet environment settings",
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentSettingsV1"
                        },
                        "title": "Chainlet Environment Settings",
                        "type": "array"
                    }
                },
                "required": [
                    "requires_redeployment",
                    "chain_deployment",
                    "chainlet_environment_settings"
                ],
                "title": "UpdateChainletEnvironmentInstanceTypeResponseV1",
                "type": "object"
            },
            "UpsertTrainingProjectV1": {
                "description": "Fields that can be upserted on a training project.",
                "properties": {
                    "name": {
                        "description": "Name of the training project.",
                        "examples": [
                            "My Training Project"
                        ],
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "UpsertTrainingProjectV1",
                "type": "object"
            },
            "UpsertTrainingProjectRequestV1": {
                "description": "A request to upsert a training project.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/UpsertTrainingProjectV1",
                        "description": "The training project to upsert."
                    }
                },
                "required": [
                    "training_project"
                ],
                "title": "UpsertTrainingProjectRequestV1",
                "type": "object"
            },
            "CheckpointSyncStatus": {
                "description": "Lifecycle state for the checkpoint uploader.",
                "enum": [
                    "SYNCING",
                    "COMPLETED"
                ],
                "title": "CheckpointSyncStatus",
                "type": "string"
            },
            "TrainingJobV1": {
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training job.",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the job was created in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "current_status": {
                        "description": "Current status of the training job.",
                        "title": "Current Status",
                        "type": "string"
                    },
                    "error_message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Error message if the training job failed.",
                        "title": "Error Message"
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type of the training job."
                    },
                    "node_count": {
                        "default": 1,
                        "description": "Number of nodes the job runs on. The instance type describes a single node, so the job's total GPU count is gpu_count multiplied by node_count.",
                        "examples": [
                            2
                        ],
                        "minimum": 1,
                        "title": "Node Count",
                        "type": "integer"
                    },
                    "updated_at": {
                        "description": "Time the job was updated in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    },
                    "training_project_id": {
                        "description": "ID of the training project.",
                        "title": "Training Project Id",
                        "type": "string"
                    },
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectSummaryV1",
                        "description": "Summary of the training project."
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the training job.",
                        "examples": [
                            "gpt-oss-job"
                        ],
                        "title": "Name"
                    },
                    "checkpoint_sync_status": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CheckpointSyncStatus"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Checkpoint sync status of the training job."
                    },
                    "priority": {
                        "default": 0,
                        "description": "Queue priority. Higher values are dequeued first. NULL is treated as 0.",
                        "title": "Priority",
                        "type": "integer"
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity guarantee for the job. 'dedicated' is non-preemptible on-demand capacity; 'spot' is interruptible."
                    },
                    "user": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UserV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The user who created the training job."
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "current_status",
                    "instance_type",
                    "updated_at",
                    "training_project_id",
                    "training_project"
                ],
                "title": "TrainingJobV1",
                "type": "object"
            },
            "TrainingProjectSummaryV1": {
                "description": "A summary of a training project.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training project.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the training project.",
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name"
                ],
                "title": "TrainingProjectSummaryV1",
                "type": "object"
            },
            "TrainingProjectV1": {
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training project",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the training project.",
                        "title": "Name",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the training project was created in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Time the training project was updated in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the team associated with the training project.",
                        "title": "Team Name"
                    },
                    "latest_job": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingJobV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Most recently created training job for the training project."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "created_at",
                    "updated_at",
                    "latest_job"
                ],
                "title": "TrainingProjectV1",
                "type": "object"
            },
            "UserV1": {
                "description": "A user.",
                "properties": {
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Email of the user.",
                        "title": "Email"
                    }
                },
                "title": "UserV1",
                "type": "object"
            },
            "V1AvailabilityModel": {
                "description": "Capacity guarantee under which a training job is scheduled.\n\n``DEDICATED`` is on-demand capacity that is not preempted (the default). ``SPOT`` is\ninterruptible capacity that may be preempted; the user is responsible for checkpointing\ntheir own progress. A managed/resumable model where the platform handles\ncheckpoint/resume on its own is intentionally not defined yet; it is planned for a\nfuture milestone.",
                "enum": [
                    "dedicated",
                    "spot"
                ],
                "title": "V1AvailabilityModel",
                "type": "string"
            },
            "UpsertTrainingProjectResponseV1": {
                "description": "A response to upserting a training project.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The upserted training project."
                    }
                },
                "required": [
                    "training_project"
                ],
                "title": "UpsertTrainingProjectResponseV1",
                "type": "object"
            },
            "ListTrainingProjectsResponseV1": {
                "description": "A response to list training projects.",
                "properties": {
                    "training_projects": {
                        "description": "List of training projects.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingProjectV1"
                        },
                        "title": "Training Projects",
                        "type": "array"
                    }
                },
                "required": [
                    "training_projects"
                ],
                "title": "ListTrainingProjectsResponseV1",
                "type": "object"
            },
            "ListTrainingJobsResponseV1": {
                "description": "A response to list training jobs.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The training project."
                    },
                    "training_jobs": {
                        "description": "List of training jobs.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobV1"
                        },
                        "title": "Training Jobs",
                        "type": "array"
                    }
                },
                "required": [
                    "training_project",
                    "training_jobs"
                ],
                "title": "ListTrainingJobsResponseV1",
                "type": "object"
            },
            "AuthMethod": {
                "enum": [
                    "CUSTOM_SECRET",
                    "AWS_OIDC",
                    "GCP_OIDC",
                    "AWS_ASSUME_ROLE"
                ],
                "title": "AuthMethod",
                "type": "string"
            },
            "AwsAssumeRoleDockerAuthV1": {
                "description": "AWS assume-role details for the registry.",
                "properties": {
                    "role_arn": {
                        "description": "AWS IAM role ARN that Baseten assumes to pull from the registry. The role's trust policy must allow Baseten's AWS principal with your Baseten-provided external ID.",
                        "title": "Role Arn",
                        "type": "string"
                    },
                    "region": {
                        "description": "AWS region of the registry",
                        "title": "Region",
                        "type": "string"
                    }
                },
                "required": [
                    "role_arn",
                    "region"
                ],
                "title": "AwsAssumeRoleDockerAuthV1",
                "type": "object"
            },
            "AwsIamDockerAuthV1": {
                "description": "AWS details for the registry.",
                "properties": {
                    "access_key_secret_ref": {
                        "$ref": "#/components/schemas/SecretReferenceV1",
                        "description": "Name of the access key secret"
                    },
                    "secret_access_key_secret_ref": {
                        "$ref": "#/components/schemas/SecretReferenceV1",
                        "description": "Name of the secret key secret"
                    }
                },
                "required": [
                    "access_key_secret_ref",
                    "secret_access_key_secret_ref"
                ],
                "title": "AwsIamDockerAuthV1",
                "type": "object"
            },
            "AwsOidcDockerAuthV1": {
                "description": "AWS OIDC details for the registry.",
                "properties": {
                    "role_arn": {
                        "description": "AWS IAM role ARN for OIDC authentication",
                        "title": "Role Arn",
                        "type": "string"
                    },
                    "region": {
                        "description": "AWS region for OIDC authentication",
                        "title": "Region",
                        "type": "string"
                    }
                },
                "required": [
                    "role_arn",
                    "region"
                ],
                "title": "AwsOidcDockerAuthV1",
                "type": "object"
            },
            "BasetenLatestCheckpointConfig": {
                "properties": {
                    "project_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the project to load the checkpoint from",
                        "title": "Project Name"
                    },
                    "job_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the job to load the checkpoint from",
                        "title": "Job Id"
                    },
                    "typ": {
                        "const": "baseten_latest_checkpoint",
                        "default": "baseten_latest_checkpoint",
                        "title": "Typ",
                        "type": "string"
                    }
                },
                "title": "BasetenLatestCheckpointConfig",
                "type": "object"
            },
            "BasetenNamedCheckpointConfig": {
                "properties": {
                    "checkpoint_name": {
                        "description": "Name of the checkpoint to load from",
                        "title": "Checkpoint Name",
                        "type": "string"
                    },
                    "project_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the project to load the checkpoint from",
                        "title": "Project Name"
                    },
                    "job_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the job to load the checkpoint from",
                        "title": "Job Id"
                    },
                    "typ": {
                        "const": "baseten_named_checkpoint",
                        "default": "baseten_named_checkpoint",
                        "title": "Typ",
                        "type": "string"
                    }
                },
                "required": [
                    "checkpoint_name"
                ],
                "title": "BasetenNamedCheckpointConfig",
                "type": "object"
            },
            "CreateJobWeightConfigV1": {
                "description": "Weight source configuration for MDN (Model Distribution Network).\n\nEnables training jobs to mount external model weights from HuggingFace, S3, GCS, R2,\nor CoreWeave via MDN's caching and CSI mounting infrastructure. Weights are mirrored\nonce and deduplicated across training jobs.",
                "properties": {
                    "source": {
                        "description": "Weight source URI. Supported formats: hf://, s3://, gs://, r2://, cw://",
                        "examples": [
                            "hf://meta-llama/Llama-3-8B@main",
                            "s3://my-bucket/models/llama",
                            "gs://my-bucket/models/llama",
                            "r2://account_id.bucket/models/llama",
                            "r2://account_id.eu.bucket/models/llama",
                            "cw://my-bucket/models/llama"
                        ],
                        "title": "Source",
                        "type": "string"
                    },
                    "mount_location": {
                        "description": "Path where weights will be mounted in the container",
                        "examples": [
                            "/app/models/base",
                            "/models/llama"
                        ],
                        "title": "Mount Location",
                        "type": "string"
                    },
                    "allow_patterns": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "File patterns to include (Unix-style shell patterns)",
                        "examples": [
                            [
                                "*.safetensors",
                                "config.json"
                            ]
                        ],
                        "title": "Allow Patterns"
                    },
                    "ignore_patterns": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "File patterns to exclude (Unix-style shell patterns)",
                        "examples": [
                            [
                                "*.bin",
                                "*.h5"
                            ]
                        ],
                        "title": "Ignore Patterns"
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the workspace secret for authentication (e.g., HuggingFace token)",
                        "examples": [
                            "hf_token",
                            "aws_credentials"
                        ],
                        "title": "Auth Secret Name"
                    },
                    "auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingWeightAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Authentication configuration for the weight source.",
                        "examples": [
                            {
                                "auth_method": "CUSTOM_SECRET",
                                "auth_secret_name": "hf_token"
                            },
                            {
                                "auth_method": "AWS_OIDC",
                                "aws_oidc_region": "us-east-1",
                                "aws_oidc_role_arn": "arn:aws:iam::123456789012:role/weights-access"
                            },
                            {
                                "auth_method": "GCP_OIDC",
                                "gcp_oidc_service_account": "weights-reader@example.iam.gserviceaccount.com",
                                "gcp_oidc_workload_id_provider": "projects/123456789/locations/global/workloadIdentityPools/baseten/providers/baseten"
                            },
                            {
                                "auth_method": "AWS_ASSUME_ROLE",
                                "aws_assume_role_arn": "arn:aws:iam::123456789012:role/baseten-customer-access",
                                "aws_assume_role_region": "us-east-1"
                            }
                        ]
                    }
                },
                "required": [
                    "source",
                    "mount_location"
                ],
                "title": "CreateJobWeightConfigV1",
                "type": "object"
            },
            "CreateTrainingJobAcceleratorV1": {
                "properties": {
                    "accelerator": {
                        "description": "GPU type for the training job.",
                        "examples": [
                            "H100"
                        ],
                        "title": "Accelerator",
                        "type": "string"
                    },
                    "count": {
                        "description": "GPUs needed for the training job.",
                        "examples": [
                            2
                        ],
                        "title": "Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "accelerator",
                    "count"
                ],
                "title": "CreateTrainingJobAcceleratorV1",
                "type": "object"
            },
            "CreateTrainingJobCacheConfig": {
                "properties": {
                    "enable_legacy_hf_mount": {
                        "default": false,
                        "description": "Whether to enable the legacy Hugging Face cache.",
                        "examples": [
                            true
                        ],
                        "title": "Enable Legacy Hf Mount",
                        "type": "boolean"
                    },
                    "enabled": {
                        "default": false,
                        "description": "Whether to enable the read-write cache.",
                        "examples": [
                            true
                        ],
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "require_cache_affinity": {
                        "default": true,
                        "description": "Whether to require region affinity for the read-write cache. If False, the resulting job is not guaranteed to be deployed alongside the previous cache.",
                        "examples": [
                            true,
                            false
                        ],
                        "title": "Require Cache Affinity",
                        "type": "boolean"
                    },
                    "mount_base_path": {
                        "default": "/root/.cache",
                        "description": "Mount base path for the cache directory. The project cache and team cache will be mounted under this path.",
                        "examples": [
                            "/workspace/.cache",
                            "/root/.cache"
                        ],
                        "title": "Mount Base Path",
                        "type": "string"
                    }
                },
                "title": "CreateTrainingJobCacheConfig",
                "type": "object"
            },
            "CreateTrainingJobCheckpointingConfig": {
                "properties": {
                    "enabled": {
                        "default": false,
                        "description": "Whether checkpointing is enabled.",
                        "examples": [
                            true
                        ],
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "checkpoint_path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "path where checkpoints will be saved.",
                        "examples": [
                            "/mnt/ckpts"
                        ],
                        "title": "Checkpoint Path"
                    },
                    "volume_size_gib": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Size of the volume in gibibytes. If not provided, the default size will be used",
                        "examples": [
                            10
                        ],
                        "title": "Volume Size Gib"
                    }
                },
                "title": "CreateTrainingJobCheckpointingConfig",
                "type": "object"
            },
            "CreateTrainingJobComputeV1": {
                "description": "Configuration to specify the compute for a training job.",
                "properties": {
                    "node_count": {
                        "default": 1,
                        "description": "Number of nodes for the training job.",
                        "examples": [
                            1
                        ],
                        "title": "Node Count",
                        "type": "integer"
                    },
                    "cpu_count": {
                        "default": 1,
                        "description": "Number of cpus for the training job.",
                        "examples": [
                            1
                        ],
                        "title": "Cpu Count",
                        "type": "integer"
                    },
                    "memory": {
                        "default": "2Gi",
                        "description": "Memory for the training job.",
                        "examples": [
                            "2Gi"
                        ],
                        "title": "Memory",
                        "type": "string"
                    },
                    "accelerator": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CreateTrainingJobAcceleratorV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GPU specification for the training job",
                        "examples": [
                            {
                                "accelerator": "H100",
                                "count": 2
                            }
                        ]
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity guarantee for the job. 'dedicated' (the default) runs on on-demand capacity that is not preempted. 'spot' runs on interruptible capacity that may be preempted; the user is responsible for checkpointing their own progress.",
                        "examples": [
                            "spot"
                        ]
                    }
                },
                "title": "CreateTrainingJobComputeV1",
                "type": "object"
            },
            "CreateTrainingJobImageV1": {
                "description": "Configuration to create a training job image.",
                "properties": {
                    "base_image": {
                        "description": "Base image for the training job.",
                        "examples": [
                            "hello-world"
                        ],
                        "title": "Base Image",
                        "type": "string"
                    },
                    "docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Docker authentication credentials"
                    }
                },
                "required": [
                    "base_image"
                ],
                "title": "CreateTrainingJobImageV1",
                "type": "object"
            },
            "CreateTrainingJobRuntimeV1": {
                "description": "Configuration to specify the runtime environment for a training job.",
                "properties": {
                    "start_commands": {
                        "description": "Commands to execute when starting the runtime.",
                        "examples": [
                            [
                                "python main.py"
                            ]
                        ],
                        "items": {
                            "type": "string"
                        },
                        "title": "Start Commands",
                        "type": "array"
                    },
                    "environment_variables": {
                        "additionalProperties": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "$ref": "#/components/schemas/SecretReferenceV1"
                                }
                            ]
                        },
                        "description": "Environment variables to set in the runtime.",
                        "examples": [
                            {
                                "API_KEY": "your_api_key_here",
                                "PATH": "/usr/bin"
                            }
                        ],
                        "title": "Environment Variables",
                        "type": "object"
                    },
                    "artifacts": {
                        "description": "Runtime artifacts for the training job.",
                        "items": {
                            "$ref": "#/components/schemas/CreateTrainingJobS3Artifact"
                        },
                        "title": "Artifacts",
                        "type": "array"
                    },
                    "enable_cache": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Deprecated. Use cache_config instead.",
                        "examples": [
                            true
                        ],
                        "title": "Enable Cache"
                    },
                    "cache_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CreateTrainingJobCacheConfig"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Configuration for the read-write cache.",
                        "examples": [
                            {
                                "enable_legacy_hf_mount": true,
                                "enabled": true,
                                "mount_base_path": "/root/.cache",
                                "require_cache_affinity": true
                            }
                        ]
                    },
                    "checkpointing_config": {
                        "$ref": "#/components/schemas/CreateTrainingJobCheckpointingConfig",
                        "description": "Configuration for checkpointing.",
                        "examples": [
                            {
                                "checkpoint_path": "/mnt/ckpts",
                                "enabled": true,
                                "volume_size_gib": null
                            }
                        ]
                    },
                    "load_checkpoint_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoadCheckpointConfig"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Configuration for loading checkpoints"
                    }
                },
                "title": "CreateTrainingJobRuntimeV1",
                "type": "object"
            },
            "CreateTrainingJobS3Artifact": {
                "properties": {
                    "s3_bucket": {
                        "description": "S3 bucket for the uploaded runtime artifact.",
                        "examples": [
                            "my-s3-bucket"
                        ],
                        "title": "S3 Bucket",
                        "type": "string"
                    },
                    "s3_key": {
                        "description": "S3 key for the uploaded runtime artifact.",
                        "examples": [
                            "my-s3-key"
                        ],
                        "title": "S3 Key",
                        "type": "string"
                    }
                },
                "required": [
                    "s3_bucket",
                    "s3_key"
                ],
                "title": "CreateTrainingJobS3Artifact",
                "type": "object"
            },
            "CreateTrainingJobV1": {
                "description": "Configuration for a training job.",
                "properties": {
                    "image": {
                        "$ref": "#/components/schemas/CreateTrainingJobImageV1",
                        "examples": [
                            {
                                "base_image": "hello-world",
                                "docker_auth": null
                            }
                        ]
                    },
                    "compute": {
                        "$ref": "#/components/schemas/CreateTrainingJobComputeV1",
                        "examples": [
                            {
                                "accelerator": {
                                    "accelerator": "H100",
                                    "count": 2
                                },
                                "availability_model": "spot",
                                "cpu_count": 1,
                                "memory": "2Gi",
                                "node_count": 1
                            }
                        ]
                    },
                    "runtime": {
                        "$ref": "#/components/schemas/CreateTrainingJobRuntimeV1",
                        "description": "Configuration for the runtime environment of the training job.",
                        "examples": [
                            {
                                "artifacts": [],
                                "cache_config": null,
                                "checkpointing_config": {
                                    "checkpoint_path": null,
                                    "enabled": false,
                                    "volume_size_gib": null
                                },
                                "enable_cache": null,
                                "environment_variables": {
                                    "API_KEY": "your_api_key_here",
                                    "PATH": "/usr/bin"
                                },
                                "load_checkpoint_config": null,
                                "start_commands": [
                                    "python main.py"
                                ]
                            }
                        ]
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the training job.",
                        "examples": [
                            "gpt-oss-job"
                        ],
                        "title": "Name"
                    },
                    "truss_user_env": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrussUserEnv"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Truss user environment information"
                    },
                    "interactive_session": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/InteractiveSessionConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Configuration for interactive debugging sessions."
                    },
                    "weights": {
                        "description": "MDN weight sources to mount in the training container. Weights are mirrored and cached for fast startup.",
                        "examples": [
                            [
                                {
                                    "allow_patterns": null,
                                    "auth": null,
                                    "auth_secret_name": null,
                                    "ignore_patterns": null,
                                    "mount_location": "/app/models/base",
                                    "source": "hf://meta-llama/Llama-3-8B@main"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/CreateJobWeightConfigV1"
                        },
                        "title": "Weights",
                        "type": "array"
                    },
                    "enable_baseten_workdir": {
                        "default": false,
                        "description": "When enabled, uses /b10/workspace as the working directory instead of the image WORKDIR.",
                        "examples": [
                            false,
                            true
                        ],
                        "title": "Enable Baseten Workdir",
                        "type": "boolean"
                    },
                    "priority": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Queue priority. Higher values are dequeued first. Defaults to 0.",
                        "examples": [
                            0,
                            10,
                            100
                        ],
                        "title": "Priority"
                    }
                },
                "required": [
                    "image"
                ],
                "title": "CreateTrainingJobV1",
                "type": "object"
            },
            "DockerAuthType": {
                "enum": [
                    "GCP_SERVICE_ACCOUNT_JSON",
                    "AWS_IAM",
                    "AWS_OIDC",
                    "GCP_OIDC",
                    "REGISTRY_SECRET",
                    "AWS_ASSUME_ROLE"
                ],
                "title": "DockerAuthType",
                "type": "string"
            },
            "DockerAuthV1": {
                "description": "Docker authentication credentials.",
                "properties": {
                    "registry": {
                        "description": "Registry to authenticate with",
                        "title": "Registry",
                        "type": "string"
                    },
                    "auth_method": {
                        "$ref": "#/components/schemas/DockerAuthType",
                        "description": "Method to authenticate with the registry",
                        "examples": [
                            "GCP_SERVICE_ACCOUNT_JSON",
                            "AWS_IAM",
                            "AWS_OIDC",
                            "GCP_OIDC",
                            "REGISTRY_SECRET",
                            "AWS_ASSUME_ROLE"
                        ]
                    },
                    "gcp_service_account_json_docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GcpServiceAccountJsonDockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GCP service account details for the registry"
                    },
                    "aws_iam_docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AwsIamDockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS details for the registry"
                    },
                    "aws_oidc_docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AwsOidcDockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS OIDC details for the registry"
                    },
                    "gcp_oidc_docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GcpOidcDockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GCP OIDC details for the registry"
                    },
                    "registry_secret_docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RegistrySecretDockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Required when auth_method is REGISTRY_SECRET. Supports any Docker registry (Docker Hub, GHCR, NGC, etc.) via username:password credentials stored as a Baseten secret."
                    },
                    "aws_assume_role_docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AwsAssumeRoleDockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Required when auth_method is AWS_ASSUME_ROLE. Baseten assumes the given IAM role with its own AWS principal and your organization's external ID, with no OIDC provider registration in your account."
                    }
                },
                "required": [
                    "registry",
                    "auth_method"
                ],
                "title": "DockerAuthV1",
                "type": "object"
            },
            "GcpOidcDockerAuthV1": {
                "description": "GCP OIDC details for the registry.",
                "properties": {
                    "service_account": {
                        "description": "GCP service account name for OIDC authentication",
                        "title": "Service Account",
                        "type": "string"
                    },
                    "workload_identity_provider": {
                        "description": "GCP workload identity provider for OIDC authentication",
                        "title": "Workload Identity Provider",
                        "type": "string"
                    }
                },
                "required": [
                    "service_account",
                    "workload_identity_provider"
                ],
                "title": "GcpOidcDockerAuthV1",
                "type": "object"
            },
            "GcpServiceAccountJsonDockerAuthV1": {
                "description": "GCP details for the registry.",
                "properties": {
                    "service_account_json_secret_ref": {
                        "$ref": "#/components/schemas/SecretReferenceV1",
                        "description": "Name of the service account secret"
                    }
                },
                "required": [
                    "service_account_json_secret_ref"
                ],
                "title": "GcpServiceAccountJsonDockerAuthV1",
                "type": "object"
            },
            "GitInfo": {
                "properties": {
                    "latest_commit_sha": {
                        "title": "Latest Commit Sha",
                        "type": "string"
                    },
                    "latest_tag": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Latest Tag"
                    },
                    "commits_since_tag": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Commits Since Tag"
                    },
                    "has_uncommitted_changes": {
                        "title": "Has Uncommitted Changes",
                        "type": "boolean"
                    }
                },
                "required": [
                    "latest_commit_sha",
                    "latest_tag",
                    "commits_since_tag",
                    "has_uncommitted_changes"
                ],
                "title": "GitInfo",
                "type": "object"
            },
            "InteractiveSessionConfigV1": {
                "description": "Configuration for interactive debugging sessions on training jobs.",
                "properties": {
                    "trigger": {
                        "$ref": "#/components/schemas/V1InteractiveSessionTrigger",
                        "default": "on_demand",
                        "description": "When to create the interactive session. 'on_startup' creates on job start, 'on_failure' creates on job failure, 'on_demand' bypasses automatic session creation."
                    },
                    "timeout_minutes": {
                        "default": 480,
                        "description": "Number of minutes before the interactive session times out.",
                        "examples": [
                            480,
                            1440,
                            10080
                        ],
                        "title": "Timeout Minutes",
                        "type": "integer"
                    },
                    "session_provider": {
                        "$ref": "#/components/schemas/V1InteractiveSessionProvider",
                        "default": "vs_code",
                        "description": "The IDE client for the interactive session."
                    },
                    "auth_provider": {
                        "$ref": "#/components/schemas/V1InteractiveSessionAuthProvider",
                        "default": "github",
                        "description": "The authentication provider for the interactive session."
                    }
                },
                "title": "InteractiveSessionConfigV1",
                "type": "object"
            },
            "LoadCheckpointConfig": {
                "properties": {
                    "enabled": {
                        "default": false,
                        "description": "Whether checkpoint loading is enabled",
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "download_folder": {
                        "default": "/tmp/loaded_checkpoints",
                        "description": "Folder where checkpoints will be downloaded",
                        "title": "Download Folder",
                        "type": "string"
                    },
                    "checkpoints": {
                        "description": "List of checkpoint configurations",
                        "items": {
                            "discriminator": {
                                "mapping": {
                                    "baseten_latest_checkpoint": "#/components/schemas/BasetenLatestCheckpointConfig",
                                    "baseten_named_checkpoint": "#/components/schemas/BasetenNamedCheckpointConfig",
                                    "loops_checkpoint": "#/components/schemas/LoopsCheckpointConfig"
                                },
                                "propertyName": "typ"
                            },
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/BasetenLatestCheckpointConfig"
                                },
                                {
                                    "$ref": "#/components/schemas/BasetenNamedCheckpointConfig"
                                },
                                {
                                    "$ref": "#/components/schemas/LoopsCheckpointConfig"
                                }
                            ]
                        },
                        "title": "Checkpoints",
                        "type": "array"
                    }
                },
                "title": "LoadCheckpointConfig",
                "type": "object"
            },
            "LoopsCheckpointConfig": {
                "properties": {
                    "run_id": {
                        "description": "ID of the Loops run to load the checkpoint from",
                        "title": "Run Id",
                        "type": "string"
                    },
                    "checkpoint_name": {
                        "description": "Name of the checkpoint to load",
                        "title": "Checkpoint Name",
                        "type": "string"
                    },
                    "target": {
                        "default": "trainer",
                        "description": "Which checkpoint target to load: 'trainer' (full training state) or 'sampler' (inference weights)",
                        "enum": [
                            "trainer",
                            "sampler"
                        ],
                        "title": "Target",
                        "type": "string"
                    },
                    "typ": {
                        "const": "loops_checkpoint",
                        "default": "loops_checkpoint",
                        "title": "Typ",
                        "type": "string"
                    }
                },
                "required": [
                    "run_id",
                    "checkpoint_name"
                ],
                "title": "LoopsCheckpointConfig",
                "type": "object"
            },
            "RegistrySecretDockerAuthV1": {
                "description": "Authentication via a Baseten secret for any Docker registry (Docker Hub, GHCR, NGC, etc.).\nThe referenced secret must contain credentials in the format 'username:password'.\nFor Docker Hub, set registry to 'https://index.docker.io/v1/'. For GHCR, use 'ghcr.io'.",
                "properties": {
                    "secret_ref": {
                        "$ref": "#/components/schemas/SecretReferenceV1",
                        "description": "Reference to a Baseten secret containing credentials in the format 'username:password'"
                    }
                },
                "required": [
                    "secret_ref"
                ],
                "title": "RegistrySecretDockerAuthV1",
                "type": "object"
            },
            "SecretReferenceV1": {
                "properties": {
                    "name": {
                        "description": "Name of the secret to reference.",
                        "examples": [
                            "hf_token"
                        ],
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "SecretReferenceV1",
                "type": "object"
            },
            "TrainingWeightAuthV1": {
                "description": "Authentication configuration for a training weight source.",
                "properties": {
                    "auth_method": {
                        "$ref": "#/components/schemas/AuthMethod",
                        "description": "Method used to authenticate the weight source."
                    },
                    "auth_secret_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the workspace secret used for custom-secret authentication.",
                        "title": "Auth Secret Name"
                    },
                    "aws_oidc_role_arn": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS IAM role ARN used for OIDC authentication.",
                        "title": "Aws Oidc Role Arn"
                    },
                    "aws_oidc_region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS region used for OIDC authentication.",
                        "title": "Aws Oidc Region"
                    },
                    "gcp_oidc_service_account": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GCP service account used for OIDC authentication.",
                        "title": "Gcp Oidc Service Account"
                    },
                    "gcp_oidc_workload_id_provider": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GCP workload identity provider used for OIDC authentication.",
                        "title": "Gcp Oidc Workload Id Provider"
                    },
                    "aws_assume_role_arn": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS IAM role ARN that Baseten assumes to access the weight source.",
                        "title": "Aws Assume Role Arn"
                    },
                    "aws_assume_role_region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS region used for assume-role authentication.",
                        "title": "Aws Assume Role Region"
                    }
                },
                "required": [
                    "auth_method"
                ],
                "title": "TrainingWeightAuthV1",
                "type": "object"
            },
            "TrussUserEnv": {
                "description": "This data models is used to flexibly store info alongside oracle versions.\n\nThere is a corresponding data model in the truss client.\nIn contrast, here all fields are optional for backwards compatibility with old\nclients.",
                "properties": {
                    "truss_client_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Truss Client Version"
                    },
                    "python_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Python Version"
                    },
                    "pydantic_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Pydantic Version"
                    },
                    "mypy_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Mypy Version"
                    },
                    "is_library_deployment": {
                        "default": false,
                        "title": "Is Library Deployment",
                        "type": "boolean"
                    },
                    "is_frontend_deployment": {
                        "default": false,
                        "title": "Is Frontend Deployment",
                        "type": "boolean"
                    },
                    "git_info": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GitInfo"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null
                    }
                },
                "title": "TrussUserEnv",
                "type": "object"
            },
            "V1InteractiveSessionAuthProvider": {
                "enum": [
                    "github",
                    "microsoft"
                ],
                "title": "V1InteractiveSessionAuthProvider",
                "type": "string"
            },
            "V1InteractiveSessionProvider": {
                "enum": [
                    "vs_code",
                    "cursor",
                    "ssh"
                ],
                "title": "V1InteractiveSessionProvider",
                "type": "string"
            },
            "V1InteractiveSessionTrigger": {
                "enum": [
                    "on_startup",
                    "on_failure",
                    "on_demand"
                ],
                "title": "V1InteractiveSessionTrigger",
                "type": "string"
            },
            "CreateTrainingJobRequestV1": {
                "description": "A request to create a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/CreateTrainingJobV1",
                        "description": "The training job to create."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "CreateTrainingJobRequestV1",
                "type": "object"
            },
            "CreateTrainingJobResponseV1": {
                "description": "A response to creating a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The created training job."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "CreateTrainingJobResponseV1",
                "type": "object"
            },
            "TrainingJobTombstoneV1": {
                "description": "A training job tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training job",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the training job was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    },
                    "training_project_id": {
                        "description": "Unique identifier of the training project",
                        "title": "Training Project Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "deleted",
                    "training_project_id"
                ],
                "title": "TrainingJobTombstoneV1",
                "type": "object"
            },
            "GetTrainingJobResponseV1": {
                "description": "A response to fetch a training job.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The training project."
                    },
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The fetched training job."
                    }
                },
                "required": [
                    "training_project",
                    "training_job"
                ],
                "title": "GetTrainingJobResponseV1",
                "type": "object"
            },
            "UpdateTrainingJobRequestV1": {
                "description": "A request to update mutable fields on a training job.\n\nEvery field is optional so a caller can patch one without the other, but at least\none must be provided: an empty body has nothing to apply.",
                "minProperties": 1,
                "properties": {
                    "priority": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New queue priority for a PENDING training job. Higher values are dequeued first. Only jobs in the PENDING state can have their priority changed.",
                        "examples": [
                            0,
                            10,
                            100
                        ],
                        "title": "Priority"
                    },
                    "availability_model": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/V1AvailabilityModel"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New capacity guarantee for a PENDING training job. 'dedicated' runs on on-demand capacity that is not preempted. 'spot' runs on interruptible capacity that may be preempted; the user is responsible for checkpointing their own progress. Only jobs in the PENDING state can have their availability model changed.",
                        "examples": [
                            "spot"
                        ]
                    }
                },
                "title": "UpdateTrainingJobRequestV1",
                "type": "object"
            },
            "UpdateTrainingJobResponseV1": {
                "description": "A response to updating a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The updated training job."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "UpdateTrainingJobResponseV1",
                "type": "object"
            },
            "DownloadTrainingJobResponseV1": {
                "description": "A response with presigned URLs for a training job's artifacts.",
                "properties": {
                    "artifact_presigned_urls": {
                        "description": "Presigned URLs for the job's uploaded artifacts.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Artifact Presigned Urls",
                        "type": "array"
                    }
                },
                "required": [
                    "artifact_presigned_urls"
                ],
                "title": "DownloadTrainingJobResponseV1",
                "type": "object"
            },
            "RecreateTrainingJobResponseV1": {
                "description": "A response that sends the new training job",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The created training job."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "RecreateTrainingJobResponseV1",
                "type": "object"
            },
            "GetTrainingJobLogsRequestV1": {
                "description": "A request to fetch training logs.",
                "properties": {
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort order for logs"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 500,
                        "description": "Limit of logs to fetch in a single request",
                        "title": "Limit"
                    },
                    "min_level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level."
                    }
                },
                "title": "GetTrainingJobLogsRequestV1",
                "type": "object"
            },
            "StorageMetricsV1": {
                "description": "A metric for a training job.",
                "properties": {
                    "usage_bytes": {
                        "description": "The number of bytes used on the storage entity.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Usage Bytes",
                        "type": "array"
                    },
                    "utilization": {
                        "description": "The utilization of the storage entity as a decimal percentage.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Utilization",
                        "type": "array"
                    }
                },
                "required": [
                    "usage_bytes",
                    "utilization"
                ],
                "title": "StorageMetricsV1",
                "type": "object"
            },
            "TrainingJobMetricV1": {
                "description": "A metric for a training job.",
                "properties": {
                    "value": {
                        "description": "The value of the metric.",
                        "title": "Value",
                        "type": "number"
                    },
                    "timestamp": {
                        "description": "The timestamp of the metric in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Timestamp",
                        "type": "string"
                    }
                },
                "required": [
                    "value",
                    "timestamp"
                ],
                "title": "TrainingJobMetricV1",
                "type": "object"
            },
            "TrainingJobMetricsV1": {
                "properties": {
                    "gpu_memory_usage_bytes": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Memory Usage Bytes",
                        "type": "array"
                    },
                    "ephemeral_storage": {
                        "$ref": "#/components/schemas/StorageMetricsV1",
                        "description": "The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise."
                    }
                },
                "required": [
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "cpu_usage",
                    "cpu_memory_usage_bytes",
                    "ephemeral_storage"
                ],
                "title": "TrainingJobMetricsV1",
                "type": "object"
            },
            "TrainingJobNodeMetricsV1": {
                "description": "A set of metrics for a training job node.",
                "properties": {
                    "node_id": {
                        "description": "The name of the node.",
                        "title": "Node Id",
                        "type": "string"
                    },
                    "metrics": {
                        "$ref": "#/components/schemas/TrainingJobMetricsV1",
                        "description": "The metrics for the node."
                    }
                },
                "required": [
                    "node_id",
                    "metrics"
                ],
                "title": "TrainingJobNodeMetricsV1",
                "type": "object"
            },
            "GetTrainingJobMetricsResponseV1": {
                "description": "A response to fetch training job metrics. The outer list for each metric represents that metric across time.",
                "properties": {
                    "gpu_memory_usage_bytes": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Memory Usage Bytes",
                        "type": "array"
                    },
                    "ephemeral_storage": {
                        "$ref": "#/components/schemas/StorageMetricsV1",
                        "description": "The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise."
                    },
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The training job."
                    },
                    "cache": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/StorageMetricsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The storage usage for the read-write cache."
                    },
                    "per_node_metrics": {
                        "description": "The metrics for each node in the training job.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobNodeMetricsV1"
                        },
                        "title": "Per Node Metrics",
                        "type": "array"
                    }
                },
                "required": [
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "cpu_usage",
                    "cpu_memory_usage_bytes",
                    "ephemeral_storage",
                    "training_job",
                    "cache",
                    "per_node_metrics"
                ],
                "title": "GetTrainingJobMetricsResponseV1",
                "type": "object"
            },
            "GetTrainingJobMetricsRequestV1": {
                "description": "A request to fetch metrics. Allows the user to request metrics over a period of time.",
                "properties": {
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to end fetching metrics",
                        "title": "End Epoch Millis"
                    },
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to start fetching metrics.",
                        "title": "Start Epoch Millis"
                    },
                    "step_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Resolution of the returned series, in seconds. When omitted, a step is derived from the time range so large windows return fewer points.",
                        "title": "Step Seconds"
                    }
                },
                "title": "GetTrainingJobMetricsRequestV1",
                "type": "object"
            },
            "StopTrainingJobRequestV1": {
                "description": "A request to stop a training job.",
                "properties": {},
                "title": "StopTrainingJobRequestV1",
                "type": "object"
            },
            "StopTrainingJobResponseV1": {
                "description": "A response to stopping a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The stopped training job."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "StopTrainingJobResponseV1",
                "type": "object"
            },
            "TrainingJobCheckpointV1": {
                "description": "A checkpoint for a training job.",
                "properties": {
                    "checkpoint_id": {
                        "description": "The ID of the checkpoint.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "The timestamp of the checkpoint in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "checkpoint_type": {
                        "description": "The type of checkpoint.",
                        "title": "Checkpoint Type",
                        "type": "string"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The base model of the checkpoint.",
                        "title": "Base Model"
                    },
                    "lora_adapter_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The adapter config of the checkpoint.",
                        "title": "Lora Adapter Config"
                    },
                    "size_bytes": {
                        "description": "The size of the checkpoint in bytes.",
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "sync_status": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sync state of the checkpoint: SYNCING or COMPLETE.",
                        "title": "Sync Status"
                    },
                    "training_job_id": {
                        "description": "The ID of the training job.",
                        "title": "Training Job Id",
                        "type": "string"
                    }
                },
                "required": [
                    "checkpoint_id",
                    "created_at",
                    "checkpoint_type",
                    "base_model",
                    "lora_adapter_config",
                    "size_bytes",
                    "training_job_id"
                ],
                "title": "TrainingJobCheckpointV1",
                "type": "object"
            },
            "GetTrainingJobCheckpointsResponseV1": {
                "description": "A response to fetch checkpoints for a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The training job."
                    },
                    "checkpoints": {
                        "description": "The checkpoints for the training job.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobCheckpointV1"
                        },
                        "title": "Checkpoints",
                        "type": "array"
                    }
                },
                "required": [
                    "training_job",
                    "checkpoints"
                ],
                "title": "GetTrainingJobCheckpointsResponseV1",
                "type": "object"
            },
            "CheckpointFile": {
                "properties": {
                    "url": {
                        "title": "Url",
                        "type": "string"
                    },
                    "relative_file_name": {
                        "title": "Relative File Name",
                        "type": "string"
                    },
                    "node_rank": {
                        "title": "Node Rank",
                        "type": "integer"
                    },
                    "size_bytes": {
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "last_modified": {
                        "title": "Last Modified",
                        "type": "string"
                    }
                },
                "required": [
                    "url",
                    "relative_file_name",
                    "node_rank",
                    "size_bytes",
                    "last_modified"
                ],
                "title": "CheckpointFile",
                "type": "object"
            },
            "GetTrainingJobCheckpointFilesResponseV1": {
                "description": "A response to fetch presigned URLs for checkpoint files of a training job.",
                "properties": {
                    "presigned_urls": {
                        "description": "List of presigned URLs for checkpoint files.",
                        "items": {
                            "$ref": "#/components/schemas/CheckpointFile"
                        },
                        "title": "Presigned Urls",
                        "type": "array"
                    },
                    "next_page_token": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Token to use for fetching the next page of results. None when there are no more results.",
                        "title": "Next Page Token"
                    },
                    "total_count": {
                        "description": "Total number of checkpoint files available.",
                        "title": "Total Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "presigned_urls",
                    "total_count"
                ],
                "title": "GetTrainingJobCheckpointFilesResponseV1",
                "type": "object"
            },
            "GetTrainingJobCheckpointFilesRequestV1": {
                "description": "Pagination params for ``GET /v1/training_projects/.../checkpoint_files``.",
                "properties": {
                    "page_size": {
                        "default": 1000,
                        "description": "Max files per page (default 1000).",
                        "minimum": 1,
                        "title": "Page Size",
                        "type": "integer"
                    },
                    "page_token": {
                        "default": 0,
                        "description": "Offset into the file list (default 0).",
                        "minimum": 0,
                        "title": "Page Token",
                        "type": "integer"
                    }
                },
                "title": "GetTrainingJobCheckpointFilesRequestV1",
                "type": "object"
            },
            "AuthCodeV1": {
                "description": "Authentication code for a training job interactive session node.",
                "properties": {
                    "session_id": {
                        "description": "Unique identifier of the interactive session.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "replica_id": {
                        "description": "Replica identifier in gXXrY format (e.g., 'g00r0' for group 0, replica 0).",
                        "title": "Replica Id",
                        "type": "string"
                    },
                    "auth_code": {
                        "description": "The device authentication code (e.g., '4F64-C0D9').",
                        "title": "Auth Code",
                        "type": "string"
                    },
                    "auth_url": {
                        "description": "URL where the user should enter the auth code (e.g., 'https://github.com/login/device').",
                        "title": "Auth Url",
                        "type": "string"
                    },
                    "generated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the auth code was generated, in ISO 8601 format.",
                        "title": "Generated At"
                    },
                    "tunnel_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The name of the tunnel node.",
                        "title": "Tunnel Name"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the session expires, in ISO 8601 format.",
                        "title": "Expires At"
                    },
                    "working_directory": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The working directory of the session.",
                        "title": "Working Directory"
                    }
                },
                "required": [
                    "session_id",
                    "replica_id",
                    "auth_code",
                    "auth_url"
                ],
                "title": "AuthCodeV1",
                "type": "object"
            },
            "GetAuthCodesResponseV1": {
                "description": "Response containing auth codes for all nodes of a training job's interactive sessions.",
                "properties": {
                    "auth_codes": {
                        "description": "List of auth codes for each node that has an active interactive session.",
                        "items": {
                            "$ref": "#/components/schemas/AuthCodeV1"
                        },
                        "title": "Auth Codes",
                        "type": "array"
                    }
                },
                "required": [
                    "auth_codes"
                ],
                "title": "GetAuthCodesResponseV1",
                "type": "object"
            },
            "PatchInteractiveSessionRequestV1": {
                "description": "Request to patch an interactive session.\n\nOnly fields that are provided (non-None) will be applied.",
                "properties": {
                    "timeout_minutes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "For on_startup sessions, minutes to add to the expiration. For on_demand/on_failure sessions, minutes to add to the timeout. Use -1 for infinite timeout (bumps by 10 years).",
                        "title": "Timeout Minutes"
                    },
                    "trigger": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/V1InteractiveSessionTrigger"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Update when the interactive session is created. Cannot be changed if the session trigger is 'on_startup'."
                    }
                },
                "title": "PatchInteractiveSessionRequestV1",
                "type": "object"
            },
            "InteractiveSessionV1": {
                "description": "Representation of a training job interactive session.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the interactive session.",
                        "title": "Id",
                        "type": "string"
                    },
                    "trigger": {
                        "description": "When the interactive session is created.",
                        "title": "Trigger",
                        "type": "string"
                    },
                    "timeout_minutes": {
                        "description": "Minutes before the session times out.",
                        "title": "Timeout Minutes",
                        "type": "integer"
                    },
                    "session_provider": {
                        "description": "The IDE client for the session.",
                        "title": "Session Provider",
                        "type": "string"
                    },
                    "auth_provider": {
                        "description": "The authentication provider for the session.",
                        "title": "Auth Provider",
                        "type": "string"
                    },
                    "pod_name": {
                        "description": "Pod name / node rank for the session.",
                        "title": "Pod Name",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the session expires, in ISO 8601 format.",
                        "title": "Expires At"
                    },
                    "tunnel_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The tunnel name for the session.",
                        "title": "Tunnel Name"
                    },
                    "auth_code": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The device authentication code.",
                        "title": "Auth Code"
                    },
                    "auth_url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "URL where the user should enter the auth code.",
                        "title": "Auth Url"
                    },
                    "auth_code_generated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the auth code was generated.",
                        "title": "Auth Code Generated At"
                    },
                    "authenticated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the session was authenticated.",
                        "title": "Authenticated At"
                    },
                    "working_directory": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The working directory of the session.",
                        "title": "Working Directory"
                    }
                },
                "required": [
                    "id",
                    "trigger",
                    "timeout_minutes",
                    "session_provider",
                    "auth_provider",
                    "pod_name"
                ],
                "title": "InteractiveSessionV1",
                "type": "object"
            },
            "PatchInteractiveSessionResponseV1": {
                "description": "Response after patching an interactive session.",
                "properties": {
                    "interactive_session": {
                        "$ref": "#/components/schemas/InteractiveSessionV1",
                        "description": "The updated interactive session."
                    },
                    "message": {
                        "description": "Human-readable summary of what was updated.",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "interactive_session",
                    "message"
                ],
                "title": "PatchInteractiveSessionResponseV1",
                "type": "object"
            },
            "FileSummary": {
                "description": "Information about a file in the cache.",
                "properties": {
                    "path": {
                        "description": "Relative path of the file in the cache",
                        "title": "Path",
                        "type": "string"
                    },
                    "size_bytes": {
                        "description": "Size of the file in bytes",
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "modified": {
                        "description": "Last modification time of the file",
                        "title": "Modified",
                        "type": "string"
                    },
                    "file_type": {
                        "description": "Type of the file",
                        "title": "File Type",
                        "type": "string"
                    },
                    "permissions": {
                        "description": "Permissions of the file",
                        "title": "Permissions",
                        "type": "string"
                    }
                },
                "required": [
                    "path",
                    "size_bytes",
                    "modified",
                    "file_type",
                    "permissions"
                ],
                "title": "FileSummary",
                "type": "object"
            },
            "GetCacheSummaryResponseV1": {
                "description": "Response for getting cache summary.",
                "properties": {
                    "timestamp": {
                        "description": "Timestamp when the cache summary was captured",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "project_id": {
                        "description": "Project ID associated with the cache",
                        "title": "Project Id",
                        "type": "string"
                    },
                    "file_summaries": {
                        "description": "List of files in the cache",
                        "items": {
                            "$ref": "#/components/schemas/FileSummary"
                        },
                        "title": "File Summaries",
                        "type": "array"
                    }
                },
                "required": [
                    "timestamp",
                    "project_id",
                    "file_summaries"
                ],
                "title": "GetCacheSummaryResponseV1",
                "type": "object"
            },
            "TrainingProjectTombstoneV1": {
                "description": "A training project tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training project",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the training project was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "TrainingProjectTombstoneV1",
                "type": "object"
            },
            "GetTrainingProjectResponseV1": {
                "description": "A response to getting a training project.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The training project."
                    }
                },
                "required": [
                    "training_project"
                ],
                "title": "GetTrainingProjectResponseV1",
                "type": "object"
            },
            "OrderByV1": {
                "description": "A request to order training jobs.",
                "properties": {
                    "field": {
                        "description": "The field to order by.",
                        "examples": [
                            "created_at"
                        ],
                        "title": "Field",
                        "type": "string"
                    },
                    "order": {
                        "description": "The direction to order by.",
                        "examples": [
                            "asc",
                            "desc"
                        ],
                        "title": "Order",
                        "type": "string"
                    }
                },
                "required": [
                    "field",
                    "order"
                ],
                "title": "OrderByV1",
                "type": "object"
            },
            "SearchTrainingJobsRequestV1": {
                "description": "A request to search training jobs.",
                "properties": {
                    "project_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter the training jobs by project ID.",
                        "examples": [
                            "n4q95w5"
                        ],
                        "title": "Project Id"
                    },
                    "job_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter the training jobs by job ID.",
                        "examples": [
                            "p7qr9qv"
                        ],
                        "title": "Job Id"
                    },
                    "statuses": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter the training jobs by status.",
                        "examples": [
                            [
                                "TRAINING_JOB_RUNNING",
                                "TRAINING_JOB_COMPLETED"
                            ]
                        ],
                        "title": "Statuses"
                    },
                    "order_by": {
                        "default": [
                            {
                                "field": "created_at",
                                "order": "desc"
                            }
                        ],
                        "description": "Order the training jobs by a field. Currently supports created_at",
                        "items": {
                            "$ref": "#/components/schemas/OrderByV1"
                        },
                        "title": "Order By",
                        "type": "array"
                    }
                },
                "title": "SearchTrainingJobsRequestV1",
                "type": "object"
            },
            "SearchTrainingJobsResponseV1": {
                "description": "A response to search training jobs.",
                "properties": {
                    "training_jobs": {
                        "description": "List of training jobs.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobV1"
                        },
                        "title": "Training Jobs",
                        "type": "array"
                    }
                },
                "required": [
                    "training_jobs"
                ],
                "title": "SearchTrainingJobsResponseV1",
                "type": "object"
            },
            "EnablementDetailsV1": {
                "description": "Why a supported model is not enabled for this workspace.",
                "properties": {
                    "reason": {
                        "description": "Machine-readable reason the model is not enabled. Currently one of 'needs_approval', 'sequence_length_unsupported' or 'loops_not_enabled'. Deliberately not a closed enum: values are added as the check learns to distinguish cases that call for a different action, so treat an unrecognized value as 'not enabled, reason unknown' rather than an error.",
                        "examples": [
                            "needs_approval"
                        ],
                        "title": "Reason",
                        "type": "string"
                    },
                    "reason_detail": {
                        "description": "Human-readable explanation of the reason.",
                        "title": "Reason Detail",
                        "type": "string"
                    },
                    "remediation": {
                        "description": "Human-readable next step to enable the model.",
                        "title": "Remediation",
                        "type": "string"
                    }
                },
                "required": [
                    "reason",
                    "reason_detail",
                    "remediation"
                ],
                "title": "EnablementDetailsV1",
                "type": "object"
            },
            "SupportedModelV1": {
                "description": "A model supported by the Loops server.",
                "properties": {
                    "model_name": {
                        "description": "The name of the supported model.",
                        "title": "Model Name",
                        "type": "string"
                    },
                    "max_seq_len": {
                        "description": "The longest sequence length Baseten supports for this model. Independent of the caller: see 'max_enabled_seq_len' for what this workspace can actually train at. Named to match the 'max_seq_len' query parameter and the field of the same name on run creation, so one name follows the value through the API.",
                        "title": "Max Seq Len",
                        "type": "integer"
                    },
                    "max_enabled_seq_len": {
                        "default": 0,
                        "description": "The longest sequence length this workspace can train at. Lower than 'max_seq_len' when the longer configurations need hardware the workspace is not approved for \u2014 a model's longer sequence lengths often need a bigger SKU of the same GPU. Zero when the workspace cannot run the model at all, so a client can compare against a required length without a null case.",
                        "title": "Max Enabled Seq Len",
                        "type": "integer"
                    },
                    "max_context_length": {
                        "deprecated": true,
                        "description": "Deprecated. Use 'max_seq_len', which carries the same value. Kept so existing clients keep working.",
                        "title": "Max Context Length",
                        "type": "integer"
                    },
                    "supports_vision_language": {
                        "description": "Whether the model accepts image inputs alongside text.",
                        "title": "Supports Vision Language",
                        "type": "boolean"
                    },
                    "enabled": {
                        "default": true,
                        "description": "Whether this workspace can start a run with this model now. False means Baseten supports it but the workspace cannot use it yet; 'not_enabled' says why. Capacity is resolved when the run is created, so true is not a guarantee that GPUs are free.",
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "enablement_details": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/EnablementDetailsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Why the model is not enabled, and what would change it. Present only when 'enabled' is false \u2014 an enabled model has nothing to explain. Read 'enabled' for the state; this is the detail behind it."
                    }
                },
                "required": [
                    "model_name",
                    "max_seq_len",
                    "max_context_length",
                    "supports_vision_language"
                ],
                "title": "SupportedModelV1",
                "type": "object"
            },
            "GetLoopsCapabilitiesResponseV1": {
                "description": "Response for ``GET /v1/loops/capabilities``.\n\nA model Baseten does not support has no entry at all, so an empty list for\na single-model request means exactly that.",
                "properties": {
                    "supported_models": {
                        "description": "Models Baseten supports for this use case, each carrying an 'enabled' flag saying whether this workspace can run it now, and 'enablement_details' when it cannot. Filter on 'enabled' to get the models you can use.",
                        "items": {
                            "$ref": "#/components/schemas/SupportedModelV1"
                        },
                        "title": "Supported Models",
                        "type": "array"
                    }
                },
                "required": [
                    "supported_models"
                ],
                "title": "GetLoopsCapabilitiesResponseV1",
                "type": "object"
            },
            "LoopsUseCaseV1": {
                "description": "What the caller intends to run.\n\nReinforcement learning runs a trainer and a sampler; supervised\nfine-tuning runs a trainer alone. A model can therefore be enabled for one\nand not the other, and the same model can support a longer sequence length\nfor SFT than for RL.",
                "enum": [
                    "rl",
                    "sft"
                ],
                "title": "LoopsUseCaseV1",
                "type": "string"
            },
            "GetLoopsCapabilitiesQueryParamsV1": {
                "description": "Query-string filters for ``GET /v1/loops/capabilities``.",
                "properties": {
                    "model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Restrict the response to one model, identified by its HuggingFace repo id. A supported model comes back with its 'enabled' flag and, when false, its 'enablement_details'. An empty list means Baseten does not support that model. Omit to list every supported model.",
                        "examples": [
                            "Qwen/Qwen3-8B"
                        ],
                        "title": "Model"
                    },
                    "use_case": {
                        "$ref": "#/components/schemas/LoopsUseCaseV1",
                        "default": "rl",
                        "description": "What the caller intends to run. Defaults to 'rl', the stricter of the two: an RL run needs both a trainer and a sampler, so anything enabled for 'rl' is also enabled for 'sft'.",
                        "examples": [
                            "rl"
                        ]
                    },
                    "max_seq_len": {
                        "anyOf": [
                            {
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The sequence length the caller intends to train at \u2014 the same value they would pass as 'max_seq_len' when creating the run. Models that cannot serve it are reported as not enabled rather than returned with a ceiling the caller cannot use. Omit for the model's highest enabled sequence length.",
                        "examples": [
                            32768
                        ],
                        "title": "Max Seq Len"
                    }
                },
                "title": "GetLoopsCapabilitiesQueryParamsV1",
                "type": "object"
            },
            "LoopsSessionV1": {
                "properties": {
                    "id": {
                        "title": "Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id"
                ],
                "title": "LoopsSessionV1",
                "type": "object"
            },
            "CreateLoopsSessionResponseV1": {
                "properties": {
                    "session": {
                        "$ref": "#/components/schemas/LoopsSessionV1"
                    }
                },
                "required": [
                    "session"
                ],
                "title": "CreateLoopsSessionResponseV1",
                "type": "object"
            },
            "GetLoopsSessionResponseV1": {
                "description": "Response for ``GET /v1/loops/sessions/<session_id>``.",
                "properties": {
                    "session": {
                        "$ref": "#/components/schemas/LoopsSessionV1",
                        "description": "The Loops session."
                    }
                },
                "required": [
                    "session"
                ],
                "title": "GetLoopsSessionResponseV1",
                "type": "object"
            },
            "LoopsRunStatusNameV1": {
                "description": "A Loops run's lifecycle state: ACTIVE or INACTIVE.",
                "enum": [
                    "ACTIVE",
                    "INACTIVE"
                ],
                "title": "LoopsRunStatusNameV1",
                "type": "string"
            },
            "LoopsRunStatusV1": {
                "description": "The current status of a Loops run.",
                "properties": {
                    "name": {
                        "$ref": "#/components/schemas/LoopsRunStatusNameV1",
                        "description": "ACTIVE while the run is live; INACTIVE once replaced by a newer run or shut down."
                    }
                },
                "required": [
                    "name"
                ],
                "title": "LoopsRunStatusV1",
                "type": "object"
            },
            "LoopsRunV1": {
                "properties": {
                    "id": {
                        "description": "The run ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "session_id": {
                        "description": "The session ID this run belongs to.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The ID of the Loops deployment the run executes on, if it has one.",
                        "title": "Deployment Id"
                    },
                    "name": {
                        "description": "The run's display name.",
                        "title": "Name",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The HuggingFace base model the run is fine-tuning.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "base_url": {
                        "description": "The run's base URL.",
                        "title": "Base Url",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the run was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/LoopsRunStatusV1",
                        "description": "The run's current status."
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owns the run."
                    },
                    "sampler": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoopsSamplerV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The sampler bound to this run, or null for a trainer-only run that has not yet created a sampler."
                    }
                },
                "required": [
                    "id",
                    "session_id",
                    "name",
                    "base_model",
                    "base_url",
                    "created_at",
                    "status",
                    "user"
                ],
                "title": "LoopsRunV1",
                "type": "object"
            },
            "LoopsSamplerStatusV1": {
                "description": "The current status of a Loops sampler.",
                "properties": {
                    "name": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "The current status of the Loops sampler."
                    }
                },
                "required": [
                    "name"
                ],
                "title": "LoopsSamplerStatusV1",
                "type": "object"
            },
            "LoopsSamplerV1": {
                "properties": {
                    "id": {
                        "title": "Id",
                        "type": "string"
                    },
                    "base_url": {
                        "title": "Base Url",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The HuggingFace base model the sampler is serving.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the sampler was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "model_id": {
                        "description": "Hashid of the underlying Baseten model.",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "description": "Hashid of the specific model deployment (version).",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/LoopsSamplerStatusV1",
                        "description": "The sampler's current status."
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owns the sampler."
                    },
                    "instance_type": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/InstanceTypeV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Instance type serving the sampler."
                    },
                    "node_count": {
                        "default": 1,
                        "description": "Number of nodes serving the sampler.",
                        "title": "Node Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "id",
                    "base_url",
                    "base_model",
                    "created_at",
                    "model_id",
                    "deployment_id",
                    "status",
                    "user"
                ],
                "title": "LoopsSamplerV1",
                "type": "object"
            },
            "ListLoopsRunsResponseV1": {
                "description": "Runs matching the query filters.",
                "properties": {
                    "runs": {
                        "description": "List of runs.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsRunV1"
                        },
                        "title": "Runs",
                        "type": "array"
                    }
                },
                "required": [
                    "runs"
                ],
                "title": "ListLoopsRunsResponseV1",
                "type": "object"
            },
            "ListLoopsRunsQueryParamsV1": {
                "description": "Query-string filters for ``GET /v1/loops/runs``.\n\nAll filters are optional and can be combined; omit them to list the caller's\nown runs. Pass ``scope=org`` to list every run in the caller's organization\ninstead.",
                "properties": {
                    "run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by run ID.",
                        "examples": [
                            "k4q95w5"
                        ],
                        "title": "Run Id"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter runs by base model name.",
                        "examples": [
                            "Qwen/Qwen3-8B"
                        ],
                        "title": "Base Model"
                    },
                    "scope": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Defaults to the caller's own runs; pass 'org' to list every run in the caller's organization.",
                        "examples": [
                            "org"
                        ],
                        "title": "Scope"
                    }
                },
                "title": "ListLoopsRunsQueryParamsV1",
                "type": "object"
            },
            "CreateLoopsRunRequestV1": {
                "description": "Request to create a Loops run together with its paired sampler.",
                "properties": {
                    "session_id": {
                        "description": "ID of the Loops session this run belongs to.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "Base model ID (e.g. 'Qwen/Qwen3-8B').",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name for the run. Defaults to the base model name when omitted.",
                        "title": "Name"
                    },
                    "max_seq_len": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum prompt length (in tokens) the run must handle. Set this to the longest training example you plan to send. Defaults to the maximum supported by the model configuration.",
                        "title": "Max Seq Len"
                    },
                    "lora_rank": {
                        "default": 64,
                        "description": "LoRA rank.",
                        "minimum": 1,
                        "title": "Lora Rank",
                        "type": "integer"
                    },
                    "seed": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Random seed for reproducibility.",
                        "title": "Seed"
                    },
                    "scale_down_delay_seconds": {
                        "default": 900,
                        "description": "Seconds of inactivity before the run scales to zero. Must be between 1 and 3600 (1 hour). Defaults to 900 (15 minutes).",
                        "exclusiveMinimum": 0,
                        "maximum": 3600,
                        "title": "Scale Down Delay Seconds",
                        "type": "integer"
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity the trainer runs on. 'dedicated' is not preempted. 'spot' runs below inference and reaches idle reserved capacity, but the run is stopped if its GPUs are reclaimed and cannot be resumed.",
                        "examples": [
                            "spot"
                        ]
                    },
                    "replicas": {
                        "default": 1,
                        "description": "Number of data-parallel trainer replicas. Each replica is one full copy of the model's preset node group, so the trainer deployment runs (preset node_count * replicas) nodes (e.g. replicas=4 on a 4-node preset \u2192 16 nodes, 4 DP workers). Must be a positive integer. Defaults to 1.",
                        "minimum": 1,
                        "title": "Replicas",
                        "type": "integer"
                    },
                    "path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional bt:// URI of an existing checkpoint to load weights from on startup. Form: bt://loops:<run_id>/weights/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/weights/step-100"
                        ],
                        "title": "Path"
                    },
                    "reuse_from_run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional ID of a prior Loops run whose trainer and/or sampler should be reused for this run instead of provisioning fresh. The prior run must use the same base model and belong to the same team.",
                        "title": "Reuse From Run Id"
                    },
                    "reuse_from_session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional ID of a prior Loops session whose trainer and/or sampler should be reused for this run. Deprecated in favor of reuse_from_run_id.",
                        "title": "Reuse From Session Id"
                    },
                    "sampler_num_replicas": {
                        "anyOf": [
                            {
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Number of replicas the run's sampler runs, applied as both its minimum and maximum. Must be at least 1. If omitted, a new sampler uses the platform defaults and a sampler reused from an earlier run keeps its settings. A run that already has a sampler keeps it unchanged. When the run ends, its sampler is scaled down.",
                        "title": "Sampler Num Replicas"
                    }
                },
                "required": [
                    "session_id",
                    "base_model"
                ],
                "title": "CreateLoopsRunRequestV1",
                "type": "object"
            },
            "CreateLoopsRunResponseV1": {
                "properties": {
                    "run": {
                        "$ref": "#/components/schemas/LoopsRunV1"
                    }
                },
                "required": [
                    "run"
                ],
                "title": "CreateLoopsRunResponseV1",
                "type": "object"
            },
            "DeactivateLoopsRunResponseV1": {
                "description": "Response for ``POST /v1/loops/runs/<run_id>/deactivate``.",
                "properties": {
                    "id": {
                        "description": "The deactivated Loops run ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The base model whose Loops run was deactivated.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owns the Loops run."
                    }
                },
                "required": [
                    "id",
                    "base_model",
                    "user"
                ],
                "title": "DeactivateLoopsRunResponseV1",
                "type": "object"
            },
            "GetLoopsRunResponseV1": {
                "description": "Response for ``GET /v1/loops/runs/<run_id>``.",
                "properties": {
                    "run": {
                        "$ref": "#/components/schemas/LoopsRunV1",
                        "description": "The Loops run with its associated sampler."
                    }
                },
                "required": [
                    "run"
                ],
                "title": "GetLoopsRunResponseV1",
                "type": "object"
            },
            "CreateLoopsTrainerRequestV1": {
                "properties": {
                    "session_id": {
                        "description": "ID of the Loops session this run belongs to.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "Base model ID (e.g. 'Qwen/Qwen3-8B').",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name for the run. Defaults to the base model name when omitted.",
                        "title": "Name"
                    },
                    "max_seq_len": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum prompt length (in tokens) the run must handle. Set this to the longest training example you plan to send. Defaults to the maximum supported by the model configuration.",
                        "title": "Max Seq Len"
                    },
                    "lora_rank": {
                        "default": 64,
                        "description": "LoRA rank.",
                        "minimum": 1,
                        "title": "Lora Rank",
                        "type": "integer"
                    },
                    "seed": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Random seed for reproducibility.",
                        "title": "Seed"
                    },
                    "scale_down_delay_seconds": {
                        "default": 900,
                        "description": "Seconds of inactivity before the run scales to zero. Must be between 1 and 3600 (1 hour). Defaults to 900 (15 minutes).",
                        "exclusiveMinimum": 0,
                        "maximum": 3600,
                        "title": "Scale Down Delay Seconds",
                        "type": "integer"
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity the trainer runs on. 'dedicated' is not preempted. 'spot' runs below inference and reaches idle reserved capacity, but the run is stopped if its GPUs are reclaimed and cannot be resumed.",
                        "examples": [
                            "spot"
                        ]
                    },
                    "replicas": {
                        "default": 1,
                        "description": "Number of data-parallel trainer replicas. Each replica is one full copy of the model's preset node group, so the trainer deployment runs (preset node_count * replicas) nodes (e.g. replicas=4 on a 4-node preset \u2192 16 nodes, 4 DP workers). Must be a positive integer. Defaults to 1.",
                        "minimum": 1,
                        "title": "Replicas",
                        "type": "integer"
                    },
                    "path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional bt:// URI of an existing checkpoint to load weights from on startup. Form: bt://loops:<run_id>/weights/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/weights/step-100"
                        ],
                        "title": "Path"
                    },
                    "reuse_from_run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional ID of a prior Loops run whose trainer and/or sampler should be reused for this run instead of provisioning fresh. The prior run must use the same base model and belong to the same team.",
                        "title": "Reuse From Run Id"
                    },
                    "reuse_from_session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional ID of a prior Loops session whose trainer and/or sampler should be reused for this run. Deprecated in favor of reuse_from_run_id.",
                        "title": "Reuse From Session Id"
                    }
                },
                "required": [
                    "session_id",
                    "base_model"
                ],
                "title": "CreateLoopsTrainerRequestV1",
                "type": "object"
            },
            "ListLoopsSamplersResponseV1": {
                "description": "Response for ``GET /v1/loops/samplers``.\n\nReturns the caller's samplers, including those paired to runs and\nstandalone samplers. Ordered newest-first.",
                "properties": {
                    "samplers": {
                        "description": "List of samplers.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsSamplerV1"
                        },
                        "title": "Samplers",
                        "type": "array"
                    }
                },
                "required": [
                    "samplers"
                ],
                "title": "ListLoopsSamplersResponseV1",
                "type": "object"
            },
            "ListLoopsSamplersRequestV1": {
                "description": "Query-string filters for the Loops sampler listing routes.",
                "properties": {
                    "scope": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Defaults to the caller's own samplers; pass 'org' to include samplers owned by other users in the caller's organization.",
                        "examples": [
                            "org"
                        ],
                        "title": "Scope"
                    }
                },
                "title": "ListLoopsSamplersRequestV1",
                "type": "object"
            },
            "CreateLoopsSamplerRequestV1": {
                "properties": {
                    "availability_model": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/V1AvailabilityModel"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Capacity the sampler runs on. 'spot' allows preemption when its GPUs are reclaimed. Defaults to 'dedicated' for standalone samplers. Paired samplers inherit their run's availability model; an explicit value must match it."
                    },
                    "session_id": {
                        "description": "ID of the Loops session this sampler belongs to.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Base model ID for a standalone sampler (for example, a baseline).",
                        "title": "Base Model"
                    },
                    "run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of an existing run to attach this sampler to. When set, the sampler is paired to the run and weight-syncs from its trainer, and base_model is inherited from the run. Omit to create a standalone sampler.",
                        "title": "Run Id"
                    },
                    "max_seq_length": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum prompt length (in tokens) the sampler must handle. Set this to the longest prompt you plan to send.",
                        "title": "Max Seq Length"
                    },
                    "model_path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "bt:// URI of an existing sampler checkpoint to serve. Form: bt://loops:<run_id>/sampler_weights/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/sampler_weights/step-100"
                        ],
                        "title": "Model Path"
                    },
                    "reuse_from_session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional ID of a prior Loops session to reuse a trainer and/or sampler from. Deprecated.",
                        "title": "Reuse From Session Id"
                    },
                    "num_replicas": {
                        "anyOf": [
                            {
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Number of replicas the sampler runs, applied as both its minimum and maximum. Must be at least 1. If omitted, a new sampler uses the platform defaults and a paired sampler reused from an earlier run keeps its settings. A run that already has a sampler keeps it unchanged, and when a run ends, its sampler is scaled down.",
                        "title": "Num Replicas"
                    }
                },
                "required": [
                    "session_id"
                ],
                "title": "CreateLoopsSamplerRequestV1",
                "type": "object"
            },
            "CreateLoopsSamplerResponseV1": {
                "properties": {
                    "sampler": {
                        "$ref": "#/components/schemas/LoopsSamplerV1"
                    }
                },
                "required": [
                    "sampler"
                ],
                "title": "CreateLoopsSamplerResponseV1",
                "type": "object"
            },
            "DeactivateLoopsSamplerResponseV1": {
                "description": "Response for ``POST /v1/loops/samplers/<sampler_id>/deactivate``.",
                "properties": {
                    "id": {
                        "description": "The deactivated Loops sampler ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The base model the deactivated sampler was serving.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owns the Loops sampler."
                    }
                },
                "required": [
                    "id",
                    "base_model",
                    "user"
                ],
                "title": "DeactivateLoopsSamplerResponseV1",
                "type": "object"
            },
            "GetLoopsSamplerResponseV1": {
                "description": "Response for ``GET /v1/loops/samplers/<sampler_id>``.",
                "properties": {
                    "sampler": {
                        "$ref": "#/components/schemas/LoopsSamplerV1",
                        "description": "The Loops sampler."
                    }
                },
                "required": [
                    "sampler"
                ],
                "title": "GetLoopsSamplerResponseV1",
                "type": "object"
            },
            "LoopsCheckpointV1": {
                "description": "A checkpoint saved by a Loops run.",
                "properties": {
                    "checkpoint_id": {
                        "description": "The ID of the checkpoint.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "The timestamp of the checkpoint in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "checkpoint_type": {
                        "description": "The type of checkpoint.",
                        "title": "Checkpoint Type",
                        "type": "string"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The base model of the checkpoint.",
                        "title": "Base Model"
                    },
                    "lora_adapter_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The adapter config of the checkpoint.",
                        "title": "Lora Adapter Config"
                    },
                    "size_bytes": {
                        "description": "The size of the checkpoint in bytes.",
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "sync_status": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sync state of the checkpoint: SYNCING or COMPLETE.",
                        "title": "Sync Status"
                    },
                    "id": {
                        "description": "The checkpoint ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "run_id": {
                        "description": "The ID of the run that produced the checkpoint.",
                        "title": "Run Id",
                        "type": "string"
                    },
                    "target": {
                        "$ref": "#/components/schemas/TrainerCheckpointTarget",
                        "description": "Whether this checkpoint is loadable by the sampler or by the run."
                    }
                },
                "required": [
                    "checkpoint_id",
                    "created_at",
                    "checkpoint_type",
                    "base_model",
                    "lora_adapter_config",
                    "size_bytes",
                    "id",
                    "run_id",
                    "target"
                ],
                "title": "LoopsCheckpointV1",
                "type": "object"
            },
            "TrainerCheckpointTarget": {
                "description": "Whether a TrainerServerCheckpoint is loadable by the sampler or the trainer.\n\nSAMPLER checkpoints are consumed by the sampling server for inference;\nTRAINER checkpoints capture full trainer state for resuming training.\nMirrored in the bt:// URI as\n``bt://loops:<trainer_id>/(sampler_weights|weights)/<name>``.",
                "enum": [
                    "sampler",
                    "trainer"
                ],
                "title": "TrainerCheckpointTarget",
                "type": "string"
            },
            "ListLoopsCheckpointsResponseV1": {
                "description": "Checkpoints matching the query filter.",
                "properties": {
                    "checkpoints": {
                        "description": "Matching checkpoints.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsCheckpointV1"
                        },
                        "title": "Checkpoints",
                        "type": "array"
                    }
                },
                "required": [
                    "checkpoints"
                ],
                "title": "ListLoopsCheckpointsResponseV1",
                "type": "object"
            },
            "ListLoopsCheckpointsQueryParamsV1": {
                "description": "Query-string filters for ``GET /v1/loops/checkpoints``.\n\nProvide exactly one of ``run_id`` (all checkpoints for the run),\n``base_model`` (all checkpoints across the caller's runs of that\nbase model), or ``checkpoint_path`` (the single matching checkpoint).",
                "properties": {
                    "run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by run ID. Returns all checkpoints saved by the run.",
                        "examples": [
                            "k4q95w5"
                        ],
                        "title": "Run Id"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by base model. Returns checkpoints across the caller's runs of this base model.",
                        "examples": [
                            "Qwen/Qwen3-8B"
                        ],
                        "title": "Base Model"
                    },
                    "checkpoint_path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "bt:// URI of a Loops checkpoint. Form: bt://loops:<run_id>/(weights|sampler_weights)/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/sampler_weights/step-100"
                        ],
                        "title": "Checkpoint Path"
                    }
                },
                "title": "ListLoopsCheckpointsQueryParamsV1",
                "type": "object"
            },
            "ValidateLoopsCheckpointRequestV1": {
                "description": "Request body for ``POST /v1/loops/checkpoints/validate``.",
                "properties": {
                    "checkpoint_path": {
                        "description": "bt:// URI of a sampler checkpoint. Form: bt://loops:<run_id>/sampler_weights/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/sampler_weights/step-100"
                        ],
                        "title": "Checkpoint Path",
                        "type": "string"
                    }
                },
                "required": [
                    "checkpoint_path"
                ],
                "title": "ValidateLoopsCheckpointRequestV1",
                "type": "object"
            },
            "ValidateLoopsCheckpointResponseV1": {
                "description": "Response for ``POST /v1/loops/checkpoints/validate``. Empty on success;\ninaccessible or malformed paths raise 400.",
                "properties": {},
                "title": "ValidateLoopsCheckpointResponseV1",
                "type": "object"
            },
            "DeployLoopsCheckpointRequestV1": {
                "properties": {
                    "checkpoint_ids": {
                        "description": "Sampler checkpoint IDs to deploy together.",
                        "items": {
                            "type": "string"
                        },
                        "minItems": 1,
                        "title": "Checkpoint Ids",
                        "type": "array"
                    },
                    "model_name": {
                        "description": "Name for the created model.",
                        "minLength": 1,
                        "title": "Model Name",
                        "type": "string"
                    },
                    "instance_type_id": {
                        "description": "Instance type ID for the deployment.",
                        "title": "Instance Type Id",
                        "type": "string"
                    },
                    "hf_secret_name": {
                        "description": "Name of the team-scoped secret that supplies HF_TOKEN.",
                        "minLength": 1,
                        "title": "Hf Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "checkpoint_ids",
                    "model_name",
                    "instance_type_id",
                    "hf_secret_name"
                ],
                "title": "DeployLoopsCheckpointRequestV1",
                "type": "object"
            },
            "DeployLoopsCheckpointResponseV1": {
                "properties": {
                    "model_id": {
                        "description": "ID of the created or updated model.",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "description": "ID of the created model version deployment.",
                        "title": "Deployment Id",
                        "type": "string"
                    }
                },
                "required": [
                    "model_id",
                    "deployment_id"
                ],
                "title": "DeployLoopsCheckpointResponseV1",
                "type": "object"
            },
            "LoopsCheckpointFilesResponseV1": {
                "description": "Response with presigned URLs for files under a Loops checkpoint.",
                "properties": {
                    "presigned_urls": {
                        "description": "List of presigned URLs for checkpoint files.",
                        "items": {
                            "$ref": "#/components/schemas/CheckpointFile"
                        },
                        "title": "Presigned Urls",
                        "type": "array"
                    },
                    "next_page_token": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Token to use for fetching the next page of results. None when there are no more results.",
                        "title": "Next Page Token"
                    },
                    "total_count": {
                        "description": "Total number of checkpoint files available.",
                        "title": "Total Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "presigned_urls",
                    "total_count"
                ],
                "title": "LoopsCheckpointFilesResponseV1",
                "type": "object"
            },
            "GetLoopsCheckpointFilesRequestV1": {
                "description": "Pagination params for ``GET /v1/loops/checkpoints/<checkpoint_id>/files``.",
                "properties": {
                    "page_size": {
                        "default": 1000,
                        "description": "Max files per page (default 1000).",
                        "minimum": 1,
                        "title": "Page Size",
                        "type": "integer"
                    },
                    "page_token": {
                        "default": 0,
                        "description": "Offset into the file list (default 0).",
                        "minimum": 0,
                        "title": "Page Token",
                        "type": "integer"
                    }
                },
                "title": "GetLoopsCheckpointFilesRequestV1",
                "type": "object"
            },
            "LoopsCheckpointS3SourceV1": {
                "description": "The checkpoint's files are fetched as presigned URLs, page by page.",
                "properties": {
                    "kind": {
                        "const": "s3",
                        "default": "s3",
                        "title": "Kind",
                        "type": "string"
                    }
                },
                "title": "LoopsCheckpointS3SourceV1",
                "type": "object"
            },
            "LoopsCheckpointVolumeSourceV1": {
                "description": "The checkpoint's files are pulled from a Baseten volume.",
                "properties": {
                    "kind": {
                        "const": "volume",
                        "default": "volume",
                        "title": "Kind",
                        "type": "string"
                    },
                    "volume_ref": {
                        "description": "Ref of the volume version holding the checkpoint, as `bdn:<namespace>/<volume>:<tag>`.",
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "path": {
                        "description": "Directory inside that version holding the checkpoint's files.",
                        "title": "Path",
                        "type": "string"
                    }
                },
                "required": [
                    "volume_ref",
                    "path"
                ],
                "title": "LoopsCheckpointVolumeSourceV1",
                "type": "object"
            },
            "LoopsCheckpointSourceResponseV1": {
                "description": "Where a checkpoint's files are fetched from, and how.",
                "properties": {
                    "source": {
                        "description": "`s3` means the files endpoint serves presigned URLs for this checkpoint; `volume` carries the ref to pull instead.",
                        "discriminator": {
                            "mapping": {
                                "s3": "#/components/schemas/LoopsCheckpointS3SourceV1",
                                "volume": "#/components/schemas/LoopsCheckpointVolumeSourceV1"
                            },
                            "propertyName": "kind"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/LoopsCheckpointS3SourceV1"
                            },
                            {
                                "$ref": "#/components/schemas/LoopsCheckpointVolumeSourceV1"
                            }
                        ],
                        "title": "Source"
                    }
                },
                "required": [
                    "source"
                ],
                "title": "LoopsCheckpointSourceResponseV1",
                "type": "object"
            },
            "LoopsDeploymentStatusV1": {
                "description": "Latest deployment status for a Loops deployment.",
                "properties": {
                    "name": {
                        "$ref": "#/components/schemas/Name",
                        "description": "Latest status of the Loops deployment."
                    }
                },
                "required": [
                    "name"
                ],
                "title": "LoopsDeploymentStatusV1",
                "type": "object"
            },
            "LoopsDeploymentV1": {
                "description": "A Loops deployment \u2014 the long-lived run + sampler pair owned by a user.\n\nThe deployment's current sampler is included inline. The full list of\nsamplers visible to the caller (across all deployments) lives at\n``GET /v1/loops/samplers``.",
                "properties": {
                    "id": {
                        "description": "The Loops deployment ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "active_run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The ID of the run currently active on this deployment, if any. Null when the deployment's runs have been marked inactive (e.g. scale-to-zero) without a successor.",
                        "title": "Active Run Id"
                    },
                    "latest_run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The ID of the most recent run on this deployment, active or not, so idle deployments still expose a usable run handle. Null only if the deployment has no runs.",
                        "title": "Latest Run Id"
                    },
                    "base_model": {
                        "description": "The HuggingFace base model the deployment is fine-tuning.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "base_url": {
                        "description": "The run's base URL.",
                        "title": "Base Url",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/LoopsDeploymentStatusV1",
                        "description": "Latest deployment status."
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owns the Loops deployment."
                    },
                    "created_at": {
                        "description": "Time the deployment was created in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity the trainer was scheduled on."
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type backing the trainer."
                    },
                    "node_count": {
                        "default": 1,
                        "description": "Number of nodes backing the trainer.",
                        "title": "Node Count",
                        "type": "integer"
                    },
                    "sampler": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoopsSamplerV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The sampler bound to this deployment."
                    }
                },
                "required": [
                    "id",
                    "base_model",
                    "base_url",
                    "status",
                    "user",
                    "created_at",
                    "instance_type"
                ],
                "title": "LoopsDeploymentV1",
                "type": "object"
            },
            "Name": {
                "enum": [
                    "CREATED",
                    "DEPLOYING",
                    "RUNNING",
                    "SCALED_TO_ZERO",
                    "FAILED",
                    "STOPPED",
                    "PREEMPTED"
                ],
                "title": "LoopsDeploymentStatus",
                "type": "string"
            },
            "ListLoopsDeploymentsResponseV1": {
                "description": "Response for ``GET /v1/loops/deployments``.\n\nDefaults to the caller's own; pass ``?scope=org`` to list every deployment in\nthe caller's organization. Returns every deployment regardless of status;\nclients filter terminal states.",
                "properties": {
                    "deployments": {
                        "description": "Active Loops deployments.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsDeploymentV1"
                        },
                        "title": "Deployments",
                        "type": "array"
                    }
                },
                "required": [
                    "deployments"
                ],
                "title": "ListLoopsDeploymentsResponseV1",
                "type": "object"
            },
            "ListLoopsDeploymentsRequestV1": {
                "description": "Query-string filters for ``GET /v1/loops/deployments``.",
                "properties": {
                    "scope": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Defaults to the caller's own deployments; pass 'org' to list every deployment in the caller's organization.",
                        "examples": [
                            "org"
                        ],
                        "title": "Scope"
                    }
                },
                "title": "ListLoopsDeploymentsRequestV1",
                "type": "object"
            },
            "DeactivateLoopsDeploymentResponseV1": {
                "description": "Response for ``POST /v1/loops/deployments/<deployment_id>/deactivate``.",
                "properties": {
                    "id": {
                        "description": "The deactivated Loops deployment ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The base model whose Loops deployment was deactivated.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owned the Loops deployment."
                    }
                },
                "required": [
                    "id",
                    "base_model",
                    "user"
                ],
                "title": "DeactivateLoopsDeploymentResponseV1",
                "type": "object"
            },
            "GetLoopsDeploymentResponseV1": {
                "description": "Response for ``GET /v1/loops/deployments/<deployment_id>``.",
                "properties": {
                    "deployment": {
                        "$ref": "#/components/schemas/LoopsDeploymentV1",
                        "description": "The Loops deployment."
                    }
                },
                "required": [
                    "deployment"
                ],
                "title": "GetLoopsDeploymentResponseV1",
                "type": "object"
            },
            "LoopsDebugArchiveFilesResponseV1": {
                "description": "Response with presigned URLs for a Loops deployment's debug archive.",
                "properties": {
                    "presigned_urls": {
                        "items": {
                            "$ref": "#/components/schemas/CheckpointFile"
                        },
                        "title": "Presigned Urls",
                        "type": "array"
                    },
                    "next_page_token": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Next Page Token"
                    }
                },
                "required": [
                    "presigned_urls"
                ],
                "title": "LoopsDebugArchiveFilesResponseV1",
                "type": "object"
            },
            "GetLoopsDebugArchiveFilesRequestV1": {
                "description": "Pagination params for a Loops deployment debug archive.",
                "properties": {
                    "page_size": {
                        "default": 1000,
                        "description": "Max files per page (default and maximum 1000).",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Page Size",
                        "type": "integer"
                    },
                    "page_token": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque token for the next page.",
                        "title": "Page Token"
                    }
                },
                "title": "GetLoopsDebugArchiveFilesRequestV1",
                "type": "object"
            },
            "GetLoopsDeploymentMetricsRequestV1": {
                "description": "Time-range request for trainer deployment metrics.",
                "properties": {
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis to end fetching metrics.",
                        "title": "End Epoch Millis"
                    },
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis to start fetching metrics.",
                        "title": "Start Epoch Millis"
                    },
                    "step_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Resolution of the returned series, in seconds. When omitted, a step is derived from the time range so large windows return fewer points.",
                        "title": "Step Seconds"
                    },
                    "time_divisor_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Unit of time for request-volume metrics, in seconds (e.g. 60 for requests/minute). Defaults to per-second.",
                        "title": "Time Divisor Seconds"
                    }
                },
                "title": "GetLoopsDeploymentMetricsRequestV1",
                "type": "object"
            },
            "InferenceVolumeByStatusDatapointV1": {
                "description": "Request rate split by HTTP response code class.",
                "properties": {
                    "timestamp": {
                        "description": "ISO 8601 timestamp.",
                        "format": "date-time",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "status_2xx": {
                        "description": "2xx requests per second.",
                        "title": "Status 2Xx",
                        "type": "number"
                    },
                    "status_4xx": {
                        "description": "4xx requests per second.",
                        "title": "Status 4Xx",
                        "type": "number"
                    },
                    "status_5xx": {
                        "description": "5xx requests per second.",
                        "title": "Status 5Xx",
                        "type": "number"
                    }
                },
                "required": [
                    "timestamp",
                    "status_2xx",
                    "status_4xx",
                    "status_5xx"
                ],
                "title": "InferenceVolumeByStatusDatapointV1",
                "type": "object"
            },
            "LoopsDeploymentMetricsV1": {
                "description": "Metrics for a trainer (Loops) deployment.\n\nService-level fields summarize HTTP traffic into the trainer pods (the\nKnative queue-proxy is the source). Compute fields are the leader-pod\naggregate; ``per_node_metrics`` carries the full multinode breakdown.",
                "properties": {
                    "inference_volume": {
                        "description": "Number of inference requests per unit time (requests per second).",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Inference Volume",
                        "type": "array"
                    },
                    "concurrent_requests": {
                        "description": "Number of in-progress concurrent inference requests. Source: the queue-proxy ``revision_queue_depth`` gauge on ``http-usermetric``.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Concurrent Requests",
                        "type": "array"
                    },
                    "response_time_stats": {
                        "description": "Percentiles of the response time distribution.",
                        "items": {
                            "$ref": "#/components/schemas/ResponseTimeDatapointV1"
                        },
                        "title": "Response Time Stats",
                        "type": "array"
                    },
                    "inference_volume_by_status": {
                        "description": "Request rate split by response code class.",
                        "items": {
                            "$ref": "#/components/schemas/InferenceVolumeByStatusDatapointV1"
                        },
                        "title": "Inference Volume By Status",
                        "type": "array"
                    },
                    "gpu_memory_usage_bytes": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "Leader-pod GPU memory bytes per GPU rank.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "Leader-pod fractional GPU utilization per GPU rank.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "Leader-pod CPU usage in cores.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "Leader-pod CPU memory usage bytes.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Memory Usage Bytes",
                        "type": "array"
                    },
                    "ephemeral_storage": {
                        "$ref": "#/components/schemas/StorageMetricsV1",
                        "description": "Leader-pod ephemeral storage usage."
                    },
                    "per_node_metrics": {
                        "description": "Per-node compute breakdown for multinode trainer deployments.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsDeploymentNodeMetricsV1"
                        },
                        "title": "Per Node Metrics",
                        "type": "array"
                    }
                },
                "required": [
                    "inference_volume",
                    "concurrent_requests",
                    "response_time_stats",
                    "inference_volume_by_status",
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "cpu_usage",
                    "cpu_memory_usage_bytes",
                    "ephemeral_storage",
                    "per_node_metrics"
                ],
                "title": "LoopsDeploymentMetricsV1",
                "type": "object"
            },
            "LoopsDeploymentNodeMetricsV1": {
                "description": "Per-node compute metrics for a multinode trainer deployment.",
                "properties": {
                    "node_id": {
                        "description": "Identifier for the node.",
                        "title": "Node Id",
                        "type": "string"
                    },
                    "gpu_memory_usage_bytes": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "GPU memory usage bytes per GPU rank.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "Fractional GPU utilization per GPU rank.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "CPU usage in cores.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "CPU memory usage bytes.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Memory Usage Bytes",
                        "type": "array"
                    },
                    "ephemeral_storage": {
                        "$ref": "#/components/schemas/StorageMetricsV1",
                        "description": "Ephemeral storage usage."
                    }
                },
                "required": [
                    "node_id",
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "cpu_usage",
                    "cpu_memory_usage_bytes",
                    "ephemeral_storage"
                ],
                "title": "LoopsDeploymentNodeMetricsV1",
                "type": "object"
            },
            "ResponseTimeDatapointV1": {
                "description": "Latency quantile datapoint. Values are reported in milliseconds.",
                "properties": {
                    "timestamp": {
                        "description": "ISO 8601 timestamp.",
                        "format": "date-time",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "50th percentile request latency (milliseconds).",
                        "title": "P50"
                    },
                    "p95": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "95th percentile request latency (milliseconds).",
                        "title": "P95"
                    },
                    "p99": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "99th percentile request latency (milliseconds).",
                        "title": "P99"
                    }
                },
                "required": [
                    "timestamp"
                ],
                "title": "ResponseTimeDatapointV1",
                "type": "object"
            },
            "GetLoopsDeploymentMetricsResponseV1": {
                "description": "Response for ``POST /v1/loops/deployments/<id>/metrics``.",
                "properties": {
                    "deployment_id": {
                        "description": "The trainer deployment ID.",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "metrics": {
                        "$ref": "#/components/schemas/LoopsDeploymentMetricsV1",
                        "description": "Metrics for the deployment."
                    }
                },
                "required": [
                    "deployment_id",
                    "metrics"
                ],
                "title": "GetLoopsDeploymentMetricsResponseV1",
                "type": "object"
            },
            "GetLoopsDeploymentLogsRequestV1": {
                "description": "Query parameters for fetching a Loops deployment's logs.",
                "properties": {
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort order for logs"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 500,
                        "description": "Limit of logs to fetch in a single request",
                        "title": "Limit"
                    },
                    "min_level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level."
                    }
                },
                "title": "GetLoopsDeploymentLogsRequestV1",
                "type": "object"
            },
            "TeamTrainingGpuCapacityItemV1": {
                "description": "Per-team GPU capacity and current usage for one GPU type.",
                "properties": {
                    "team_id": {
                        "description": "Team identifier",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Team name",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "baseline": {
                        "description": "Baseline GPU allocation for the team. 0 if not configured.",
                        "title": "Baseline",
                        "type": "integer"
                    },
                    "limit": {
                        "description": "Maximum concurrent GPUs of this type for this team",
                        "title": "Limit",
                        "type": "integer"
                    },
                    "usage_count": {
                        "description": "GPUs currently in use by the team's active training jobs",
                        "title": "Usage Count",
                        "type": "integer"
                    },
                    "dedicated_usage_count": {
                        "default": 0,
                        "description": "Portion of usage_count from dedicated (on-demand) jobs.",
                        "title": "Dedicated Usage Count",
                        "type": "integer"
                    },
                    "spot_usage_count": {
                        "default": 0,
                        "description": "Portion of usage_count from spot jobs.",
                        "title": "Spot Usage Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "team_id",
                    "team_name",
                    "gpu_type",
                    "baseline",
                    "limit",
                    "usage_count"
                ],
                "title": "TeamTrainingGpuCapacityItemV1",
                "type": "object"
            },
            "TrainingGpuCapacityItemV1": {
                "description": "GPU capacity and current usage for one GPU type.",
                "properties": {
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "baseline": {
                        "description": "Baseline GPU allocation; jobs below this threshold are expected to run immediately. 0 if not configured.",
                        "title": "Baseline",
                        "type": "integer"
                    },
                    "limit": {
                        "description": "Maximum concurrent GPUs of this type for this org",
                        "title": "Limit",
                        "type": "integer"
                    },
                    "usage_count": {
                        "description": "GPUs currently in use by active training jobs",
                        "title": "Usage Count",
                        "type": "integer"
                    },
                    "dedicated_usage_count": {
                        "default": 0,
                        "description": "Portion of usage_count from dedicated (on-demand) jobs, which run against the baseline.",
                        "title": "Dedicated Usage Count",
                        "type": "integer"
                    },
                    "spot_usage_count": {
                        "default": 0,
                        "description": "Portion of usage_count from spot jobs, which burst into the peak and may push usage above the limit.",
                        "title": "Spot Usage Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "gpu_type",
                    "baseline",
                    "limit",
                    "usage_count"
                ],
                "title": "TrainingGpuCapacityItemV1",
                "type": "object"
            },
            "GetTrainingGpuCapacityResponseV1": {
                "description": "Response for the training GPU capacity endpoint.",
                "properties": {
                    "gpu_capacities": {
                        "description": "Org-level GPU capacity limits and current usage per GPU type",
                        "items": {
                            "$ref": "#/components/schemas/TrainingGpuCapacityItemV1"
                        },
                        "title": "Gpu Capacities",
                        "type": "array"
                    },
                    "team_gpu_capacities": {
                        "description": "Per-team GPU capacity limits and current usage per GPU type",
                        "items": {
                            "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1"
                        },
                        "title": "Team Gpu Capacities",
                        "type": "array"
                    }
                },
                "required": [
                    "gpu_capacities"
                ],
                "title": "GetTrainingGpuCapacityResponseV1",
                "type": "object"
            },
            "PatchTeamTrainingGpuCapacityRequestV1": {
                "description": "A request to set the GPU capacity ceiling for a (team, gpu_type) pair.\n\nCreates the limit if one doesn't already exist for this team and GPU type,\notherwise updates it in place.",
                "properties": {
                    "team_id": {
                        "description": "Team identifier",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "max_gpus": {
                        "description": "Max concurrent GPUs of this type the team may use",
                        "examples": [
                            8,
                            16,
                            32
                        ],
                        "title": "Max Gpus",
                        "type": "integer"
                    }
                },
                "required": [
                    "team_id",
                    "gpu_type",
                    "max_gpus"
                ],
                "title": "PatchTeamTrainingGpuCapacityRequestV1",
                "type": "object"
            },
            "PatchTeamTrainingGpuCapacityResponseV1": {
                "description": "Response for setting a team's GPU capacity ceiling.",
                "properties": {
                    "team_gpu_capacity": {
                        "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1",
                        "description": "The updated per-team GPU capacity limit"
                    }
                },
                "required": [
                    "team_gpu_capacity"
                ],
                "title": "PatchTeamTrainingGpuCapacityResponseV1",
                "type": "object"
            },
            "ActiveJobAtSubmitV1": {
                "description": "One other job in the same (org, gpu_type) pool that was holding GPU\ncapacity at the moment the target was submitted.",
                "properties": {
                    "training_job_id": {
                        "description": "Hashid of the other training job",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "training_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Other job's name",
                        "title": "Training Job Name"
                    },
                    "instance_type_name": {
                        "description": "Instance type of the other job",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "total_gpus": {
                        "description": "gpu_count * effective_node_count",
                        "title": "Total Gpus",
                        "type": "integer"
                    },
                    "workload_plane_name": {
                        "description": "Workload plane the other job was on",
                        "title": "Workload Plane Name",
                        "type": "string"
                    },
                    "status_at_submit": {
                        "description": "Other job's status as of submitted_at (one of ACTIVE_STATES)",
                        "title": "Status At Submit",
                        "type": "string"
                    },
                    "status_set_at": {
                        "description": "When that status was set",
                        "format": "date-time",
                        "title": "Status Set At",
                        "type": "string"
                    }
                },
                "required": [
                    "training_job_id",
                    "instance_type_name",
                    "total_gpus",
                    "workload_plane_name",
                    "status_at_submit",
                    "status_set_at"
                ],
                "title": "ActiveJobAtSubmitV1",
                "type": "object"
            },
            "CapacityAtSubmitV1": {
                "description": "A GPU capacity row as it stands now, with ``last_modified`` so callers\ncan judge whether the value matches what the dequeue gate saw at submit\ntime. Capacity rows are not historicized: edits overwrite in place. Compare\n``last_modified`` against the response's ``submitted_at`` \u2014 if it's later,\nthe value may have changed.",
                "properties": {
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "max_gpus": {
                        "description": "Current max concurrent GPUs of this type",
                        "title": "Max Gpus",
                        "type": "integer"
                    },
                    "min_gpus": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Current baseline GPU allocation, if configured",
                        "title": "Min Gpus"
                    },
                    "last_modified": {
                        "description": "When the capacity row was last modified",
                        "format": "date-time",
                        "title": "Last Modified",
                        "type": "string"
                    }
                },
                "required": [
                    "gpu_type",
                    "max_gpus",
                    "last_modified"
                ],
                "title": "CapacityAtSubmitV1",
                "type": "object"
            },
            "PendingJobAheadAtSubmitV1": {
                "description": "A PENDING job in the same (org, gpu_type) pool that was ahead of the\ntarget in dequeue FIFO order at submitted_at \u2014 higher priority, or same\npriority and earlier submission.",
                "properties": {
                    "training_job_id": {
                        "description": "Hashid of the other training job",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "training_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Other job's name",
                        "title": "Training Job Name"
                    },
                    "instance_type_name": {
                        "description": "Instance type of the other job",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "requested_gpus": {
                        "description": "gpu_count * effective_node_count",
                        "title": "Requested Gpus",
                        "type": "integer"
                    },
                    "priority": {
                        "description": "Effective priority (NULL coalesced to 0)",
                        "title": "Priority",
                        "type": "integer"
                    },
                    "submitted_at": {
                        "description": "The other job's submission time",
                        "format": "date-time",
                        "title": "Submitted At",
                        "type": "string"
                    }
                },
                "required": [
                    "training_job_id",
                    "instance_type_name",
                    "requested_gpus",
                    "priority",
                    "submitted_at"
                ],
                "title": "PendingJobAheadAtSubmitV1",
                "type": "object"
            },
            "QueueEventV1": {
                "description": "A single ``TrainingJobStatus`` row inside the queue-context window.",
                "properties": {
                    "training_job_id": {
                        "description": "Hashid of the training job this event is for",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "training_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Job name",
                        "title": "Training Job Name"
                    },
                    "status": {
                        "description": "TrainingJobStatus.Name value",
                        "title": "Status",
                        "type": "string"
                    },
                    "created": {
                        "description": "When the status row was inserted",
                        "format": "date-time",
                        "title": "Created",
                        "type": "string"
                    },
                    "event_message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Human-readable event message from the status metadata",
                        "title": "Event Message"
                    },
                    "exit_code": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exit code from the status metadata, if any",
                        "title": "Exit Code"
                    }
                },
                "required": [
                    "training_job_id",
                    "status",
                    "created"
                ],
                "title": "QueueEventV1",
                "type": "object"
            },
            "GetTrainingJobQueueContextResponseV1": {
                "description": "Read-only diagnostic for a training job's PENDING window.\n\nReturns the (org, gpu_type) capacity pool the job was gated by, jobs that\nwere holding GPU capacity in that pool when this job was submitted, and\nevery status event in [submitted_at, released_at] for those jobs (or up to\n\"now\" if the target is still PENDING).",
                "properties": {
                    "target_job_id": {
                        "description": "Hashid of the target training job",
                        "title": "Target Job Id",
                        "type": "string"
                    },
                    "target_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target job's name",
                        "title": "Target Job Name"
                    },
                    "gpu_type": {
                        "description": "GPU type the target requested",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "requested_gpus": {
                        "description": "GPUs the target requested (gpu_count * effective_node_count)",
                        "title": "Requested Gpus",
                        "type": "integer"
                    },
                    "submitted_at": {
                        "description": "When the job row was inserted (= API POST time)",
                        "format": "date-time",
                        "title": "Submitted At",
                        "type": "string"
                    },
                    "released_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the job's TRAINING_JOB_CREATED status was set, i.e. the moment it was released from PENDING. None if still PENDING.",
                        "title": "Released At"
                    },
                    "pending_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "released_at - submitted_at in seconds. None if still PENDING.",
                        "title": "Pending Seconds"
                    },
                    "org_capacity": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CapacityAtSubmitV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Org-level cap for (org, gpu_type). None if no cap is configured."
                    },
                    "team_capacity": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CapacityAtSubmitV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team-level cap for (team, gpu_type). None if no team cap is configured."
                    },
                    "active_at_submit": {
                        "description": "Jobs in the same (org, gpu_type) pool that were holding capacity at submitted_at",
                        "items": {
                            "$ref": "#/components/schemas/ActiveJobAtSubmitV1"
                        },
                        "title": "Active At Submit",
                        "type": "array"
                    },
                    "pending_ahead_at_submit": {
                        "description": "PENDING jobs in the same (org, gpu_type) pool that were ahead of the target in dequeue FIFO order at submitted_at (priority DESC then created ASC). These also block the target's release.",
                        "items": {
                            "$ref": "#/components/schemas/PendingJobAheadAtSubmitV1"
                        },
                        "title": "Pending Ahead At Submit",
                        "type": "array"
                    },
                    "events": {
                        "description": "Every status event in [submitted_at, events_window_end] for the target job, every job in active_at_submit, and every job in pending_ahead_at_submit, oldest first.",
                        "items": {
                            "$ref": "#/components/schemas/QueueEventV1"
                        },
                        "title": "Events",
                        "type": "array"
                    },
                    "events_window_end": {
                        "description": "released_at if set, else 'now' (events ongoing)",
                        "format": "date-time",
                        "title": "Events Window End",
                        "type": "string"
                    }
                },
                "required": [
                    "target_job_id",
                    "gpu_type",
                    "requested_gpus",
                    "submitted_at",
                    "active_at_submit",
                    "pending_ahead_at_submit",
                    "events",
                    "events_window_end"
                ],
                "title": "GetTrainingJobQueueContextResponseV1",
                "type": "object"
            },
            "GetBlobCredentialsResponseV1": {
                "description": "Response to create a new set of credentials for blob upload.",
                "properties": {
                    "creds": {
                        "$ref": "#/components/schemas/AWSCredentialsV1",
                        "description": "The credentials to upload the blob to"
                    },
                    "s3_key": {
                        "description": "The S3 key to upload the blob to",
                        "title": "S3 Key",
                        "type": "string"
                    },
                    "s3_bucket": {
                        "description": "The S3 bucket to upload the blob to",
                        "title": "S3 Bucket",
                        "type": "string"
                    }
                },
                "required": [
                    "creds",
                    "s3_key",
                    "s3_bucket"
                ],
                "title": "GetBlobCredentialsResponseV1",
                "type": "object"
            },
            "APIKeyCategory": {
                "description": "Enum representing the category of an API key.",
                "enum": [
                    "PERSONAL",
                    "ROUTES",
                    "WORKSPACE_MANAGE_ALL",
                    "WORKSPACE_EXPORT_METRICS",
                    "WORKSPACE_INVOKE",
                    "WORKSPACE_MANAGE_API_KEYS"
                ],
                "title": "APIKeyCategory",
                "type": "string"
            },
            "CreateAPIKeyRequestV1": {
                "description": "Request to create an API key.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional name for the API key",
                        "examples": [
                            "my-api-key"
                        ],
                        "title": "Name"
                    },
                    "type": {
                        "$ref": "#/components/schemas/APIKeyCategory",
                        "description": "Type of the API key.",
                        "examples": [
                            "PERSONAL",
                            "ROUTES",
                            "WORKSPACE_MANAGE_API_KEYS",
                            "WORKSPACE_EXPORT_METRICS",
                            "WORKSPACE_INVOKE",
                            "WORKSPACE_MANAGE_ALL"
                        ]
                    },
                    "model_ids": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "List of model IDs to scope the API key to, only present if type is 'WORKSPACE_EXPORT_METRICS' or 'WORKSPACE_INVOKE'",
                        "examples": [
                            [
                                "aaaaaaaa"
                            ]
                        ],
                        "title": "Model Ids"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team ID for a team-scoped key. When omitted, uses the team in the URL if present, otherwise your organization's default team. Must match the URL team when both are provided. Not supported for PERSONAL or WORKSPACE_MANAGE_API_KEYS keys.",
                        "title": "Team Id"
                    }
                },
                "required": [
                    "type"
                ],
                "title": "CreateAPIKeyRequestV1",
                "type": "object"
            },
            "APIKeyV1": {
                "description": "Represents an API key.",
                "properties": {
                    "api_key": {
                        "description": "The API key string",
                        "title": "Api Key",
                        "type": "string"
                    }
                },
                "required": [
                    "api_key"
                ],
                "title": "APIKeyV1",
                "type": "object"
            },
            "APIKeyInfoV1": {
                "description": "Represents the metadata of an API key.",
                "properties": {
                    "prefix": {
                        "description": "The prefix of the API key",
                        "title": "Prefix",
                        "type": "string"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional name for the API key",
                        "examples": [
                            "my-api-key"
                        ],
                        "title": "Name"
                    },
                    "type": {
                        "$ref": "#/components/schemas/APIKeyCategory",
                        "description": "Type of the API key.",
                        "examples": [
                            "PERSONAL",
                            "ROUTES",
                            "WORKSPACE_MANAGE_API_KEYS",
                            "WORKSPACE_EXPORT_METRICS",
                            "WORKSPACE_INVOKE",
                            "WORKSPACE_MANAGE_ALL"
                        ]
                    },
                    "model_ids": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "List of model IDs to scope the API key to, only present if type is 'WORKSPACE_EXPORT_METRICS' or 'WORKSPACE_INVOKE'",
                        "examples": [
                            [
                                "aaaaaaaa"
                            ]
                        ],
                        "title": "Model Ids"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The name of the team associated with the API key",
                        "title": "Team Name"
                    },
                    "created_at": {
                        "description": "Creation time in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "last_used_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Last recorded use in ISO 8601 format, or null if unavailable. Updates may be delayed.",
                        "title": "Last Used At"
                    },
                    "owner": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/APIKeyOwnerV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The user who owns the API key. Only present for personal API keys."
                    }
                },
                "required": [
                    "prefix",
                    "type",
                    "created_at"
                ],
                "title": "APIKeyInfoV1",
                "type": "object"
            },
            "APIKeyOwnerV1": {
                "description": "The user who owns a personal API key.",
                "properties": {
                    "user_id": {
                        "description": "Unique identifier for the user",
                        "title": "User Id",
                        "type": "string"
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Email address of the user",
                        "title": "Email"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the user",
                        "title": "Name"
                    }
                },
                "required": [
                    "user_id"
                ],
                "title": "APIKeyOwnerV1",
                "type": "object"
            },
            "APIKeysV1": {
                "description": "A list of API keys.",
                "properties": {
                    "keys": {
                        "description": "A list of API key information",
                        "items": {
                            "$ref": "#/components/schemas/APIKeyInfoV1"
                        },
                        "title": "Keys",
                        "type": "array"
                    }
                },
                "required": [
                    "keys"
                ],
                "title": "APIKeysV1",
                "type": "object"
            },
            "APIKeysRequestV1": {
                "properties": {
                    "type": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/APIKeyCategory"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by API key type"
                    },
                    "created_by_me": {
                        "default": false,
                        "description": "Return only keys created by the authenticated user",
                        "title": "Created By Me",
                        "type": "boolean"
                    }
                },
                "title": "APIKeysRequestV1",
                "type": "object"
            },
            "APIKeyTombstoneV1": {
                "description": "An API key tombstone.",
                "properties": {
                    "prefix": {
                        "description": "Unique prefix of the API key",
                        "title": "Prefix",
                        "type": "string"
                    }
                },
                "required": [
                    "prefix"
                ],
                "title": "APIKeyTombstoneV1",
                "type": "object"
            },
            "LimitTypeV1": {
                "enum": [
                    "REQUEST",
                    "TOKEN",
                    "CONCURRENT_REQUEST",
                    "UNCACHED_INPUT_TOKEN",
                    "OUTPUT_TOKEN"
                ],
                "title": "LimitTypeV1",
                "type": "string"
            },
            "ModelAPIOrgDetailsV1": {
                "description": "Workspace-specific state for a Model API.",
                "properties": {
                    "added_at": {
                        "description": "When the workspace first added this Model API.",
                        "format": "date-time",
                        "title": "Added At",
                        "type": "string"
                    },
                    "last_used_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the workspace last invoked this Model API. Null if the workspace has never invoked it.",
                        "title": "Last Used At"
                    }
                },
                "required": [
                    "added_at"
                ],
                "title": "ModelAPIOrgDetailsV1",
                "type": "object"
            },
            "ModelAPIV1": {
                "description": "A Model API catalog row, optionally enriched with workspace-specific state.",
                "properties": {
                    "name": {
                        "description": "Identifier of the Model API. Stable, URL-safe slug used as the public identifier.",
                        "examples": [
                            "llama-3-3-70b-instruct"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Human-readable name of the Model API.",
                        "examples": [
                            "Llama 3.3 70B Instruct"
                        ],
                        "title": "Display Name",
                        "type": "string"
                    },
                    "description": {
                        "description": "Description of the Model API.",
                        "title": "Description",
                        "type": "string"
                    },
                    "model_family": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Family the underlying model belongs to.",
                        "examples": [
                            "Meta",
                            "DeepSeek",
                            "Qwen"
                        ],
                        "title": "Model Family"
                    },
                    "release_date": {
                        "description": "Date the Model API was made available.",
                        "format": "date",
                        "title": "Release Date",
                        "type": "string"
                    },
                    "invoke_url": {
                        "description": "Base URL for invoking the Model API. OpenAI-shaped routes (e.g. /v1/chat/completions) live underneath this host.",
                        "examples": [
                            "https://inference.baseten.co"
                        ],
                        "title": "Invoke Url",
                        "type": "string"
                    },
                    "context_length": {
                        "description": "The model's context window length, in tokens.",
                        "examples": [
                            8192
                        ],
                        "title": "Context Length",
                        "type": "integer"
                    },
                    "cost_per_million_input_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Effective cost per million input tokens, in dollars. Null when pricing is unavailable.",
                        "examples": [
                            "0.13"
                        ],
                        "title": "Cost Per Million Input Tokens"
                    },
                    "cost_per_million_output_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Effective cost per million output tokens, in dollars. Null when pricing is unavailable.",
                        "examples": [
                            "0.50"
                        ],
                        "title": "Cost Per Million Output Tokens"
                    },
                    "rate_limits": {
                        "description": "Rate limits in effect for the workspace. Workspace-specific overrides are returned when the workspace has added this Model API and configured them; otherwise the catalog default rate limits are returned.",
                        "items": {
                            "$ref": "#/components/schemas/RateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "org_details": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ModelAPIOrgDetailsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Workspace-specific state. Null when the workspace has not added this Model API."
                    }
                },
                "required": [
                    "name",
                    "display_name",
                    "description",
                    "release_date",
                    "invoke_url",
                    "context_length",
                    "cost_per_million_input_tokens",
                    "cost_per_million_output_tokens",
                    "rate_limits"
                ],
                "title": "ModelAPIV1",
                "type": "object"
            },
            "RateLimitUnitV1": {
                "enum": [
                    "SECOND",
                    "MINUTE"
                ],
                "title": "RateLimitUnitV1",
                "type": "string"
            },
            "RateLimitV1": {
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/LimitTypeV1",
                        "description": "The type of the rate limit",
                        "examples": [
                            "TOKEN",
                            "REQUEST"
                        ]
                    },
                    "unit": {
                        "$ref": "#/components/schemas/RateLimitUnitV1",
                        "description": "The unit of the rate limit",
                        "examples": [
                            "SECOND",
                            "MINUTE"
                        ]
                    },
                    "threshold": {
                        "description": "The threshold for the rate limit",
                        "examples": [
                            1000,
                            50000
                        ],
                        "minimum": 0,
                        "title": "Threshold",
                        "type": "integer"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold"
                ],
                "title": "RateLimitV1",
                "type": "object"
            },
            "ModelAPIsResponseV1": {
                "description": "Page of Model APIs visible to the caller.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/ModelAPIV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ModelAPIsResponseV1",
                "type": "object"
            },
            "ModelAPIsRequestV1": {
                "description": "Query-string filters for ``GET /v1/model_apis``.",
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "added_only": {
                        "default": false,
                        "description": "When true, restrict the result to Model APIs the workspace has added. Defaults to the full visible catalog.",
                        "title": "Added Only",
                        "type": "boolean"
                    }
                },
                "title": "ModelAPIsRequestV1",
                "type": "object"
            },
            "ModelApisUsageBucketV1": {
                "description": "One time bucket and the usage recorded in it.",
                "properties": {
                    "start_time": {
                        "description": "Start of the bucket (inclusive), UTC",
                        "format": "date-time",
                        "title": "Start Time",
                        "type": "string"
                    },
                    "end_time": {
                        "description": "End of the bucket (exclusive), UTC",
                        "format": "date-time",
                        "title": "End Time",
                        "type": "string"
                    },
                    "results": {
                        "description": "Usage totals for this bucket, ordered by total tokens descending",
                        "items": {
                            "$ref": "#/components/schemas/ModelApisUsageResultV1"
                        },
                        "title": "Results",
                        "type": "array"
                    }
                },
                "required": [
                    "start_time",
                    "end_time"
                ],
                "title": "ModelApisUsageBucketV1",
                "type": "object"
            },
            "ModelApisUsageResultV1": {
                "description": "Usage totals for one combination of the requested dimensions, within one bucket.",
                "properties": {
                    "api_key_prefix": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Prefix of the API key the usage is attributed to. Null when not grouping by api_key or when the request was not authenticated with an API key.",
                        "title": "Api Key Prefix"
                    },
                    "user_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User the usage is attributed to. Null when not grouping by user or when the credential is not user-scoped.",
                        "title": "User Id"
                    },
                    "model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model that served the usage. Null when not grouping by model.",
                        "title": "Model"
                    },
                    "input_tokens": {
                        "description": "Total input tokens, cached and uncached combined.",
                        "title": "Input Tokens",
                        "type": "integer"
                    },
                    "cached_input_tokens": {
                        "description": "Input tokens served from the prompt cache.",
                        "title": "Cached Input Tokens",
                        "type": "integer"
                    },
                    "uncached_input_tokens": {
                        "description": "Input tokens not served from the prompt cache.",
                        "title": "Uncached Input Tokens",
                        "type": "integer"
                    },
                    "output_tokens": {
                        "description": "Total output tokens.",
                        "title": "Output Tokens",
                        "type": "integer"
                    },
                    "request_count": {
                        "description": "Total number of requests.",
                        "title": "Request Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "input_tokens",
                    "cached_input_tokens",
                    "uncached_input_tokens",
                    "output_tokens",
                    "request_count"
                ],
                "title": "ModelApisUsageResultV1",
                "type": "object"
            },
            "ModelApisUsageResponseV1": {
                "description": "A page of Model APIs token usage: contiguous time buckets, ordered oldest first.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/ModelApisUsageBucketV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ModelApisUsageResponseV1",
                "type": "object"
            },
            "BucketWidth": {
                "enum": [
                    "1m",
                    "1h",
                    "1d"
                ],
                "title": "BucketWidth",
                "type": "string"
            },
            "UsageDimensionV1": {
                "enum": [
                    "api_key",
                    "user",
                    "model"
                ],
                "title": "UsageDimensionV1",
                "type": "string"
            },
            "ModelApisUsageRequestV1": {
                "properties": {
                    "start_time": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Start of the query range (ISO 8601, UTC), inclusive. Snapped down to the start of its bucket. Required on the first page, and ignored when you pass a cursor.",
                        "title": "Start Time"
                    },
                    "end_time": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "End of the query range (ISO 8601, UTC), exclusive. Defaults to the current time.",
                        "title": "End Time"
                    },
                    "bucket_width": {
                        "$ref": "#/components/schemas/BucketWidth",
                        "default": "1d",
                        "description": "Width of each time bucket: 1m, 1h, or 1d. Defaults to 1d."
                    },
                    "group_by": {
                        "description": "Dimensions to break usage down by, repeated once per dimension: api_key, user, model. Defaults to model.",
                        "items": {
                            "$ref": "#/components/schemas/UsageDimensionV1"
                        },
                        "title": "Group By",
                        "type": "array"
                    },
                    "api_keys": {
                        "description": "Return only usage for these API key prefixes, repeated once per prefix.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Api Keys",
                        "type": "array"
                    },
                    "user_ids": {
                        "description": "Return only usage attributed to these user IDs, repeated once per ID.",
                        "items": {
                            "type": "string"
                        },
                        "title": "User Ids",
                        "type": "array"
                    },
                    "models": {
                        "description": "Return only usage for these models, repeated once per model.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Models",
                        "type": "array"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Number of time buckets to return. Defaults and maximums depend on bucket_width: 1d defaults to 7 and allows 31, 1h defaults to 24 and allows 168, 1m defaults to 60 and allows 1440.",
                        "title": "Limit"
                    },
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor from the pagination.cursor field of a previous response",
                        "title": "Cursor"
                    }
                },
                "title": "ModelApisUsageRequestV1",
                "type": "object"
            },
            "CreateLLMModelRequestV1": {
                "description": "A request to create a BIS-LLM model",
                "properties": {
                    "resources": {
                        "additionalProperties": true,
                        "description": "Resources allocated to the model",
                        "title": "Resources",
                        "type": "object"
                    },
                    "region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Region in which to deploy the model",
                        "title": "Region"
                    },
                    "llm_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Version of the helm chart to use.",
                        "title": "Llm Version"
                    },
                    "llm_config": {
                        "additionalProperties": true,
                        "description": "Configuration specific to the LLM model",
                        "title": "Llm Config",
                        "type": "object"
                    },
                    "environment_variables": {
                        "additionalProperties": true,
                        "description": "Environment variables for the model",
                        "title": "Environment Variables",
                        "type": "object"
                    },
                    "model_metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model metadata persisted into model_config",
                        "title": "Model Metadata"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the model",
                        "examples": [
                            {
                                "autoscaling_window": 600,
                                "concurrency_target": null,
                                "max_replica": 5,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 300,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "additional_autoscaling_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Additional autoscaling configuration (e.g. target in-flight tokens)",
                        "examples": [
                            {
                                "metrics": [
                                    {
                                        "name": "in_flight_tokens",
                                        "target": 40000
                                    }
                                ]
                            }
                        ],
                        "title": "Additional Autoscaling Config"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-defined metadata for the deployment",
                        "examples": [
                            {
                                "environment": "production",
                                "git_sha": "abc123"
                            }
                        ],
                        "title": "Metadata"
                    },
                    "weights": {
                        "anyOf": [
                            {
                                "items": {
                                    "additionalProperties": true,
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Weight configurations for BDN model weight distribution",
                        "examples": [
                            [
                                {
                                    "mount_location": "/models/base",
                                    "source": "hf://meta-llama/Llama-3-8B"
                                }
                            ]
                        ],
                        "title": "Weights"
                    },
                    "name": {
                        "description": "Name of the model",
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "resources",
                    "name"
                ],
                "title": "CreateLLMModelRequestV1",
                "type": "object"
            },
            "LLMModelHandleV1": {
                "description": "Handle for a BIS-LLM model deployment.",
                "properties": {
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "version_id": {
                        "description": "Unique identifier of the model version",
                        "title": "Version Id",
                        "type": "string"
                    },
                    "hostname": {
                        "description": "Hostname used to invoke the model",
                        "title": "Hostname",
                        "type": "string"
                    },
                    "instance_type_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the instance type the model deployment is running on",
                        "title": "Instance Type Name"
                    }
                },
                "required": [
                    "model_id",
                    "version_id",
                    "hostname"
                ],
                "title": "LLMModelHandleV1",
                "type": "object"
            },
            "CreateLLMModelVersionRequestV1": {
                "description": "A request to create a BIS-LLM model version",
                "properties": {
                    "resources": {
                        "additionalProperties": true,
                        "description": "Resources allocated to the model",
                        "title": "Resources",
                        "type": "object"
                    },
                    "region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Region in which to deploy the model",
                        "title": "Region"
                    },
                    "llm_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Version of the helm chart to use.",
                        "title": "Llm Version"
                    },
                    "llm_config": {
                        "additionalProperties": true,
                        "description": "Configuration specific to the LLM model",
                        "title": "Llm Config",
                        "type": "object"
                    },
                    "environment_variables": {
                        "additionalProperties": true,
                        "description": "Environment variables for the model",
                        "title": "Environment Variables",
                        "type": "object"
                    },
                    "model_metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model metadata persisted into model_config",
                        "title": "Model Metadata"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the model",
                        "examples": [
                            {
                                "autoscaling_window": 600,
                                "concurrency_target": null,
                                "max_replica": 5,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 300,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "additional_autoscaling_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Additional autoscaling configuration (e.g. target in-flight tokens)",
                        "examples": [
                            {
                                "metrics": [
                                    {
                                        "name": "in_flight_tokens",
                                        "target": 40000
                                    }
                                ]
                            }
                        ],
                        "title": "Additional Autoscaling Config"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-defined metadata for the deployment",
                        "examples": [
                            {
                                "environment": "production",
                                "git_sha": "abc123"
                            }
                        ],
                        "title": "Metadata"
                    },
                    "weights": {
                        "anyOf": [
                            {
                                "items": {
                                    "additionalProperties": true,
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Weight configurations for BDN model weight distribution",
                        "examples": [
                            [
                                {
                                    "mount_location": "/models/base",
                                    "source": "hf://meta-llama/Llama-3-8B"
                                }
                            ]
                        ],
                        "title": "Weights"
                    }
                },
                "required": [
                    "resources"
                ],
                "title": "CreateLLMModelVersionRequestV1",
                "type": "object"
            },
            "LibraryListingMetadataV1": {
                "properties": {
                    "parameter_count": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Parameter Count"
                    },
                    "context_length": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Context Length"
                    },
                    "input_modalities": {
                        "default": [
                            "text"
                        ],
                        "items": {
                            "$ref": "#/components/schemas/LibraryListingModality"
                        },
                        "title": "Input Modalities",
                        "type": "array"
                    },
                    "output_modalities": {
                        "default": [
                            "text"
                        ],
                        "items": {
                            "$ref": "#/components/schemas/LibraryListingModality"
                        },
                        "title": "Output Modalities",
                        "type": "array"
                    },
                    "license": {
                        "title": "License",
                        "type": "string"
                    },
                    "variant": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Variant"
                    },
                    "publisher": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Publisher"
                    },
                    "model_api_slug": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Model Api Slug"
                    },
                    "release_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Release Date"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Description"
                    },
                    "trending": {
                        "default": false,
                        "title": "Trending",
                        "type": "boolean"
                    }
                },
                "required": [
                    "license"
                ],
                "title": "LibraryListingMetadataV1",
                "type": "object"
            },
            "LibraryListingModality": {
                "enum": [
                    "text",
                    "image",
                    "audio",
                    "video",
                    "embedding",
                    "rerank"
                ],
                "title": "LibraryListingModality",
                "type": "string"
            },
            "LibraryListingV1": {
                "description": "A library listing.",
                "properties": {
                    "display_name": {
                        "description": "Display name of the library listing",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "user_defined_id": {
                        "description": "User-defined identifier of the library listing",
                        "title": "User Defined Id",
                        "type": "string"
                    },
                    "is_public": {
                        "description": "Whether the listing is publicly accessible",
                        "title": "Is Public",
                        "type": "boolean"
                    },
                    "trending": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Whether the listing is trending",
                        "title": "Trending"
                    },
                    "closed_source": {
                        "description": "Whether the listing is closed source (deployers cannot view or download the Truss, and forks copy mirrored weights instead of re-mirroring from upstream)",
                        "title": "Closed Source",
                        "type": "boolean"
                    },
                    "created_at": {
                        "description": "Time the listing was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "modified_at": {
                        "description": "Time the listing was last modified",
                        "format": "date-time",
                        "title": "Modified At",
                        "type": "string"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LibraryListingMetadataV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model-level metadata for this listing, if it has been uploaded."
                    }
                },
                "required": [
                    "display_name",
                    "user_defined_id",
                    "is_public",
                    "trending",
                    "closed_source",
                    "created_at",
                    "modified_at"
                ],
                "title": "LibraryListingV1",
                "type": "object"
            },
            "LibraryListingsV1": {
                "description": "A list of library listings.",
                "properties": {
                    "listings": {
                        "items": {
                            "$ref": "#/components/schemas/LibraryListingV1"
                        },
                        "title": "Listings",
                        "type": "array"
                    }
                },
                "required": [
                    "listings"
                ],
                "title": "LibraryListingsV1",
                "type": "object"
            },
            "CreateLibraryListingRequestV1": {
                "description": "Request to create a new library listing.",
                "properties": {
                    "display_name": {
                        "description": "Display name of the library listing",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "user_defined_id": {
                        "description": "User-defined identifier of the library listing",
                        "title": "User Defined Id",
                        "type": "string"
                    },
                    "is_public": {
                        "default": false,
                        "description": "Whether the listing is publicly accessible",
                        "title": "Is Public",
                        "type": "boolean"
                    },
                    "closed_source": {
                        "default": false,
                        "description": "Whether the listing is closed source (deployers cannot view or download the Truss, and forks copy mirrored weights instead of re-mirroring from upstream)",
                        "title": "Closed Source",
                        "type": "boolean"
                    }
                },
                "required": [
                    "display_name",
                    "user_defined_id"
                ],
                "title": "CreateLibraryListingRequestV1",
                "type": "object"
            },
            "LibraryListingTombstoneV1": {
                "description": "A library listing tombstone.",
                "properties": {
                    "user_defined_id": {
                        "description": "User-defined identifier of the library listing",
                        "title": "User Defined Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the library listing was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "user_defined_id",
                    "deleted"
                ],
                "title": "LibraryListingTombstoneV1",
                "type": "object"
            },
            "UpdateLibraryListingRequestV1": {
                "description": "Request to update a library listing.",
                "properties": {
                    "display_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New display name for the library listing",
                        "title": "Display Name"
                    },
                    "is_public": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether the listing is publicly accessible",
                        "title": "Is Public"
                    },
                    "trending": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether the listing is trending",
                        "title": "Trending"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LibraryListingMetadataV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model-level metadata for the listing. When provided, replaces the stored metadata."
                    }
                },
                "title": "UpdateLibraryListingRequestV1",
                "type": "object"
            },
            "BenchmarkSnapshotV1": {
                "properties": {
                    "run_id": {
                        "title": "Run Id",
                        "type": "string"
                    },
                    "measured_at": {
                        "format": "date",
                        "title": "Measured At",
                        "type": "string"
                    },
                    "llm": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LLMBenchmarkMetricsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null
                    },
                    "tts": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TTSBenchmarkMetricsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null
                    },
                    "embedding": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/EmbeddingBenchmarkMetricsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null
                    },
                    "replicas": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 2,
                        "title": "Replicas"
                    },
                    "profile": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": "512x256",
                        "title": "Profile"
                    }
                },
                "required": [
                    "run_id",
                    "measured_at"
                ],
                "title": "BenchmarkSnapshotV1",
                "type": "object"
            },
            "EmbeddingBenchmarkMetricsV1": {
                "properties": {
                    "e2e_latency_ms_p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "E2E Latency Ms P50"
                    },
                    "e2e_latency_ms_p99": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "E2E Latency Ms P99"
                    },
                    "input_tokens_per_sec": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Input Tokens Per Sec"
                    },
                    "requests_per_sec": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Requests Per Sec"
                    }
                },
                "title": "EmbeddingBenchmarkMetricsV1",
                "type": "object"
            },
            "LLMBenchmarkMetricsV1": {
                "properties": {
                    "ttft_ms_p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Ttft Ms P50"
                    },
                    "output_tokens_per_sec_per_user_p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Output Tokens Per Sec Per User P50"
                    },
                    "max_concurrent_users_at_50ms_tpot": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Max Concurrent Users At 50Ms Tpot"
                    },
                    "requests_per_sec_p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Requests Per Sec P50"
                    },
                    "cost_per_1m_tokens_usd": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Cost Per 1M Tokens Usd"
                    }
                },
                "title": "LLMBenchmarkMetricsV1",
                "type": "object"
            },
            "LibraryListingVersionV1": {
                "description": "A library listing version.",
                "properties": {
                    "version_tag": {
                        "description": "Human-readable tag for this version",
                        "title": "Version Tag",
                        "type": "string"
                    },
                    "is_live": {
                        "description": "Whether this version is the live version",
                        "title": "Is Live",
                        "type": "boolean"
                    },
                    "allow_truss_download": {
                        "description": "Whether users deploying this model can download the Truss",
                        "title": "Allow Truss Download",
                        "type": "boolean"
                    },
                    "oracle_version_id": {
                        "description": "Id of the source model version",
                        "title": "Oracle Version Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the version was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "modified_at": {
                        "description": "Time the version was last modified",
                        "format": "date-time",
                        "title": "Modified At",
                        "type": "string"
                    },
                    "benchmark": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/BenchmarkSnapshotV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Benchmark snapshot for this version, if one has been uploaded."
                    }
                },
                "required": [
                    "version_tag",
                    "is_live",
                    "allow_truss_download",
                    "oracle_version_id",
                    "created_at",
                    "modified_at"
                ],
                "title": "LibraryListingVersionV1",
                "type": "object"
            },
            "TTSBenchmarkMetricsV1": {
                "properties": {
                    "ttft_ms_p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Ttft Ms P50"
                    },
                    "max_concurrent_streams_at_rtf1": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Max Concurrent Streams At Rtf1"
                    },
                    "ttft_ms_p50_at_max_concurrency": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Ttft Ms P50 At Max Concurrency"
                    },
                    "cost_per_audio_minute_usd": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Cost Per Audio Minute Usd"
                    }
                },
                "title": "TTSBenchmarkMetricsV1",
                "type": "object"
            },
            "LibraryListingVersionsV1": {
                "description": "A list of library listing versions.",
                "properties": {
                    "versions": {
                        "items": {
                            "$ref": "#/components/schemas/LibraryListingVersionV1"
                        },
                        "title": "Versions",
                        "type": "array"
                    }
                },
                "required": [
                    "versions"
                ],
                "title": "LibraryListingVersionsV1",
                "type": "object"
            },
            "CreateLibraryListingVersionRequestV1": {
                "description": "Request to create a new library listing version from an existing model version.",
                "properties": {
                    "display_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the library listing. Required when creating a new listing.",
                        "title": "Display Name"
                    },
                    "is_public": {
                        "default": false,
                        "description": "Whether the listing is publicly accessible. Only used when creating a new listing.",
                        "title": "Is Public",
                        "type": "boolean"
                    },
                    "oracle_version_id": {
                        "description": "Id of the source model version to publish",
                        "title": "Oracle Version Id",
                        "type": "string"
                    },
                    "allow_truss_download": {
                        "default": false,
                        "description": "Whether users deploying this model can download the Truss",
                        "title": "Allow Truss Download",
                        "type": "boolean"
                    },
                    "closed_source": {
                        "default": false,
                        "description": "Whether the listing is closed source (deployers cannot view or download the Truss, and forks copy mirrored weights instead of re-mirroring from upstream). Only used when creating a new listing.",
                        "title": "Closed Source",
                        "type": "boolean"
                    },
                    "version_tag": {
                        "description": "Human-readable tag for this version",
                        "title": "Version Tag",
                        "type": "string"
                    }
                },
                "required": [
                    "oracle_version_id",
                    "version_tag"
                ],
                "title": "CreateLibraryListingVersionRequestV1",
                "type": "object"
            },
            "LibraryListingVersionTombstoneV1": {
                "description": "A library listing version tombstone.",
                "properties": {
                    "version_tag": {
                        "description": "Human-readable tag for this version",
                        "title": "Version Tag",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the library listing version was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "version_tag",
                    "deleted"
                ],
                "title": "LibraryListingVersionTombstoneV1",
                "type": "object"
            },
            "UpdateLibraryListingVersionRequestV1": {
                "description": "Request to update a library listing version.",
                "properties": {
                    "is_live": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether this version should be the live version. Setting to true demotes the current live version.",
                        "title": "Is Live"
                    },
                    "allow_truss_download": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether users deploying this model can download the Truss",
                        "title": "Allow Truss Download"
                    },
                    "benchmark": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/BenchmarkSnapshotV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Benchmark snapshot for this version. When provided, replaces the stored benchmark."
                    }
                },
                "title": "UpdateLibraryListingVersionRequestV1",
                "type": "object"
            },
            "ModelApisCostBucketV1": {
                "description": "One daily bucket and the costs attributed to it.",
                "properties": {
                    "date": {
                        "description": "UTC calendar date for this bucket, from midnight inclusive to the next midnight exclusive.",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "results": {
                        "description": "Cost totals for the observed combinations of requested dimensions in this bucket, ordered by those dimensions. Empty when the day has no matching usage.",
                        "items": {
                            "$ref": "#/components/schemas/ModelApisCostResultV1"
                        },
                        "title": "Results",
                        "type": "array"
                    }
                },
                "required": [
                    "date"
                ],
                "title": "ModelApisCostBucketV1",
                "type": "object"
            },
            "ModelApisCostResultV1": {
                "properties": {
                    "api_key_prefixes": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The single attributed API key prefix for this result. Null when not grouping by api_key_prefix or when attribution is unavailable.",
                        "title": "Api Key Prefixes"
                    },
                    "user_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Attributed user ID. Null when not grouping by user or when attribution is unavailable.",
                        "title": "User Id"
                    },
                    "model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model identifier. Null when not grouping by model.",
                        "title": "Model"
                    },
                    "service_tier": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Service tier. Null when not grouping by service_tier or when attribution is unavailable.",
                        "title": "Service Tier"
                    },
                    "subtotal": {
                        "description": "Model API cost in USD for this day and grouping combination, returned as an exact decimal string preserving fractional-cent amounts. This amount may differ from finalized invoice amounts.",
                        "examples": [
                            "0.00000123"
                        ],
                        "title": "Subtotal",
                        "type": "string"
                    }
                },
                "required": [
                    "subtotal"
                ],
                "title": "ModelApisCostResultV1",
                "type": "object"
            },
            "ModelApisCostsResponseV1": {
                "description": "One non-overlapping bucket per UTC day, ordered oldest first with no gaps.\n\nDays without matching usage are included with an empty results list.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/ModelApisCostBucketV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ModelApisCostsResponseV1",
                "type": "object"
            },
            "ModelApiCostDimensionV1": {
                "enum": [
                    "api_key_prefix",
                    "user",
                    "model",
                    "service_tier"
                ],
                "title": "ModelApiCostDimensionV1",
                "type": "string"
            },
            "ModelApisCostsRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 7,
                        "description": "Number of daily cost buckets to return. Defaults to 7; maximum 31.",
                        "maximum": 31,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "start_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Inclusive UTC calendar day at the start of the query range. Defaults to the previous UTC date, cannot be before 2026-08-05, and is ignored when you pass a cursor.",
                        "title": "Start Date"
                    },
                    "end_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included. The date range cannot exceed 90 days.",
                        "title": "End Date"
                    },
                    "group_by": {
                        "description": "Dimensions to break costs down by, repeated once per dimension: api_key_prefix, user, model, or service_tier. Each result represents one observed combination of the requested dimensions within that day. For example, grouping by api_key_prefix and user returns each API-key and user pair that had usage. Combinations without usage are omitted, so result counts can differ between days. Omit for daily organization totals.",
                        "items": {
                            "$ref": "#/components/schemas/ModelApiCostDimensionV1"
                        },
                        "title": "Group By",
                        "type": "array"
                    },
                    "api_key_prefixes": {
                        "description": "Return only costs for these exact API key prefixes, repeated once per prefix.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Api Key Prefixes",
                        "type": "array"
                    },
                    "user_ids": {
                        "description": "Return only costs attributed to these exact user IDs, repeated once per ID.",
                        "items": {
                            "type": "string"
                        },
                        "title": "User Ids",
                        "type": "array"
                    },
                    "models": {
                        "description": "Return only costs for these exact model identifiers, repeated once per model.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Models",
                        "type": "array"
                    },
                    "service_tiers": {
                        "description": "Return only costs for these exact service tiers, repeated once per tier.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Service Tiers",
                        "type": "array"
                    }
                },
                "title": "ModelApisCostsRequestV1",
                "type": "object"
            },
            "BillableResourceV1": {
                "properties": {
                    "id": {
                        "description": "Unique identifier of the resource",
                        "title": "Id",
                        "type": "string"
                    },
                    "kind": {
                        "$ref": "#/components/schemas/ResourceKind",
                        "description": "Resource kind (MODEL_DEPLOYMENT, CHAINLET, TRAINING_JOB, LOOPS_TRAINER, or LOOPS_SAMPLER)"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the resource",
                        "title": "Name"
                    },
                    "model_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Unique identifier of the parent model for model deployments and chainlets",
                        "title": "Model Id"
                    },
                    "model_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the parent resource (e.g., model name for model deployments, training project name for training jobs)",
                        "title": "Model Name"
                    },
                    "is_deleted": {
                        "description": "Indicates if the resource has been deleted",
                        "title": "Is Deleted",
                        "type": "boolean"
                    },
                    "instance_type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Instance type used",
                        "title": "Instance Type"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Base model used by this Loops trainer or sampler",
                        "title": "Base Model"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Environment name (e.g., 'production', 'staging')",
                        "title": "Environment Name"
                    },
                    "chain_metadata": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainMetadataV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Chain metadata if this is a chainlet deployment"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Unique identifier of the team that owns the resource. Only present for organizations with multiple teams enabled.",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the team that owns the resource. Only present for organizations with multiple teams enabled.",
                        "title": "Team Name"
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "is_deleted"
                ],
                "title": "BillableResourceV1",
                "type": "object"
            },
            "ChainMetadataV1": {
                "properties": {
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "chain_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the chain",
                        "title": "Chain Name"
                    },
                    "chain_deployment_id": {
                        "description": "Unique identifier of the chain deployment",
                        "title": "Chain Deployment Id",
                        "type": "string"
                    }
                },
                "required": [
                    "chain_id",
                    "chain_deployment_id"
                ],
                "title": "ChainMetadataV1",
                "type": "object"
            },
            "DailyDedicatedUsageV1": {
                "properties": {
                    "date": {
                        "description": "Date of the usage",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost incurred on this date in dollars",
                        "title": "Subtotal"
                    },
                    "compute_cost": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Compute cost incurred on this date in dollars",
                        "title": "Compute Cost"
                    },
                    "surcharge_cost": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Model distribution surcharge incurred on this date in dollars",
                        "title": "Surcharge Cost"
                    },
                    "minutes": {
                        "description": "Minutes used on this date",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "inference_requests": {
                        "description": "Number of inference requests on this date",
                        "title": "Inference Requests",
                        "type": "integer"
                    }
                },
                "required": [
                    "date",
                    "subtotal",
                    "compute_cost",
                    "surcharge_cost",
                    "minutes",
                    "inference_requests"
                ],
                "title": "DailyDedicatedUsageV1",
                "type": "object"
            },
            "DailyModelApiUsageV1": {
                "properties": {
                    "date": {
                        "description": "Date of the usage",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost incurred on this date in dollars",
                        "title": "Subtotal"
                    },
                    "input_tokens": {
                        "description": "Number of input tokens on this date",
                        "title": "Input Tokens",
                        "type": "integer"
                    },
                    "output_tokens": {
                        "description": "Number of output tokens on this date",
                        "title": "Output Tokens",
                        "type": "integer"
                    },
                    "cached_input_tokens": {
                        "description": "Number of cached input tokens on this date",
                        "title": "Cached Input Tokens",
                        "type": "integer"
                    }
                },
                "required": [
                    "date",
                    "subtotal",
                    "input_tokens",
                    "output_tokens",
                    "cached_input_tokens"
                ],
                "title": "DailyModelApiUsageV1",
                "type": "object"
            },
            "DailyTrainingUsageV1": {
                "properties": {
                    "date": {
                        "description": "Date of the usage",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost incurred on this date in dollars",
                        "title": "Subtotal"
                    },
                    "minutes": {
                        "description": "Minutes used on this date",
                        "title": "Minutes",
                        "type": "integer"
                    }
                },
                "required": [
                    "date",
                    "subtotal",
                    "minutes"
                ],
                "title": "DailyTrainingUsageV1",
                "type": "object"
            },
            "DedicatedItemV1": {
                "properties": {
                    "billable_resource": {
                        "$ref": "#/components/schemas/BillableResourceV1",
                        "description": "The model deployment resource"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars for this billable resource",
                        "title": "Subtotal"
                    },
                    "compute_cost": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Compute cost in dollars for this billable resource",
                        "title": "Compute Cost"
                    },
                    "surcharge_cost": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Model distribution surcharge in dollars for this billable resource",
                        "title": "Surcharge Cost"
                    },
                    "minutes": {
                        "description": "Total minutes used for this billable resource",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "inference_requests": {
                        "description": "Total inference requests for this billable resource",
                        "title": "Inference Requests",
                        "type": "integer"
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyDedicatedUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    }
                },
                "required": [
                    "billable_resource",
                    "subtotal",
                    "compute_cost",
                    "surcharge_cost",
                    "minutes",
                    "inference_requests"
                ],
                "title": "DedicatedItemV1",
                "type": "object"
            },
            "DedicatedUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars after applying credits used",
                        "title": "Subtotal"
                    },
                    "credits_used": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Credits applied in dollars",
                        "title": "Credits Used"
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Total cost in dollars",
                        "title": "Total"
                    },
                    "minutes": {
                        "description": "Total minutes used",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "breakdown": {
                        "description": "Per-deployment usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DedicatedItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total",
                    "minutes"
                ],
                "title": "DedicatedUsageV1",
                "type": "object"
            },
            "ModelApiItemV1": {
                "properties": {
                    "model_name": {
                        "description": "Model name",
                        "title": "Model Name",
                        "type": "string"
                    },
                    "model_family": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model family (e.g., Meta, DeepSeek)",
                        "title": "Model Family"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars for this model",
                        "title": "Subtotal"
                    },
                    "input_tokens": {
                        "description": "Total input tokens for this model",
                        "title": "Input Tokens",
                        "type": "integer"
                    },
                    "output_tokens": {
                        "description": "Total output tokens for this model",
                        "title": "Output Tokens",
                        "type": "integer"
                    },
                    "cached_input_tokens": {
                        "description": "Total cached input tokens for this model",
                        "title": "Cached Input Tokens",
                        "type": "integer"
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyModelApiUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    }
                },
                "required": [
                    "model_name",
                    "subtotal",
                    "input_tokens",
                    "output_tokens",
                    "cached_input_tokens"
                ],
                "title": "ModelApiItemV1",
                "type": "object"
            },
            "ModelApisUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars after applying credits used",
                        "title": "Subtotal"
                    },
                    "credits_used": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Credits applied in dollars",
                        "title": "Credits Used"
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Total cost in dollars",
                        "title": "Total"
                    },
                    "breakdown": {
                        "description": "Per-model usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/ModelApiItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total"
                ],
                "title": "ModelApisUsageV1",
                "type": "object"
            },
            "ResourceKind": {
                "enum": [
                    "LOOPS_SAMPLER",
                    "LOOPS_TRAINER",
                    "MODEL_DEPLOYMENT",
                    "TRAINING_JOB",
                    "CHAINLET"
                ],
                "title": "ResourceKind",
                "type": "string"
            },
            "TrainingItemV1": {
                "properties": {
                    "billable_resource": {
                        "$ref": "#/components/schemas/BillableResourceV1",
                        "description": "The training job resource"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars for this billable resource",
                        "title": "Subtotal"
                    },
                    "minutes": {
                        "description": "Total minutes used for this billable resource",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyTrainingUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    }
                },
                "required": [
                    "billable_resource",
                    "subtotal",
                    "minutes"
                ],
                "title": "TrainingItemV1",
                "type": "object"
            },
            "TrainingUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars after applying credits used",
                        "title": "Subtotal"
                    },
                    "credits_used": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Credits applied in dollars",
                        "title": "Credits Used"
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Total cost in dollars",
                        "title": "Total"
                    },
                    "minutes": {
                        "description": "Total minutes used",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "breakdown": {
                        "description": "Per-job usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/TrainingItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total",
                    "minutes"
                ],
                "title": "TrainingUsageV1",
                "type": "object"
            },
            "UsageSummaryV1": {
                "description": "Billing usage summary for the requested date range.",
                "properties": {
                    "dedicated_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DedicatedUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Dedicated model serving usage"
                    },
                    "training_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Training usage"
                    },
                    "model_apis_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ModelApisUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model APIs usage"
                    }
                },
                "title": "UsageSummaryV1",
                "type": "object"
            },
            "UsageSummaryRequestV1": {
                "properties": {
                    "start_date": {
                        "description": "Start date (ISO 8601, UTC). Earliest queryable: 2026-01-01.",
                        "format": "date-time",
                        "title": "Start Date",
                        "type": "string"
                    },
                    "end_date": {
                        "description": "End date in ISO 8601 format (UTC). Date range cannot exceed 31 days.",
                        "format": "date-time",
                        "title": "End Date",
                        "type": "string"
                    }
                },
                "required": [
                    "start_date",
                    "end_date"
                ],
                "title": "UsageSummaryRequestV1",
                "type": "object"
            },
            "ToolCallUsageBucketV1": {
                "description": "Server-side tool call usage for one day, provider, charge unit, and model.",
                "properties": {
                    "date": {
                        "description": "UTC day the usage was recorded on.",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "provider": {
                        "description": "Tool provider, such as exa or parallel.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "sku": {
                        "description": "Charge unit, as `<provider>/<unit>`. The unit is what the provider reported, or the tool name when it reported none. Its meaning varies by provider.",
                        "title": "Sku",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model that made the tool calls.",
                        "title": "Model",
                        "type": "string"
                    },
                    "calls": {
                        "description": "Number of tool calls.",
                        "title": "Calls",
                        "type": "integer"
                    },
                    "quantity": {
                        "description": "Billable quantity in the provider's sku unit, summed over the calls.",
                        "title": "Quantity",
                        "type": "number"
                    }
                },
                "required": [
                    "date",
                    "provider",
                    "sku",
                    "model",
                    "calls",
                    "quantity"
                ],
                "title": "ToolCallUsageBucketV1",
                "type": "object"
            },
            "ToolCallUsageResponseV1": {
                "description": "Daily server-side tool call usage, ordered by day, provider, sku, and model.",
                "properties": {
                    "items": {
                        "items": {
                            "$ref": "#/components/schemas/ToolCallUsageBucketV1"
                        },
                        "title": "Items",
                        "type": "array"
                    }
                },
                "title": "ToolCallUsageResponseV1",
                "type": "object"
            },
            "ToolCallUsageRequestV1": {
                "properties": {
                    "start_date": {
                        "description": "Inclusive UTC calendar day at the start of the query range.",
                        "format": "date",
                        "title": "Start Date",
                        "type": "string"
                    },
                    "end_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included. The date range cannot exceed 90 days.",
                        "title": "End Date"
                    }
                },
                "required": [
                    "start_date"
                ],
                "title": "ToolCallUsageRequestV1",
                "type": "object"
            },
            "UserInfoV1": {
                "description": "A Baseten user.",
                "properties": {
                    "user_id": {
                        "description": "Unique identifier for the user",
                        "title": "User Id",
                        "type": "string"
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Email address of the user",
                        "title": "Email"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the user",
                        "title": "Name"
                    },
                    "workspace_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the user's workspace",
                        "title": "Workspace Name"
                    }
                },
                "required": [
                    "user_id"
                ],
                "title": "UserInfoV1",
                "type": "object"
            },
            "UsersResponseV1": {
                "description": "A page of users in the caller's workspace.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/UserInfoV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "UsersResponseV1",
                "type": "object"
            },
            "UsersRequestV1": {
                "description": "Request parameters for listing users.",
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When set, returns only users with this exact email, if any.",
                        "title": "Email"
                    }
                },
                "title": "UsersRequestV1",
                "type": "object"
            },
            "AwsAssumeRoleV1": {
                "description": "AWS AssumeRole trust-policy inputs for the organization.",
                "properties": {
                    "baseten_role_arn": {
                        "description": "Baseten role ARN to allow in an IAM role's trust policy",
                        "title": "Baseten Role Arn",
                        "type": "string"
                    },
                    "external_id": {
                        "description": "sts:ExternalId Baseten presents when assuming the role",
                        "title": "External Id",
                        "type": "string"
                    }
                },
                "required": [
                    "baseten_role_arn",
                    "external_id"
                ],
                "title": "AwsAssumeRoleV1",
                "type": "object"
            },
            "OrganizationInfoV1": {
                "description": "The caller's organization.",
                "properties": {
                    "org_id": {
                        "description": "Unique identifier for the organization",
                        "title": "Org Id",
                        "type": "string"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the organization",
                        "title": "Name"
                    },
                    "created_at": {
                        "description": "Time the organization was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "aws_assume_role": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AwsAssumeRoleV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS AssumeRole trust-policy inputs; null while the method is not enabled for the organization"
                    }
                },
                "required": [
                    "org_id",
                    "created_at"
                ],
                "title": "OrganizationInfoV1",
                "type": "object"
            },
            "GatewayEventTokensV1": {
                "properties": {
                    "inputTokens": {
                        "description": "Cached and uncached input tokens.",
                        "title": "Inputtokens",
                        "type": "integer"
                    },
                    "outputTokens": {
                        "description": "Output tokens.",
                        "title": "Outputtokens",
                        "type": "integer"
                    },
                    "cachedInputTokens": {
                        "description": "Cached input tokens.",
                        "title": "Cachedinputtokens",
                        "type": "integer"
                    }
                },
                "required": [
                    "inputTokens",
                    "outputTokens",
                    "cachedInputTokens"
                ],
                "title": "GatewayEventTokensV1",
                "type": "object"
            },
            "GatewayEventV1": {
                "properties": {
                    "type": {
                        "default": "API_BILLING_USAGE",
                        "description": "Event type.",
                        "title": "Type",
                        "type": "string"
                    },
                    "idempotencyKey": {
                        "description": "Deduplication key.",
                        "title": "Idempotencykey",
                        "type": "string"
                    },
                    "timestamp": {
                        "description": "Billing event time (ISO 8601, UTC).",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "requestId": {
                        "description": "Inference request ID.",
                        "title": "Requestid",
                        "type": "string"
                    },
                    "modelSlug": {
                        "description": "Served model.",
                        "title": "Modelslug",
                        "type": "string"
                    },
                    "externalEntityId": {
                        "description": "Calling group's external ID.",
                        "title": "Externalentityid",
                        "type": "string"
                    },
                    "apiKeyPrefix": {
                        "description": "API key prefix.",
                        "title": "Apikeyprefix",
                        "type": "string"
                    },
                    "tokens": {
                        "$ref": "#/components/schemas/GatewayEventTokensV1"
                    }
                },
                "required": [
                    "idempotencyKey",
                    "timestamp",
                    "requestId",
                    "modelSlug",
                    "externalEntityId",
                    "apiKeyPrefix",
                    "tokens"
                ],
                "title": "GatewayEventV1",
                "type": "object"
            },
            "GatewayEventsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GatewayEventV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GatewayEventsResponseV1",
                "type": "object"
            },
            "GatewayEventsRequestV1": {
                "properties": {
                    "start_time": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Inclusive start (ISO 8601, UTC). Required without a cursor.",
                        "title": "Start Time"
                    },
                    "end_time": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exclusive end (ISO 8601, UTC). Defaults to now.",
                        "title": "End Time"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Max events. Default 100, max 1000.",
                        "title": "Limit"
                    },
                    "api_keys": {
                        "description": "Return only events for these API key prefixes, repeated once per prefix.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Api Keys",
                        "type": "array"
                    },
                    "external_entity_ids": {
                        "description": "Return only events for these external entity IDs, repeated once per ID.",
                        "items": {
                            "type": "string"
                        },
                        "title": "External Entity Ids",
                        "type": "array"
                    },
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Next-page cursor. Other parameters are ignored.",
                        "title": "Cursor"
                    }
                },
                "title": "GatewayEventsRequestV1",
                "type": "object"
            },
            "ExploreCostV1": {
                "properties": {
                    "input": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M input tokens, when available.",
                        "title": "Input"
                    },
                    "output": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M output tokens, when available.",
                        "title": "Output"
                    },
                    "cache_read": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M input tokens read from cache, when available.",
                        "title": "Cache Read"
                    },
                    "cache_write": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M input tokens written to cache, when available.",
                        "title": "Cache Write"
                    },
                    "long_context": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ExploreCostValuesV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Prices for long-context requests, when the provider tiers by context length."
                    }
                },
                "title": "ExploreCostV1",
                "type": "object"
            },
            "ExploreCostValuesV1": {
                "properties": {
                    "input": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M input tokens, when available.",
                        "title": "Input"
                    },
                    "output": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M output tokens, when available.",
                        "title": "Output"
                    },
                    "cache_read": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M input tokens read from cache, when available.",
                        "title": "Cache Read"
                    },
                    "cache_write": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "USD per 1M input tokens written to cache, when available.",
                        "title": "Cache Write"
                    }
                },
                "title": "ExploreCostValuesV1",
                "type": "object"
            },
            "ExploreMetadataAPIFormatsV1": {
                "properties": {
                    "messages": {
                        "default": false,
                        "description": "Anthropic Messages API support.",
                        "title": "Messages",
                        "type": "boolean"
                    },
                    "responses": {
                        "default": false,
                        "description": "OpenAI Responses API support.",
                        "title": "Responses",
                        "type": "boolean"
                    },
                    "chat_completions": {
                        "default": false,
                        "description": "OpenAI Chat Completions API support.",
                        "title": "Chat Completions",
                        "type": "boolean"
                    }
                },
                "title": "ExploreMetadataAPIFormatsV1",
                "type": "object"
            },
            "ExploreMetadataV1": {
                "properties": {
                    "slug": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Metadata slug, e.g. 'anthropic/claude-opus-4'; null for rows without one.",
                        "title": "Slug"
                    },
                    "display_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Model display name, when available.",
                        "title": "Display Name"
                    },
                    "release_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Model release date. Month-only source dates use the first day of that month.",
                        "title": "Release Date"
                    },
                    "provider": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Provider key derived from the slug prefix, e.g. 'anthropic'; null for unprefixed slugs.",
                        "title": "Provider"
                    },
                    "context_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Total context window in tokens.",
                        "title": "Context Window"
                    },
                    "max_output_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Maximum output tokens per response.",
                        "title": "Max Output Tokens"
                    },
                    "input_modalities": {
                        "description": "Accepted input modalities.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Input Modalities",
                        "type": "array"
                    },
                    "tools": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Whether the model supports tool calling.",
                        "title": "Tools"
                    },
                    "reasoning_effort_levels": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Reasoning effort levels the model supports.",
                        "title": "Reasoning Effort Levels"
                    },
                    "parallel_tool_calls": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Whether the model supports parallel tool calls.",
                        "title": "Parallel Tool Calls"
                    },
                    "supported_api_formats": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ExploreMetadataAPIFormatsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "API formats the model supports."
                    },
                    "cost": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ExploreCostV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Provider list prices in USD per 1M tokens, when available."
                    }
                },
                "required": [
                    "slug",
                    "display_name",
                    "release_date",
                    "provider",
                    "context_window",
                    "max_output_tokens",
                    "input_modalities",
                    "tools",
                    "reasoning_effort_levels",
                    "parallel_tool_calls",
                    "supported_api_formats",
                    "cost"
                ],
                "title": "ExploreMetadataV1",
                "type": "object"
            },
            "ExploreMetadataResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/ExploreMetadataV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ExploreMetadataResponseV1",
                "type": "object"
            },
            "ExploreMetadataRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "provider": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter to a provider by slug prefix, e.g. 'anthropic'. Preserved by the cursor; if repeated, must match the original filter.",
                        "title": "Provider"
                    },
                    "q": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Case-insensitive substring search over metadata slugs. Preserved by the cursor; if repeated, must match the original filter.",
                        "title": "Q"
                    }
                },
                "title": "ExploreMetadataRequestV1",
                "type": "object"
            },
            "RouteRefV1": {
                "properties": {
                    "id": {
                        "description": "Stable route identifier.",
                        "title": "Id",
                        "type": "string"
                    },
                    "slug": {
                        "description": "Name of the route to send in the inference request's model field.",
                        "title": "Slug",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "slug"
                ],
                "title": "RouteRefV1",
                "type": "object"
            },
            "RouteTargetAnthropicV1": {
                "properties": {
                    "type": {
                        "const": "ANTHROPIC",
                        "description": "Target kind for Anthropic.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of a credential secret owned by the route's team.",
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "secret_name"
                ],
                "title": "RouteTargetAnthropicV1",
                "type": "object"
            },
            "RouteTargetBasetenModelAPIV1": {
                "properties": {
                    "type": {
                        "const": "BASETEN_MODEL_API",
                        "description": "Target kind for a Baseten Model API.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Name of the target Model API.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model"
                ],
                "title": "RouteTargetBasetenModelAPIV1",
                "type": "object"
            },
            "RouteTargetClassifierModelBasedV1": {
                "properties": {
                    "type": {
                        "const": "CLASSIFIER_MODEL_BASED",
                        "description": "Target kind for a classifier-model-based route.",
                        "title": "Type",
                        "type": "string"
                    },
                    "classifier_model_id": {
                        "description": "ID of the Baseten model that picks a route for each request.",
                        "examples": [
                            "abcd123"
                        ],
                        "title": "Classifier Model Id",
                        "type": "string"
                    },
                    "classifier_environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Environment of the classifier model. Null for production.",
                        "examples": [
                            "production"
                        ],
                        "title": "Classifier Environment Name"
                    },
                    "default_route": {
                        "$ref": "#/components/schemas/RouteRefV1",
                        "description": "Route used when the classifier picks none."
                    },
                    "allowed_routes": {
                        "description": "Routes the classifier may pick, in creation order.",
                        "items": {
                            "$ref": "#/components/schemas/RouteRefV1"
                        },
                        "title": "Allowed Routes",
                        "type": "array"
                    }
                },
                "required": [
                    "type",
                    "classifier_model_id",
                    "classifier_environment_name",
                    "default_route",
                    "allowed_routes"
                ],
                "title": "RouteTargetClassifierModelBasedV1",
                "type": "object"
            },
            "RouteTargetOpenAIV1": {
                "properties": {
                    "type": {
                        "const": "OPENAI",
                        "description": "Target kind for OpenAI.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of a credential secret owned by the route's team.",
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "secret_name"
                ],
                "title": "RouteTargetOpenAIV1",
                "type": "object"
            },
            "RouteTargetXAIV1": {
                "properties": {
                    "type": {
                        "const": "XAI",
                        "description": "Target kind for xAI.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of a credential secret owned by the route's team.",
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "secret_name"
                ],
                "title": "RouteTargetXAIV1",
                "type": "object"
            },
            "RouteV1": {
                "properties": {
                    "id": {
                        "description": "Stable route identifier.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name to send in the inference request's model field.",
                        "title": "Name",
                        "type": "string"
                    },
                    "team_id": {
                        "description": "Identifier of the owning team.",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the owning team.",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Display label, defaulting to the route name.",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "description": {
                        "description": "Short description of the route, empty when unset.",
                        "title": "Description",
                        "type": "string"
                    },
                    "target": {
                        "description": "Configured upstream target.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/RouteTargetAnthropicV1",
                                "BASETEN_MODEL_API": "#/components/schemas/RouteTargetBasetenModelAPIV1",
                                "CLASSIFIER_MODEL_BASED": "#/components/schemas/RouteTargetClassifierModelBasedV1",
                                "OPENAI": "#/components/schemas/RouteTargetOpenAIV1",
                                "XAI": "#/components/schemas/RouteTargetXAIV1"
                            },
                            "propertyName": "type"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/RouteTargetBasetenModelAPIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetXAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetClassifierModelBasedV1"
                            }
                        ],
                        "title": "Target"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ExploreMetadataV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Resolved model metadata; for a router, the envelope of its allowed routes' metadata. Null when nothing is linked."
                    },
                    "invoke_url": {
                        "description": "Base URL for inference requests using this route.",
                        "title": "Invoke Url",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Creation time, ISO 8601.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "team_id",
                    "team_name",
                    "display_name",
                    "description",
                    "target",
                    "metadata",
                    "invoke_url",
                    "created_at"
                ],
                "title": "RouteV1",
                "type": "object"
            },
            "RoutesResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/RouteV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "RoutesResponseV1",
                "type": "object"
            },
            "RoutesRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the team whose routes to list.",
                        "title": "Team Id"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by exact route name. Preserved by the cursor; if repeated, must match the original filter.",
                        "title": "Name"
                    }
                },
                "title": "RoutesRequestV1",
                "type": "object"
            },
            "RouteTargetConfigAnthropicV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "ANTHROPIC",
                        "description": "Target kind for Anthropic.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of a credential secret owned by the route's team.",
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "secret_name"
                ],
                "title": "RouteTargetConfigAnthropicV1",
                "type": "object"
            },
            "RouteTargetConfigBasetenModelAPIV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "BASETEN_MODEL_API",
                        "description": "Target kind for a Baseten Model API.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Name of the target Model API.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model"
                ],
                "title": "RouteTargetConfigBasetenModelAPIV1",
                "type": "object"
            },
            "RouteTargetConfigClassifierModelBasedV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "CLASSIFIER_MODEL_BASED",
                        "description": "Target kind for a classifier-model-based route. Not intended for general use: classifiers are deployed by Baseten's post-training team.",
                        "title": "Type",
                        "type": "string"
                    },
                    "classifier_model_id": {
                        "description": "ID of the Baseten model that picks a route for each request. Only classifiers deployed by Baseten's post-training team are supported.",
                        "examples": [
                            "abcd123"
                        ],
                        "minLength": 1,
                        "title": "Classifier Model Id",
                        "type": "string"
                    },
                    "classifier_environment_name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Environment of the classifier model. Omit for production, which is returned as null.",
                        "examples": [
                            "production"
                        ],
                        "title": "Classifier Environment Name"
                    },
                    "allowed_route_ids": {
                        "description": "IDs of the routes the classifier may pick. All must belong to the route's team and must not be routers themselves.",
                        "examples": [
                            [
                                "abc1234",
                                "def5678"
                            ]
                        ],
                        "items": {
                            "type": "string"
                        },
                        "title": "Allowed Route Ids",
                        "type": "array"
                    },
                    "default_route_id": {
                        "description": "ID of the allowed route used when the classifier picks none.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Default Route Id",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "classifier_model_id",
                    "allowed_route_ids",
                    "default_route_id"
                ],
                "title": "RouteTargetConfigClassifierModelBasedV1",
                "type": "object"
            },
            "RouteTargetConfigOpenAIV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "OPENAI",
                        "description": "Target kind for OpenAI.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of a credential secret owned by the route's team.",
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "secret_name"
                ],
                "title": "RouteTargetConfigOpenAIV1",
                "type": "object"
            },
            "RouteTargetConfigXAIV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "XAI",
                        "description": "Target kind for xAI.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of a credential secret owned by the route's team.",
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "secret_name"
                ],
                "title": "RouteTargetConfigXAIV1",
                "type": "object"
            },
            "CreateRouteRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the team that owns the route.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    },
                    "display_name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display label. Omit to use the route name; null is not accepted.",
                        "examples": [
                            "Assistant"
                        ],
                        "title": "Display Name"
                    },
                    "target": {
                        "description": "Upstream target for the route.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/RouteTargetConfigAnthropicV1",
                                "BASETEN_MODEL_API": "#/components/schemas/RouteTargetConfigBasetenModelAPIV1",
                                "CLASSIFIER_MODEL_BASED": "#/components/schemas/RouteTargetConfigClassifierModelBasedV1",
                                "OPENAI": "#/components/schemas/RouteTargetConfigOpenAIV1",
                                "XAI": "#/components/schemas/RouteTargetConfigXAIV1"
                            },
                            "propertyName": "type"
                        },
                        "examples": [
                            {
                                "model": "zai-org/GLM-5.3",
                                "type": "BASETEN_MODEL_API"
                            }
                        ],
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/RouteTargetConfigBasetenModelAPIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetConfigAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetConfigOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetConfigXAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteTargetConfigClassifierModelBasedV1"
                            }
                        ],
                        "title": "Target"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "maxLength": 1000,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Short description of the route. Omit for no description; null is not accepted.",
                        "examples": [
                            "Assistant for code review and debugging."
                        ],
                        "title": "Description"
                    }
                },
                "required": [
                    "target"
                ],
                "title": "CreateRouteRequestV1",
                "type": "object"
            },
            "RouteProviderV1": {
                "description": "Upstream provider of a route target, named like the route target types.",
                "enum": [
                    "BASETEN_MODEL_API",
                    "OPENAI",
                    "ANTHROPIC",
                    "XAI",
                    "VERTEX",
                    "OPENAI_COMPATIBLE"
                ],
                "title": "RouteProviderV1",
                "type": "string"
            },
            "RoutesUsageBucketV1": {
                "properties": {
                    "date": {
                        "description": "UTC calendar date for this bucket, from midnight inclusive to the next midnight exclusive.",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "results": {
                        "description": "Usage broken down by the requested dimensions. Empty when there is no usage.",
                        "items": {
                            "$ref": "#/components/schemas/RoutesUsageResultV1"
                        },
                        "title": "Results",
                        "type": "array"
                    }
                },
                "required": [
                    "date",
                    "results"
                ],
                "title": "RoutesUsageBucketV1",
                "type": "object"
            },
            "RoutesUsageResultV1": {
                "properties": {
                    "user_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the user who created the Routes key. Null when not grouping by USER.",
                        "title": "User Id"
                    },
                    "model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model name. For external providers, the model name sent to the provider. Null when not grouping by MODEL.",
                        "title": "Model"
                    },
                    "provider": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RouteProviderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Provider that served the requests. Null when not grouping by PROVIDER."
                    },
                    "cost_usd": {
                        "description": "Estimated cost in USD, returned as an exact decimal string. Costs for OpenAI, Anthropic, and xAI estimate what you pay those providers; they are not Baseten charges.",
                        "examples": [
                            "0.00035625"
                        ],
                        "title": "Cost Usd",
                        "type": "string"
                    },
                    "input_tokens": {
                        "description": "Input tokens, including cached input tokens.",
                        "title": "Input Tokens",
                        "type": "integer"
                    },
                    "cached_input_tokens": {
                        "description": "Input tokens read from the prompt cache.",
                        "title": "Cached Input Tokens",
                        "type": "integer"
                    },
                    "uncached_input_tokens": {
                        "description": "Input tokens not read from the prompt cache, including tokens written to the cache.",
                        "title": "Uncached Input Tokens",
                        "type": "integer"
                    },
                    "output_tokens": {
                        "description": "Output tokens.",
                        "title": "Output Tokens",
                        "type": "integer"
                    }
                },
                "required": [
                    "cost_usd",
                    "input_tokens",
                    "cached_input_tokens",
                    "uncached_input_tokens",
                    "output_tokens"
                ],
                "title": "RoutesUsageResultV1",
                "type": "object"
            },
            "RoutesUsageResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/RoutesUsageBucketV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "RoutesUsageResponseV1",
                "type": "object"
            },
            "RouteUsageDimensionV1": {
                "enum": [
                    "USER",
                    "MODEL",
                    "PROVIDER"
                ],
                "title": "RouteUsageDimensionV1",
                "type": "string"
            },
            "RoutesUsageRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 7,
                        "description": "Number of daily buckets to return. Defaults to 7; maximum 31.",
                        "maximum": 31,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "start_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Inclusive UTC calendar day at the start of the query range. Defaults to the previous UTC date, and is ignored when you pass a cursor.",
                        "title": "Start Date"
                    },
                    "end_date": {
                        "anyOf": [
                            {
                                "format": "date",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included.",
                        "title": "End Date"
                    },
                    "group_by": {
                        "description": "Dimensions to break usage down by, repeated once per dimension: USER, MODEL, or PROVIDER. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. Defaults to MODEL.",
                        "items": {
                            "$ref": "#/components/schemas/RouteUsageDimensionV1"
                        },
                        "title": "Group By",
                        "type": "array"
                    },
                    "user_ids": {
                        "description": "Return only usage from Routes keys created by these user IDs, repeated once per ID.",
                        "items": {
                            "type": "string"
                        },
                        "title": "User Ids",
                        "type": "array"
                    },
                    "models": {
                        "description": "Return only usage for these exact model names, repeated once per model.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Models",
                        "type": "array"
                    },
                    "providers": {
                        "description": "Return only usage for these providers, repeated once per provider.",
                        "items": {
                            "$ref": "#/components/schemas/RouteProviderV1"
                        },
                        "title": "Providers",
                        "type": "array"
                    }
                },
                "title": "RoutesUsageRequestV1",
                "type": "object"
            },
            "RouteEffectiveSpendLimitV1": {
                "properties": {
                    "monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Spend limit in USD enforced for the current UTC calendar month: the user's own limit, else the team default. Null when no limit applies.",
                        "examples": [
                            "200"
                        ],
                        "title": "Monthly Limit Usd"
                    },
                    "source": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RouteSettingSourceV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Where the limit comes from: `user` when it is set on the user, `team` when it is the team default. Null when no limit applies."
                    }
                },
                "required": [
                    "monthly_limit_usd",
                    "source"
                ],
                "title": "RouteEffectiveSpendLimitV1",
                "type": "object"
            },
            "RouteSettingSourceV1": {
                "enum": [
                    "user",
                    "team"
                ],
                "title": "RouteSettingSourceV1",
                "type": "string"
            },
            "RouteSpendLimitSettingV1": {
                "properties": {
                    "user_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Standing spend limit in USD for each UTC calendar month set on the user. Null when the user has no limit of their own.",
                        "examples": [
                            "200"
                        ],
                        "title": "User Monthly Limit Usd"
                    },
                    "team_default": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RouteSpendLimitTeamDefaultV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Per-member limit of the team the user's active Code key belongs to. This limit applies when the user has no limit of their own. Null when there is none."
                    },
                    "effective": {
                        "$ref": "#/components/schemas/RouteEffectiveSpendLimitV1",
                        "description": "The effective limit enforced for the current month."
                    }
                },
                "required": [
                    "user_monthly_limit_usd",
                    "team_default",
                    "effective"
                ],
                "title": "RouteSpendLimitSettingV1",
                "type": "object"
            },
            "RouteSpendLimitTeamDefaultV1": {
                "properties": {
                    "team_id": {
                        "description": "ID of the team the user's active Code key belongs to.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id",
                        "type": "string"
                    },
                    "per_member_monthly_limit_usd": {
                        "description": "The team's per-member spend limit in USD for each UTC calendar month.",
                        "examples": [
                            "100"
                        ],
                        "title": "Per Member Monthly Limit Usd",
                        "type": "string"
                    }
                },
                "required": [
                    "team_id",
                    "per_member_monthly_limit_usd"
                ],
                "title": "RouteSpendLimitTeamDefaultV1",
                "type": "object"
            },
            "RouteUserSettingsV1": {
                "properties": {
                    "user_id": {
                        "description": "ID of the user.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "User Id",
                        "type": "string"
                    },
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Email address of the user.",
                        "examples": [
                            "dev@example.com"
                        ],
                        "title": "Email"
                    },
                    "spend_limit": {
                        "$ref": "#/components/schemas/RouteSpendLimitSettingV1",
                        "description": "Spend limit for Baseten Code. Applies to requests with Routes keys the user created; personal API keys are not limited."
                    }
                },
                "required": [
                    "user_id",
                    "email",
                    "spend_limit"
                ],
                "title": "RouteUserSettingsV1",
                "type": "object"
            },
            "UpdateRouteSpendLimitSettingV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "user_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Standing spend limit in USD for each UTC calendar month. Send null to remove the limit; omit to leave it unchanged.",
                        "examples": [
                            "200"
                        ],
                        "title": "User Monthly Limit Usd",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRouteSpendLimitSettingV1",
                "type": "object"
            },
            "UpdateRouteUserSettingsRequestV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "spend_limit": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRouteSpendLimitSettingV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Spend limit fields to change. Pass null to remove the user's limit; omit to leave it unchanged.",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRouteUserSettingsRequestV1",
                "type": "object"
            },
            "BackgroundHarnessDefaultsV1": {
                "properties": {
                    "primary": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RouteHarnessModelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Route for the primary model, which new sessions use. Null when the team has no route to use."
                    },
                    "background": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RouteHarnessModelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Route for background tasks, such as session titles. Null when the team has no route to use."
                    }
                },
                "required": [
                    "primary",
                    "background"
                ],
                "title": "BackgroundHarnessDefaultsV1",
                "type": "object"
            },
            "PrimaryHarnessDefaultsV1": {
                "properties": {
                    "primary": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RouteHarnessModelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Route for the primary model, which new sessions use. Null when the team has no route to use."
                    }
                },
                "required": [
                    "primary"
                ],
                "title": "PrimaryHarnessDefaultsV1",
                "type": "object"
            },
            "RouteHarnessDefaultsV1": {
                "properties": {
                    "claude_code": {
                        "$ref": "#/components/schemas/BackgroundHarnessDefaultsV1",
                        "description": "Default models for Claude Code."
                    },
                    "opencode": {
                        "$ref": "#/components/schemas/BackgroundHarnessDefaultsV1",
                        "description": "Default models for OpenCode."
                    },
                    "codex": {
                        "$ref": "#/components/schemas/PrimaryHarnessDefaultsV1",
                        "description": "Default models for Codex."
                    },
                    "pi": {
                        "$ref": "#/components/schemas/PrimaryHarnessDefaultsV1",
                        "description": "Default models for Pi."
                    }
                },
                "required": [
                    "claude_code",
                    "opencode",
                    "codex",
                    "pi"
                ],
                "title": "RouteHarnessDefaultsV1",
                "type": "object"
            },
            "RouteHarnessModelV1": {
                "properties": {
                    "source": {
                        "$ref": "#/components/schemas/RouteSettingSourceV1",
                        "description": "Where this role's route comes from. `team` covers both a route a team admin set and the default chosen from the team's Model API routes."
                    },
                    "route": {
                        "$ref": "#/components/schemas/RouteV1",
                        "description": "Route to use for this role."
                    }
                },
                "required": [
                    "source",
                    "route"
                ],
                "title": "RouteHarnessModelV1",
                "type": "object"
            },
            "RouteTeamSpendLimitSettingV1": {
                "properties": {
                    "per_member_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Returned as an exact decimal string. Null when the team has no per-member limit.",
                        "examples": [
                            "200"
                        ],
                        "title": "Per Member Monthly Limit Usd"
                    }
                },
                "required": [
                    "per_member_monthly_limit_usd"
                ],
                "title": "RouteTeamSpendLimitSettingV1",
                "type": "object"
            },
            "RouteTeamSettingsV1": {
                "properties": {
                    "team_id": {
                        "description": "ID of the team.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id",
                        "type": "string"
                    },
                    "harness_defaults": {
                        "$ref": "#/components/schemas/RouteHarnessDefaultsV1",
                        "description": "Route for each model role of each coding harness. A role with no route set by a team admin uses the default chosen from the team's Model API routes: the recommended model for `primary` and the lowest-priced model for `background`. These defaults never use external-provider routes."
                    },
                    "spend_limit": {
                        "$ref": "#/components/schemas/RouteTeamSpendLimitSettingV1",
                        "description": "Spend limits for Baseten Code for members whose active Code key belongs to this team."
                    }
                },
                "required": [
                    "team_id",
                    "harness_defaults",
                    "spend_limit"
                ],
                "title": "RouteTeamSettingsV1",
                "type": "object"
            },
            "UpdateBackgroundHarnessModelsV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "primary": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route ID for the primary model, which new sessions use. Omit to keep the current route, or pass null to use the team's default.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Primary",
                        "x-null-distinct": true
                    },
                    "background": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route ID for background tasks, such as session titles. Omit to keep the current route, or pass null to use the team's default.",
                        "examples": [
                            "def5678"
                        ],
                        "title": "Background",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateBackgroundHarnessModelsV1",
                "type": "object"
            },
            "UpdatePrimaryHarnessModelsV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "primary": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route ID for the primary model, which new sessions use. Omit to keep the current route, or pass null to use the team's default.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Primary",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdatePrimaryHarnessModelsV1",
                "type": "object"
            },
            "UpdateRouteHarnessDefaultsV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "claude_code": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateBackgroundHarnessModelsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route IDs for the model roles to change; roles left out are unchanged. Every route must belong to the team. Pass null to clear every role, or omit to leave the harness unchanged.",
                        "x-null-distinct": true
                    },
                    "opencode": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateBackgroundHarnessModelsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route IDs for the model roles to change; roles left out are unchanged. Every route must belong to the team. Pass null to clear every role, or omit to leave the harness unchanged.",
                        "x-null-distinct": true
                    },
                    "codex": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePrimaryHarnessModelsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route IDs for the model roles to change; roles left out are unchanged. Every route must belong to the team. Pass null to clear every role, or omit to leave the harness unchanged.",
                        "x-null-distinct": true
                    },
                    "pi": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePrimaryHarnessModelsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Route IDs for the model roles to change; roles left out are unchanged. Every route must belong to the team. Pass null to clear every role, or omit to leave the harness unchanged.",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRouteHarnessDefaultsV1",
                "type": "object"
            },
            "UpdateRouteTeamSpendLimitSettingV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "per_member_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Spend limit in USD for each UTC calendar month that applies to each member whose active Code key belongs to this team, unless the member has a limit of their own. Send null to remove it; omit to leave it unchanged.",
                        "examples": [
                            "200"
                        ],
                        "title": "Per Member Monthly Limit Usd",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRouteTeamSpendLimitSettingV1",
                "type": "object"
            },
            "UpdateRouteTeamSettingsRequestV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "harness_defaults": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRouteHarnessDefaultsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Harnesses to change; harnesses left out are unchanged. Pass null to clear every harness, so each role uses the team's default.",
                        "x-null-distinct": true
                    },
                    "spend_limit": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRouteTeamSpendLimitSettingV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Spend limit fields to change. Pass null to remove the team's per-member limit; omit to leave it unchanged.",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRouteTeamSettingsRequestV1",
                "type": "object"
            },
            "RouteConnectionAnthropicV1": {
                "properties": {
                    "provider": {
                        "const": "ANTHROPIC",
                        "description": "Provider kind for Anthropic.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "description": "Identifier of the team secret holding the provider API key.",
                        "title": "Secret Id",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of the team secret holding the provider API key.",
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id",
                    "secret_name"
                ],
                "title": "RouteConnectionAnthropicV1",
                "type": "object"
            },
            "RouteConnectionOpenAIV1": {
                "properties": {
                    "provider": {
                        "const": "OPENAI",
                        "description": "Provider kind for OpenAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "description": "Identifier of the team secret holding the provider API key.",
                        "title": "Secret Id",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of the team secret holding the provider API key.",
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id",
                    "secret_name"
                ],
                "title": "RouteConnectionOpenAIV1",
                "type": "object"
            },
            "RouteConnectionV1": {
                "properties": {
                    "id": {
                        "description": "Stable connection identifier.",
                        "title": "Id",
                        "type": "string"
                    },
                    "team_id": {
                        "description": "Identifier of the team that owns the connection.",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "config": {
                        "description": "Provider the connection authenticates with, and the team secret holding its API key.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/RouteConnectionAnthropicV1",
                                "OPENAI": "#/components/schemas/RouteConnectionOpenAIV1",
                                "XAI": "#/components/schemas/RouteConnectionXAIV1"
                            },
                            "propertyName": "provider"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/RouteConnectionAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteConnectionOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteConnectionXAIV1"
                            }
                        ],
                        "title": "Config"
                    },
                    "created_at": {
                        "description": "Creation time, ISO 8601.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Last update time, ISO 8601.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "team_id",
                    "config",
                    "created_at",
                    "updated_at"
                ],
                "title": "RouteConnectionV1",
                "type": "object"
            },
            "RouteConnectionXAIV1": {
                "properties": {
                    "provider": {
                        "const": "XAI",
                        "description": "Provider kind for xAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "description": "Identifier of the team secret holding the provider API key.",
                        "title": "Secret Id",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of the team secret holding the provider API key.",
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id",
                    "secret_name"
                ],
                "title": "RouteConnectionXAIV1",
                "type": "object"
            },
            "RouteConnectionsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/RouteConnectionV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "RouteConnectionsResponseV1",
                "type": "object"
            },
            "RouteConnectionsRequestV1": {
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the team whose connections to list.",
                        "title": "Team Id"
                    }
                },
                "title": "RouteConnectionsRequestV1",
                "type": "object"
            },
            "RouteConnectionConfigAnthropicV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "ANTHROPIC",
                        "description": "Provider kind for Anthropic.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "description": "Identifier of an existing secret, owned by the same team, that holds the provider API key.",
                        "minLength": 1,
                        "title": "Secret Id",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id"
                ],
                "title": "RouteConnectionConfigAnthropicV1",
                "type": "object"
            },
            "RouteConnectionConfigOpenAIV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "OPENAI",
                        "description": "Provider kind for OpenAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "description": "Identifier of an existing secret, owned by the same team, that holds the provider API key.",
                        "minLength": 1,
                        "title": "Secret Id",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id"
                ],
                "title": "RouteConnectionConfigOpenAIV1",
                "type": "object"
            },
            "RouteConnectionConfigXAIV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "XAI",
                        "description": "Provider kind for xAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "description": "Identifier of an existing secret, owned by the same team, that holds the provider API key.",
                        "minLength": 1,
                        "title": "Secret Id",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id"
                ],
                "title": "RouteConnectionConfigXAIV1",
                "type": "object"
            },
            "CreateRouteConnectionRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the team that owns the connection.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    },
                    "config": {
                        "description": "Provider the connection authenticates with, and the team secret holding its API key.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/RouteConnectionConfigAnthropicV1",
                                "OPENAI": "#/components/schemas/RouteConnectionConfigOpenAIV1",
                                "XAI": "#/components/schemas/RouteConnectionConfigXAIV1"
                            },
                            "propertyName": "provider"
                        },
                        "examples": [
                            {
                                "provider": "ANTHROPIC",
                                "secret_id": "abc1234"
                            }
                        ],
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/RouteConnectionConfigAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteConnectionConfigOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/RouteConnectionConfigXAIV1"
                            }
                        ],
                        "title": "Config"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "CreateRouteConnectionRequestV1",
                "type": "object"
            },
            "RouteConnectionTombstoneV1": {
                "properties": {
                    "id": {
                        "description": "Stable identifier of the deleted connection.",
                        "title": "Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id"
                ],
                "title": "RouteConnectionTombstoneV1",
                "type": "object"
            },
            "UpdateRouteConnectionConfigAnthropicV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "ANTHROPIC",
                        "description": "Provider kind for Anthropic.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.",
                        "title": "Secret Id",
                        "x-null-distinct": true
                    }
                },
                "required": [
                    "provider"
                ],
                "title": "UpdateRouteConnectionConfigAnthropicV1",
                "type": "object"
            },
            "UpdateRouteConnectionConfigOpenAIV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "OPENAI",
                        "description": "Provider kind for OpenAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.",
                        "title": "Secret Id",
                        "x-null-distinct": true
                    }
                },
                "required": [
                    "provider"
                ],
                "title": "UpdateRouteConnectionConfigOpenAIV1",
                "type": "object"
            },
            "UpdateRouteConnectionConfigXAIV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "XAI",
                        "description": "Provider kind for xAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the new secret, owned by the connection's team, that holds the provider API key. Omit to keep the current secret.",
                        "title": "Secret Id",
                        "x-null-distinct": true
                    }
                },
                "required": [
                    "provider"
                ],
                "title": "UpdateRouteConnectionConfigXAIV1",
                "type": "object"
            },
            "UpdateRouteConnectionRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "config": {
                        "description": "Connection fields to change. The provider must match the connection and is immutable.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/UpdateRouteConnectionConfigAnthropicV1",
                                "OPENAI": "#/components/schemas/UpdateRouteConnectionConfigOpenAIV1",
                                "XAI": "#/components/schemas/UpdateRouteConnectionConfigXAIV1"
                            },
                            "propertyName": "provider"
                        },
                        "examples": [
                            {
                                "provider": "ANTHROPIC",
                                "secret_id": "abc1234"
                            }
                        ],
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRouteConnectionConfigAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpdateRouteConnectionConfigOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpdateRouteConnectionConfigXAIV1"
                            }
                        ],
                        "title": "Config"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "UpdateRouteConnectionRequestV1",
                "type": "object"
            },
            "RouteTombstoneV1": {
                "properties": {
                    "id": {
                        "description": "Stable identifier of the deleted route.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the deleted route.",
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name"
                ],
                "title": "RouteTombstoneV1",
                "type": "object"
            },
            "UpdateRouteRequestV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "description": {
                        "anyOf": [
                            {
                                "maxLength": 1000,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New description. Omit to keep the current description; use an empty string to clear it. Null is not accepted.",
                        "examples": [
                            "Assistant for code review and debugging."
                        ],
                        "title": "Description"
                    },
                    "display_name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New display label. Omit to keep the current label; null is not accepted.",
                        "examples": [
                            "Assistant"
                        ],
                        "title": "Display Name"
                    },
                    "target": {
                        "anyOf": [
                            {
                                "discriminator": {
                                    "mapping": {
                                        "ANTHROPIC": "#/components/schemas/RouteTargetConfigAnthropicV1",
                                        "BASETEN_MODEL_API": "#/components/schemas/RouteTargetConfigBasetenModelAPIV1",
                                        "CLASSIFIER_MODEL_BASED": "#/components/schemas/RouteTargetConfigClassifierModelBasedV1",
                                        "OPENAI": "#/components/schemas/RouteTargetConfigOpenAIV1",
                                        "XAI": "#/components/schemas/RouteTargetConfigXAIV1"
                                    },
                                    "propertyName": "type"
                                },
                                "oneOf": [
                                    {
                                        "$ref": "#/components/schemas/RouteTargetConfigBasetenModelAPIV1"
                                    },
                                    {
                                        "$ref": "#/components/schemas/RouteTargetConfigAnthropicV1"
                                    },
                                    {
                                        "$ref": "#/components/schemas/RouteTargetConfigOpenAIV1"
                                    },
                                    {
                                        "$ref": "#/components/schemas/RouteTargetConfigXAIV1"
                                    },
                                    {
                                        "$ref": "#/components/schemas/RouteTargetConfigClassifierModelBasedV1"
                                    }
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Complete new target configuration. Omit to keep the current configuration; null is not accepted. Only the CLASSIFIER_MODEL_BASED configuration of a router route is mutable.",
                        "title": "Target",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateRouteRequestV1",
                "type": "object"
            },
            "EndpointTargetV1": {
                "description": "One configured upstream target of an endpoint.",
                "properties": {
                    "provider": {
                        "$ref": "#/components/schemas/GatewayProvider",
                        "description": "Upstream provider."
                    },
                    "secret_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Referenced secret, if any.",
                        "title": "Secret Id"
                    },
                    "target_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Upstream model name, if any.",
                        "title": "Target Model"
                    },
                    "base_url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Custom OpenAI-compatible base URL, if any.",
                        "title": "Base Url"
                    },
                    "model_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Baseten model, if any.",
                        "title": "Model Id"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Baseten model environment, if non-production.",
                        "title": "Environment Name"
                    },
                    "vertex_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VertexTargetConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Google Vertex configuration, if any."
                    }
                },
                "required": [
                    "provider"
                ],
                "title": "EndpointTargetV1",
                "type": "object"
            },
            "EndpointV1": {
                "description": "A Gateway endpoint: a slug and its priority-ordered targets (index 0 tried first).",
                "properties": {
                    "id": {
                        "description": "Stable identifier for the endpoint.",
                        "title": "Id",
                        "type": "string"
                    },
                    "slug": {
                        "description": "Globally-unique routing slug.",
                        "examples": [
                            "baseten/mymodel-4"
                        ],
                        "title": "Slug",
                        "type": "string"
                    },
                    "region": {
                        "$ref": "#/components/schemas/SharedEndpointRegionV1",
                        "description": "Region this endpoint's routing serves."
                    },
                    "created_at": {
                        "description": "Creation time, ISO 8601.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Last update time, ISO 8601.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    },
                    "targets": {
                        "description": "The endpoint's upstream targets. Exactly one target is supported at this time.",
                        "items": {
                            "$ref": "#/components/schemas/EndpointTargetV1"
                        },
                        "title": "Targets",
                        "type": "array"
                    }
                },
                "required": [
                    "id",
                    "slug",
                    "region",
                    "created_at",
                    "updated_at",
                    "targets"
                ],
                "title": "EndpointV1",
                "type": "object"
            },
            "GatewayProvider": {
                "enum": [
                    "ANTHROPIC",
                    "OPENAI",
                    "XAI",
                    "BASETEN",
                    "BASETEN_MODEL_API",
                    "VERTEX",
                    "OPENAI_COMPATIBLE"
                ],
                "title": "GatewayProvider",
                "type": "string"
            },
            "SharedEndpointRegionV1": {
                "enum": [
                    "UNRESTRICTED",
                    "EU"
                ],
                "title": "SharedEndpointRegionV1",
                "type": "string"
            },
            "VertexTargetConfigV1": {
                "properties": {
                    "project_id": {
                        "description": "Google Cloud project ID or project number.",
                        "examples": [
                            "my-gcp-project",
                            "464036093014"
                        ],
                        "title": "Project Id",
                        "type": "string"
                    },
                    "location": {
                        "description": "Google Cloud location.",
                        "examples": [
                            "global"
                        ],
                        "title": "Location",
                        "type": "string"
                    }
                },
                "required": [
                    "project_id",
                    "location"
                ],
                "title": "VertexTargetConfigV1",
                "type": "object"
            },
            "EndpointsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/EndpointV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "EndpointsResponseV1",
                "type": "object"
            },
            "EndpointTargetRequestV1": {
                "description": "One desired upstream target. The customer picks a provider; Baseten owns the\nupstream host and protocol adapter.",
                "properties": {
                    "provider": {
                        "$ref": "#/components/schemas/GatewayProvider",
                        "description": "Upstream provider for this target.",
                        "examples": [
                            "ANTHROPIC",
                            "OPENAI",
                            "OPENAI_COMPATIBLE",
                            "BASETEN"
                        ]
                    },
                    "secret_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Secret holding the provider credential. Required for external providers.",
                        "examples": [
                            "3kZ9xqd"
                        ],
                        "title": "Secret Id"
                    },
                    "target_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model name to send upstream. Required for external providers and optional for BASETEN targets.",
                        "examples": [
                            "gpt-4o"
                        ],
                        "title": "Target Model"
                    },
                    "base_url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "HTTPS base URL of the upstream OpenAI-compatible server. Must not include a port. Required for and only valid with OPENAI_COMPATIBLE.",
                        "examples": [
                            "https://my-vllm.example.com"
                        ],
                        "title": "Base Url"
                    },
                    "model_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Baseten model to route to. Required for and only valid with BASETEN.",
                        "examples": [
                            "3kZ9xqd"
                        ],
                        "title": "Model Id"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Baseten model environment to route to. Only valid with BASETEN. Omit or pass `production` to target production.",
                        "examples": [
                            "staging"
                        ],
                        "title": "Environment Name"
                    },
                    "vertex_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VertexTargetConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Google Vertex configuration. Required for and only valid with VERTEX."
                    }
                },
                "required": [
                    "provider"
                ],
                "title": "EndpointTargetRequestV1",
                "type": "object"
            },
            "CreateEndpointRequestV1": {
                "properties": {
                    "slug": {
                        "description": "Globally-unique slug of the form '{org_prefix}/{name}'.",
                        "examples": [
                            "baseten/mymodel-4"
                        ],
                        "title": "Slug",
                        "type": "string"
                    },
                    "region": {
                        "$ref": "#/components/schemas/SharedEndpointRegionV1",
                        "default": "UNRESTRICTED",
                        "description": "Region the new routing serves."
                    },
                    "targets": {
                        "description": "The endpoint's upstream targets. Exactly one target is supported at this time.",
                        "examples": [
                            [
                                {
                                    "environment_name": "staging",
                                    "model_id": "3kZ9xqd",
                                    "provider": "BASETEN",
                                    "target_model": "custom/model-name"
                                }
                            ],
                            [
                                {
                                    "provider": "OPENAI",
                                    "secret_id": "3kZ9xqd",
                                    "target_model": "gpt-4o"
                                }
                            ],
                            [
                                {
                                    "base_url": "https://my-vllm.example.com",
                                    "provider": "OPENAI_COMPATIBLE",
                                    "secret_id": "3kZ9xqd",
                                    "target_model": "my-model"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/EndpointTargetRequestV1"
                        },
                        "maxItems": 1,
                        "minItems": 1,
                        "title": "Targets",
                        "type": "array"
                    }
                },
                "required": [
                    "slug",
                    "targets"
                ],
                "title": "CreateEndpointRequestV1",
                "type": "object"
            },
            "EndpointTombstoneV1": {
                "properties": {
                    "id": {
                        "description": "Identifier of the deleted endpoint.",
                        "title": "Id",
                        "type": "string"
                    },
                    "slug": {
                        "description": "Slug of the deleted endpoint.",
                        "title": "Slug",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "slug"
                ],
                "title": "EndpointTombstoneV1",
                "type": "object"
            },
            "UpdateEndpointRequestV1": {
                "description": "PATCH body. Replaces the endpoint's full target list. The slug is immutable\nafter creation; to change it, create a new endpoint and delete this one.",
                "properties": {
                    "targets": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/EndpointTargetRequestV1"
                                },
                                "maxItems": 1,
                                "minItems": 1,
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The endpoint's upstream targets. Exactly one target is supported at this time.",
                        "examples": [
                            [
                                {
                                    "environment_name": "staging",
                                    "model_id": "3kZ9xqd",
                                    "provider": "BASETEN",
                                    "target_model": "custom/model-name"
                                }
                            ],
                            [
                                {
                                    "provider": "OPENAI",
                                    "secret_id": "3kZ9xqd",
                                    "target_model": "gpt-4o"
                                }
                            ],
                            [
                                {
                                    "base_url": "https://my-vllm.example.com",
                                    "provider": "OPENAI_COMPATIBLE",
                                    "secret_id": "3kZ9xqd",
                                    "target_model": "my-model"
                                }
                            ]
                        ],
                        "title": "Targets"
                    }
                },
                "title": "UpdateEndpointRequestV1",
                "type": "object"
            },
            "EffectiveModelConfigV1": {
                "properties": {
                    "slug": {
                        "description": "Shared endpoint slug.",
                        "title": "Slug",
                        "type": "string"
                    },
                    "rate_limits": {
                        "items": {
                            "$ref": "#/components/schemas/EffectiveRateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "usage_limits": {
                        "items": {
                            "$ref": "#/components/schemas/EffectiveUsageLimitV1"
                        },
                        "title": "Usage Limits",
                        "type": "array"
                    }
                },
                "required": [
                    "slug"
                ],
                "title": "EffectiveModelConfigV1",
                "type": "object"
            },
            "EffectiveRateLimitV1": {
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/LimitTypeV1",
                        "description": "The type of the rate limit",
                        "examples": [
                            "TOKEN",
                            "REQUEST"
                        ]
                    },
                    "unit": {
                        "$ref": "#/components/schemas/RateLimitUnitV1",
                        "description": "The unit of the rate limit",
                        "examples": [
                            "SECOND",
                            "MINUTE"
                        ]
                    },
                    "threshold": {
                        "description": "The threshold for the rate limit",
                        "examples": [
                            1000,
                            50000
                        ],
                        "minimum": 0,
                        "title": "Threshold",
                        "type": "integer"
                    },
                    "source_group": {
                        "description": "ID of the group in the hierarchy this limit is anchored to.",
                        "examples": [
                            "abc123"
                        ],
                        "title": "Source Group",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold",
                    "source_group"
                ],
                "title": "EffectiveRateLimitV1",
                "type": "object"
            },
            "EffectiveUsageLimitV1": {
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/LimitTypeV1",
                        "description": "The type of the usage limit",
                        "examples": [
                            "REQUEST",
                            "TOKEN"
                        ]
                    },
                    "unit": {
                        "$ref": "#/components/schemas/UsageLimitUnitV1",
                        "description": "The unit of the usage limit",
                        "examples": [
                            "DAY"
                        ]
                    },
                    "threshold": {
                        "description": "The threshold for the usage limit",
                        "examples": [
                            10000000
                        ],
                        "minimum": 0,
                        "title": "Threshold",
                        "type": "integer"
                    },
                    "source_group": {
                        "description": "ID of the group in the hierarchy this limit is anchored to.",
                        "examples": [
                            "abc123"
                        ],
                        "title": "Source Group",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold",
                    "source_group"
                ],
                "title": "EffectiveUsageLimitV1",
                "type": "object"
            },
            "GroupHierarchyV1": {
                "properties": {
                    "limit_enforcement": {
                        "$ref": "#/components/schemas/LimitEnforcementV1",
                        "examples": [
                            "CASCADING",
                            "INDEPENDENT"
                        ]
                    },
                    "parent_group_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "examples": [
                            "abc123"
                        ],
                        "title": "Parent Group Id"
                    }
                },
                "required": [
                    "limit_enforcement"
                ],
                "title": "GroupHierarchyV1",
                "type": "object"
            },
            "GroupMetadataV1": {
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name for the group.",
                        "examples": [
                            "Acme prod"
                        ],
                        "title": "Name"
                    },
                    "external_entity_id": {
                        "description": "External-system identifier for this group. Unique within the caller's org.",
                        "examples": [
                            "cust_42"
                        ],
                        "maxLength": 255,
                        "minLength": 1,
                        "title": "External Entity Id",
                        "type": "string"
                    }
                },
                "required": [
                    "external_entity_id"
                ],
                "title": "GroupMetadataV1",
                "type": "object"
            },
            "GroupV1": {
                "properties": {
                    "id": {
                        "description": "Internal Baseten ID for the group.",
                        "title": "Id",
                        "type": "string"
                    },
                    "metadata": {
                        "$ref": "#/components/schemas/GroupMetadataV1",
                        "description": "Group identity + display metadata."
                    },
                    "models": {
                        "items": {
                            "$ref": "#/components/schemas/ModelConfigV1"
                        },
                        "title": "Models",
                        "type": "array"
                    },
                    "effective_models": {
                        "items": {
                            "$ref": "#/components/schemas/EffectiveModelConfigV1"
                        },
                        "title": "Effective Models",
                        "type": "array"
                    },
                    "hierarchy": {
                        "$ref": "#/components/schemas/GroupHierarchyV1",
                        "description": "Parent linkage and limit enforcement mode. Parent is null for root groups."
                    },
                    "created_at": {
                        "description": "When this group was created.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "metadata",
                    "hierarchy",
                    "created_at"
                ],
                "title": "GroupV1",
                "type": "object"
            },
            "LimitEnforcementV1": {
                "enum": [
                    "CASCADING",
                    "INDEPENDENT"
                ],
                "title": "LimitEnforcementV1",
                "type": "string"
            },
            "ModelConfigV1": {
                "properties": {
                    "slug": {
                        "description": "Shared endpoint slug.",
                        "title": "Slug",
                        "type": "string"
                    },
                    "rate_limits": {
                        "items": {
                            "$ref": "#/components/schemas/RateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "usage_limits": {
                        "items": {
                            "$ref": "#/components/schemas/UsageLimitV1"
                        },
                        "title": "Usage Limits",
                        "type": "array"
                    }
                },
                "required": [
                    "slug"
                ],
                "title": "ModelConfigV1",
                "type": "object"
            },
            "UsageLimitUnitV1": {
                "enum": [
                    "DAY"
                ],
                "title": "UsageLimitUnitV1",
                "type": "string"
            },
            "UsageLimitV1": {
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/LimitTypeV1",
                        "description": "The type of the usage limit",
                        "examples": [
                            "REQUEST",
                            "TOKEN"
                        ]
                    },
                    "unit": {
                        "$ref": "#/components/schemas/UsageLimitUnitV1",
                        "description": "The unit of the usage limit",
                        "examples": [
                            "DAY"
                        ]
                    },
                    "threshold": {
                        "description": "The threshold for the usage limit",
                        "examples": [
                            10000000
                        ],
                        "minimum": 0,
                        "title": "Threshold",
                        "type": "integer"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold"
                ],
                "title": "UsageLimitV1",
                "type": "object"
            },
            "GroupsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GroupV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GroupsResponseV1",
                "type": "object"
            },
            "CreateGroupHierarchyV1": {
                "properties": {
                    "limit_enforcement": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LimitEnforcementV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Limit behavior. Child groups inherit their parent's behavior when omitted; root groups default to Independent for backwards compatibility.",
                        "examples": [
                            "INDEPENDENT"
                        ]
                    },
                    "parent_group_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "examples": [
                            "abc123"
                        ],
                        "title": "Parent Group Id"
                    }
                },
                "title": "CreateGroupHierarchyV1",
                "type": "object"
            },
            "CreateGroupRequestV1": {
                "properties": {
                    "metadata": {
                        "$ref": "#/components/schemas/GroupMetadataV1",
                        "description": "Group identity + display metadata."
                    },
                    "models": {
                        "description": "Per-model rate and usage limit configuration. Defines the group's complete model set. Must be non-empty.",
                        "examples": [
                            [
                                {
                                    "slug": "my-org/claude"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/ModelConfigV1"
                        },
                        "minItems": 1,
                        "title": "Models",
                        "type": "array"
                    },
                    "hierarchy": {
                        "$ref": "#/components/schemas/CreateGroupHierarchyV1",
                        "description": "Parent linkage and limit enforcement mode. Immutable after creation."
                    }
                },
                "required": [
                    "metadata",
                    "models",
                    "hierarchy"
                ],
                "title": "CreateGroupRequestV1",
                "type": "object"
            },
            "UpdateGroupMetadataV1": {
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name for the group.",
                        "examples": [
                            "Acme prod"
                        ],
                        "title": "Name"
                    }
                },
                "title": "UpdateGroupMetadataV1",
                "type": "object"
            },
            "UpdateGroupRequestV1": {
                "properties": {
                    "metadata": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateGroupMetadataV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Mutable group metadata.",
                        "examples": [
                            {
                                "name": "Acme Prod"
                            }
                        ]
                    },
                    "models": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/ModelConfigV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Per-model rate and usage limit configuration.",
                        "title": "Models"
                    }
                },
                "title": "UpdateGroupRequestV1",
                "type": "object"
            },
            "GatewayKeyInfoV1": {
                "properties": {
                    "prefix": {
                        "description": "The prefix of the Model API key.",
                        "title": "Prefix",
                        "type": "string"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name.",
                        "title": "Name"
                    }
                },
                "required": [
                    "prefix"
                ],
                "title": "GatewayKeyInfoV1",
                "type": "object"
            },
            "KeysForGroupResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GatewayKeyInfoV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "KeysForGroupResponseV1",
                "type": "object"
            },
            "CreateApiKeyForGroupRequestV1": {
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name for the new key.",
                        "examples": [
                            "prod-key-1"
                        ],
                        "title": "Name"
                    }
                },
                "title": "CreateApiKeyForGroupRequestV1",
                "type": "object"
            },
            "CreateApiKeyForGroupResponseV1": {
                "properties": {
                    "api_key": {
                        "description": "Plaintext key string, returned exactly once.",
                        "title": "Api Key",
                        "type": "string"
                    },
                    "prefix": {
                        "description": "Key prefix (the part before the dot).",
                        "title": "Prefix",
                        "type": "string"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the key.",
                        "title": "Name"
                    }
                },
                "required": [
                    "api_key",
                    "prefix"
                ],
                "title": "CreateApiKeyForGroupResponseV1",
                "type": "object"
            },
            "RegisterAPIKeyRequestV1": {
                "description": "Request to register a caller-supplied API key against an existing FederatedGroup.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional name for the Model API key",
                        "examples": [
                            "my-model-api-key"
                        ],
                        "title": "Name"
                    },
                    "key": {
                        "description": "Value of the API key to register",
                        "examples": [
                            "my-secure-api-key-value"
                        ],
                        "title": "Key",
                        "type": "string"
                    }
                },
                "required": [
                    "key"
                ],
                "title": "RegisterAPIKeyRequestV1",
                "type": "object"
            },
            "RegisterAPIKeyResponseV1": {
                "properties": {
                    "ok": {
                        "description": "Whether the registration was successful",
                        "title": "Ok",
                        "type": "boolean"
                    }
                },
                "required": [
                    "ok"
                ],
                "title": "RegisterAPIKeyResponseV1",
                "type": "object"
            },
            "GetSandboxConfigurationResponseV1": {
                "type": "object",
                "required": [
                    "regions"
                ],
                "properties": {
                    "regions": {
                        "type": "array",
                        "description": "Available Carbon-compatible regions, sorted by name. Empty when none are available.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxRegionV1"
                        }
                    }
                }
            },
            "SandboxRegionV1": {
                "type": "object",
                "required": [
                    "name",
                    "country",
                    "continent",
                    "location",
                    "info_generation"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Public region identifier to use when creating a sandbox.",
                        "example": "us-was-1"
                    },
                    "country": {
                        "type": "string",
                        "description": "Country code.",
                        "example": "us"
                    },
                    "continent": {
                        "type": "string",
                        "description": "Continent code.",
                        "example": "na"
                    },
                    "location": {
                        "type": "string",
                        "description": "Region location.",
                        "example": "Washington"
                    },
                    "info_generation": {
                        "type": "string",
                        "description": "Runtime generation supported by this region, using the public name CARBON. Actual runtime selection depends on the team and sandbox configuration.",
                        "enum": [
                            "CARBON"
                        ]
                    }
                }
            },
            "SandboxLogsV1": {
                "type": "object",
                "required": [
                    "sandbox_name",
                    "start_time",
                    "end_time",
                    "logs",
                    "next_cursor"
                ],
                "properties": {
                    "sandbox_name": {
                        "type": "string"
                    },
                    "start_time": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "end_time": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "logs": {
                        "type": "array",
                        "maxItems": 1000,
                        "items": {
                            "$ref": "#/components/schemas/SandboxLogEntryV1"
                        }
                    },
                    "next_cursor": {
                        "description": "Opaque cursor for the next page; null when there are no more entries.",
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "SandboxLogEntryV1": {
                "type": "object",
                "required": [
                    "timestamp",
                    "message",
                    "severity",
                    "trace_id"
                ],
                "properties": {
                    "timestamp": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "message": {
                        "type": "string"
                    },
                    "severity": {
                        "type": "integer",
                        "description": "Numeric log severity."
                    },
                    "trace_id": {
                        "type": "string",
                        "description": "Associated trace identifier, or an empty string when unavailable."
                    },
                    "action": {
                        "type": "string",
                        "description": "Action or command when present on the log entry."
                    }
                }
            },
            "SandboxMetricsV1": {
                "type": "object",
                "required": [
                    "sandbox_name",
                    "start_time",
                    "end_time",
                    "interval_seconds",
                    "data"
                ],
                "properties": {
                    "sandbox_name": {
                        "type": "string"
                    },
                    "start_time": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "end_time": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "interval_seconds": {
                        "type": "integer"
                    },
                    "data": {
                        "type": "array",
                        "maxItems": 10000,
                        "items": {
                            "$ref": "#/components/schemas/SandboxMetricsPointV1"
                        }
                    }
                }
            },
            "SandboxMetricsPointV1": {
                "type": "object",
                "required": [
                    "timestamp",
                    "requests",
                    "cpu_percent",
                    "memory_bytes",
                    "error_rate"
                ],
                "properties": {
                    "timestamp": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Start of this interval."
                    },
                    "requests": {
                        "description": "Request count. Zero without traffic; null for intervals entirely before creation.",
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "cpu_percent": {
                        "description": "Peak CPU usage in this interval, where 100 is one full CPU core. Null without a sample.",
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "memory_bytes": {
                        "description": "Memory usage in bytes, averaged per series then maximum across series. Null without a sample.",
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "error_rate": {
                        "description": "Fraction of requests returning 4xx or 5xx. Null when there are no requests.",
                        "anyOf": [
                            {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 1
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "SandboxImageBuildLogV1": {
                "type": "object",
                "required": [
                    "timestamp",
                    "message",
                    "severity"
                ],
                "properties": {
                    "timestamp": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "message": {
                        "type": "string"
                    },
                    "severity": {
                        "type": "integer",
                        "description": "Numeric OpenTelemetry severity level."
                    }
                }
            },
            "SandboxImageBuildLogsResponseV1": {
                "type": "object",
                "required": [
                    "logs",
                    "total_count"
                ],
                "properties": {
                    "logs": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SandboxImageBuildLogV1"
                        }
                    },
                    "total_count": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Number of matching log entries in the requested time range."
                    }
                }
            },
            "SandboxLifecycleV1": {
                "type": "object",
                "description": "Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates",
                "properties": {
                    "expiration_policies": {
                        "type": "array",
                        "description": "List of expiration policies. Multiple policies can be combined; whichever condition is met first triggers the action.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxExpirationPolicyV1"
                        },
                        "example": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ]
                    },
                    "terminated_retention": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxDurationV1"
                            }
                        ],
                        "description": "Duration to keep the sandbox record after termination for log access (e.g., '1h', '24h', '7d'). Defaults to 5m. Subject to maximum quota limits.",
                        "example": "24h"
                    }
                },
                "example": {
                    "expiration_policies": [
                        {
                            "action": "DELETE",
                            "type": "TTL_IDLE",
                            "value": "24h"
                        },
                        {
                            "action": "DELETE",
                            "type": "TTL_MAX_AGE",
                            "value": "7d"
                        },
                        {
                            "action": "DELETE",
                            "type": "DATE",
                            "value": "2026-09-23T21:26:58Z"
                        }
                    ],
                    "terminated_retention": "24h"
                }
            },
            "SandboxExpirationPolicyV1": {
                "description": "Expiration policy. The type determines whether value is a duration or an absolute timestamp.",
                "oneOf": [
                    {
                        "$ref": "#/components/schemas/SandboxTTLIdleExpirationPolicyV1"
                    },
                    {
                        "$ref": "#/components/schemas/SandboxTTLMaxAgeExpirationPolicyV1"
                    },
                    {
                        "$ref": "#/components/schemas/SandboxDateExpirationPolicyV1"
                    }
                ],
                "discriminator": {
                    "propertyName": "type",
                    "mapping": {
                        "TTL_IDLE": "#/components/schemas/SandboxTTLIdleExpirationPolicyV1",
                        "TTL_MAX_AGE": "#/components/schemas/SandboxTTLMaxAgeExpirationPolicyV1",
                        "DATE": "#/components/schemas/SandboxDateExpirationPolicyV1"
                    }
                }
            },
            "SandboxDurationV1": {
                "type": "string",
                "description": "Duration using seconds, minutes, hours, or composite durations such as 1h30m. Whole days and weeks are also supported, for example 7d or 2w, where d is 24h and w is 7 \u00d7 24h. Days and weeks cannot be combined with other units, so 1d12h is rejected; use 36h instead. Values are returned exactly as sent, without normalization.",
                "pattern": "^[+-]?(0|[0-9]+[dw]|([0-9]+(\\.[0-9]*)?|\\.[0-9]+)(ns|us|\u00b5s|\u03bcs|ms|s|m|h)(([0-9]+(\\.[0-9]*)?|\\.[0-9]+)(ns|us|\u00b5s|\u03bcs|ms|s|m|h))*)$",
                "example": "24h"
            },
            "SandboxTTLIdleExpirationPolicyV1": {
                "type": "object",
                "description": "Delete after the specified period of inactivity.",
                "required": [
                    "action",
                    "type",
                    "value"
                ],
                "properties": {
                    "action": {
                        "type": "string",
                        "enum": [
                            "DELETE"
                        ]
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "TTL_IDLE"
                        ]
                    },
                    "value": {
                        "$ref": "#/components/schemas/SandboxDurationV1"
                    }
                }
            },
            "SandboxTTLMaxAgeExpirationPolicyV1": {
                "type": "object",
                "description": "Delete after the specified total lifetime.",
                "required": [
                    "action",
                    "type",
                    "value"
                ],
                "properties": {
                    "action": {
                        "type": "string",
                        "enum": [
                            "DELETE"
                        ]
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "TTL_MAX_AGE"
                        ]
                    },
                    "value": {
                        "$ref": "#/components/schemas/SandboxDurationV1"
                    }
                }
            },
            "SandboxDateExpirationPolicyV1": {
                "type": "object",
                "description": "Delete at the specified absolute timestamp.",
                "required": [
                    "action",
                    "type",
                    "value"
                ],
                "properties": {
                    "action": {
                        "type": "string",
                        "enum": [
                            "DELETE"
                        ]
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "DATE"
                        ]
                    },
                    "value": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-09-23T21:26:58Z"
                    }
                }
            },
            "SandboxNetworkV1": {
                "type": "object",
                "description": "Network configuration for a sandbox including subnet, domain filtering, and proxy settings",
                "properties": {
                    "proxy": {
                        "description": "Proxy configuration for routing sandbox HTTP traffic through the platform proxy with MITM inspection and per-destination header/body injection",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxProxyConfigV1"
                            }
                        ],
                        "example": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    },
                                    "secrets": {
                                        "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                    }
                                }
                            ]
                        }
                    },
                    "subnet": {
                        "type": "string",
                        "description": "Subnet name for the sandbox. Defaults to \"default\" at creation.",
                        "example": "default"
                    }
                },
                "example": {
                    "proxy": {
                        "allowed_domains": [
                            "api.openai.com",
                            "pypi.org",
                            "files.pythonhosted.org",
                            "registry.npmjs.org"
                        ],
                        "bypass": [
                            "registry.npmjs.org"
                        ],
                        "forbidden_domains": [
                            "facebook.com",
                            "*.facebook.com"
                        ],
                        "routing": [
                            {
                                "destinations": [
                                    "api.openai.com"
                                ],
                                "headers": {
                                    "Authorization": "Bearer {{SECRET:openai-key}}"
                                },
                                "body": {
                                    "user": "baseten-api-review-0916"
                                },
                                "secrets": {
                                    "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                }
                            }
                        ]
                    },
                    "subnet": "default"
                }
            },
            "SandboxProxyConfigV1": {
                "type": "object",
                "description": "Proxy configuration for routing sandbox HTTP traffic through the platform proxy with MITM inspection and per-destination header/body injection",
                "properties": {
                    "allowed_domains": {
                        "type": "array",
                        "description": "List of allowed external domains (allowlist). When set, only these domains are reachable. Supports wildcards (e.g. *.storage.example.com).",
                        "items": {
                            "type": "string",
                            "example": "api.openai.com"
                        },
                        "example": [
                            "api.openai.com",
                            "pypi.org",
                            "files.pythonhosted.org",
                            "registry.npmjs.org"
                        ]
                    },
                    "bypass": {
                        "type": "array",
                        "description": "Domains that bypass the proxy entirely via the NO_PROXY directive. Traffic to these destinations goes direct, not through the CONNECT tunnel. Supports wildcards. Note that localhost, private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), 169.254.169.254, .local and .internal are always bypassed by default.",
                        "items": {
                            "type": "string",
                            "example": "registry.npmjs.org"
                        },
                        "example": [
                            "registry.npmjs.org"
                        ]
                    },
                    "forbidden_domains": {
                        "type": "array",
                        "description": "List of forbidden external domains (denylist). When set, all domains except these are reachable. Supports wildcards (e.g. *.malware.com). If both allowed_domains and forbidden_domains are set, allowed_domains takes precedence.",
                        "items": {
                            "type": "string",
                            "example": "facebook.com"
                        },
                        "example": [
                            "facebook.com",
                            "*.facebook.com"
                        ]
                    },
                    "routing": {
                        "type": "array",
                        "description": "Per-destination routing rules with header/body injection and secrets. Use destinations [\"*\"] for global rules that apply to all destinations.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxProxyTargetV1"
                        },
                        "example": [
                            {
                                "destinations": [
                                    "api.openai.com"
                                ],
                                "headers": {
                                    "Authorization": "Bearer {{SECRET:openai-key}}"
                                },
                                "body": {
                                    "user": "baseten-api-review-0916"
                                },
                                "secrets": {
                                    "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                }
                            }
                        ]
                    }
                },
                "example": {
                    "allowed_domains": [
                        "api.openai.com",
                        "pypi.org",
                        "files.pythonhosted.org",
                        "registry.npmjs.org"
                    ],
                    "bypass": [
                        "registry.npmjs.org"
                    ],
                    "forbidden_domains": [
                        "facebook.com",
                        "*.facebook.com"
                    ],
                    "routing": [
                        {
                            "destinations": [
                                "api.openai.com"
                            ],
                            "headers": {
                                "Authorization": "Bearer {{SECRET:openai-key}}"
                            },
                            "body": {
                                "user": "baseten-api-review-0916"
                            },
                            "secrets": {
                                "openai-key": "sk-proj-demo-not-a-valid-api-key"
                            }
                        }
                    ]
                }
            },
            "SandboxProxyTargetV1": {
                "type": "object",
                "description": "Routing rule that injects headers and body fields into requests matching the given destinations. Use destinations [\"*\"] for a global rule that applies to all proxied traffic.",
                "properties": {
                    "body": {
                        "type": "object",
                        "description": "Body fields to inject into matching requests. Values may contain {{SECRET:name}} references resolved from this rule's secrets.",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "example": {
                            "user": "baseten-api-review-0916"
                        }
                    },
                    "destinations": {
                        "type": "array",
                        "description": "Destination domains this rule applies to. Use [\"*\"] for a global rule that matches all destinations.",
                        "items": {
                            "type": "string",
                            "example": "api.openai.com"
                        },
                        "example": [
                            "api.openai.com"
                        ]
                    },
                    "headers": {
                        "type": "object",
                        "description": "Headers to inject into matching requests. Values may contain {{SECRET:name}} references resolved from this rule's secrets.",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "example": {
                            "Authorization": "Bearer {{SECRET:openai-key}}"
                        }
                    },
                    "secrets": {
                        "type": "object",
                        "description": "Named secret values for this routing rule, referenced in headers/body via {{SECRET:name}}. Stored encrypted at rest. Write-only: never returned in API responses.",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "example": {
                            "openai-key": "sk-proj-demo-not-a-valid-api-key"
                        },
                        "writeOnly": true
                    }
                },
                "example": {
                    "destinations": [
                        "api.openai.com"
                    ],
                    "headers": {
                        "Authorization": "Bearer {{SECRET:openai-key}}"
                    },
                    "body": {
                        "user": "baseten-api-review-0916"
                    },
                    "secrets": {
                        "openai-key": "sk-proj-demo-not-a-valid-api-key"
                    }
                }
            },
            "SandboxEnvV1": {
                "type": "object",
                "description": "Environment variable with name and value",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Name of the environment variable",
                        "example": "NODE_ENV"
                    },
                    "secret": {
                        "type": "boolean",
                        "description": "Whether the value is a secret. Defaults to true; secret values are returned as \"****\". Set false explicitly to return the original value.",
                        "default": true,
                        "example": false
                    },
                    "value": {
                        "type": "string",
                        "description": "Value of the environment variable",
                        "example": "production"
                    }
                },
                "example": {
                    "name": "NODE_ENV",
                    "secret": false,
                    "value": "production"
                }
            },
            "SandboxPortsV1": {
                "type": "array",
                "description": "Set of ports for a resource",
                "items": {
                    "$ref": "#/components/schemas/SandboxPortV1"
                },
                "example": [
                    {
                        "name": "http",
                        "protocol": "HTTP",
                        "target": 3000
                    }
                ]
            },
            "SandboxPortV1": {
                "type": "object",
                "description": "A port for a resource",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The name of the port",
                        "example": "http"
                    },
                    "protocol": {
                        "type": "string",
                        "description": "The protocol of the port",
                        "enum": [
                            "HTTP",
                            "TCP",
                            "UDP",
                            "TLS"
                        ],
                        "example": "HTTP"
                    },
                    "target": {
                        "type": "integer",
                        "description": "The target port of the port",
                        "example": 3000,
                        "minimum": 1,
                        "maximum": 65535
                    }
                },
                "required": [
                    "target"
                ],
                "example": {
                    "name": "http",
                    "protocol": "HTTP",
                    "target": 3000
                }
            },
            "SandboxMetadataLabelsV1": {
                "type": "object",
                "description": "Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.",
                "additionalProperties": {
                    "type": "string"
                },
                "example": {
                    "env": "development",
                    "project": "api-review",
                    "team": "engineering"
                }
            },
            "SandboxConfigurationV1": {
                "type": "object",
                "description": "Writable sandbox configuration. Fields are serialized at the root of the request or resource.",
                "properties": {
                    "lifecycle": {
                        "description": "Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxLifecycleV1"
                            }
                        ],
                        "example": {
                            "expiration_policies": [
                                {
                                    "action": "DELETE",
                                    "type": "TTL_IDLE",
                                    "value": "24h"
                                },
                                {
                                    "action": "DELETE",
                                    "type": "TTL_MAX_AGE",
                                    "value": "7d"
                                },
                                {
                                    "action": "DELETE",
                                    "type": "DATE",
                                    "value": "2026-09-23T21:26:58Z"
                                }
                            ],
                            "terminated_retention": "24h"
                        }
                    },
                    "network": {
                        "description": "Network configuration for a sandbox including subnet, domain filtering, and proxy settings",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxNetworkV1"
                            }
                        ],
                        "example": {
                            "proxy": {
                                "allowed_domains": [
                                    "api.openai.com",
                                    "pypi.org",
                                    "files.pythonhosted.org",
                                    "registry.npmjs.org"
                                ],
                                "bypass": [
                                    "registry.npmjs.org"
                                ],
                                "forbidden_domains": [
                                    "facebook.com",
                                    "*.facebook.com"
                                ],
                                "routing": [
                                    {
                                        "destinations": [
                                            "api.openai.com"
                                        ],
                                        "headers": {
                                            "Authorization": "Bearer {{SECRET:openai-key}}"
                                        },
                                        "body": {
                                            "user": "baseten-api-review-0916"
                                        },
                                        "secrets": {
                                            "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                        }
                                    }
                                ]
                            },
                            "subnet": "default"
                        }
                    },
                    "region": {
                        "type": "string",
                        "description": "Region where the sandbox runs (for example us-pdx-1 or eu-lon-1). When omitted at creation, the closest region is selected.",
                        "example": "us-pdx-1"
                    },
                    "envs": {
                        "type": "array",
                        "description": "Environment variables injected into the sandbox.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxEnvV1"
                        },
                        "example": [
                            {
                                "name": "NODE_ENV",
                                "secret": false,
                                "value": "production"
                            },
                            {
                                "name": "PORT",
                                "secret": false,
                                "value": "3000"
                            }
                        ]
                    },
                    "image": {
                        "type": "string",
                        "description": "Image reference including its tag. Built-in image references are returned in the canonical baseten/ namespace. Use baseten/base-image:latest to get started with the built-in sandbox execution API. This image is available directly without building, pushing, or listing images through GET /v1/sandboxes/images.",
                        "example": "baseten/base-image:latest"
                    },
                    "memory": {
                        "type": "integer",
                        "description": "Memory allocation in megabytes. Also determines CPU allocation (CPU cores = memory in MB / 2048, e.g., 4096MB = 2 CPUs).",
                        "example": 4096,
                        "minimum": 1
                    },
                    "ports": {
                        "description": "Set of ports for a resource",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxPortsV1"
                            }
                        ],
                        "example": [
                            {
                                "name": "http",
                                "protocol": "HTTP",
                                "target": 3000
                            }
                        ]
                    },
                    "external_id": {
                        "type": "string",
                        "description": "Caller-owned identifier for external lookups. Max 64 chars, alphanumeric + dash.",
                        "example": "api-review-20260916-001",
                        "maxLength": 64,
                        "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "labels": {
                        "description": "Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxMetadataLabelsV1"
                            }
                        ],
                        "example": {
                            "env": "development",
                            "project": "api-review",
                            "team": "engineering"
                        }
                    }
                },
                "example": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    },
                                    "secrets": {
                                        "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering"
                    }
                }
            },
            "CreateSandboxRequestV1": {
                "type": "object",
                "description": "Configuration for a new sandbox. The client may provide a name; otherwise the server generates one. The name is immutable after creation.",
                "properties": {
                    "create_if_not_exists": {
                        "type": "boolean",
                        "description": "When true, return the existing live sandbox with this name or recreate it if it is failed, terminated, or being deleted. The server handles concurrent creation and deletion races with a bounded wait; persistent contention returns a conflict. Requires name. Existing configuration is preserved. Defaults to false when omitted."
                    },
                    "name": {
                        "type": "string",
                        "description": "Optional unique sandbox name. Generated by the server when omitted; immutable after creation.",
                        "minLength": 1,
                        "example": "baseten-api-review-0916"
                    },
                    "lifecycle": {
                        "description": "Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxLifecycleV1"
                            }
                        ],
                        "example": {
                            "expiration_policies": [
                                {
                                    "action": "DELETE",
                                    "type": "TTL_IDLE",
                                    "value": "24h"
                                },
                                {
                                    "action": "DELETE",
                                    "type": "TTL_MAX_AGE",
                                    "value": "7d"
                                },
                                {
                                    "action": "DELETE",
                                    "type": "DATE",
                                    "value": "2026-09-23T21:26:58Z"
                                }
                            ],
                            "terminated_retention": "24h"
                        }
                    },
                    "network": {
                        "description": "Network configuration for a sandbox including subnet, domain filtering, and proxy settings",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxNetworkV1"
                            }
                        ],
                        "example": {
                            "proxy": {
                                "allowed_domains": [
                                    "api.openai.com",
                                    "pypi.org",
                                    "files.pythonhosted.org",
                                    "registry.npmjs.org"
                                ],
                                "bypass": [
                                    "registry.npmjs.org"
                                ],
                                "forbidden_domains": [
                                    "facebook.com",
                                    "*.facebook.com"
                                ],
                                "routing": [
                                    {
                                        "destinations": [
                                            "api.openai.com"
                                        ],
                                        "headers": {
                                            "Authorization": "Bearer {{SECRET:openai-key}}"
                                        },
                                        "body": {
                                            "user": "baseten-api-review-0916"
                                        },
                                        "secrets": {
                                            "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                        }
                                    }
                                ]
                            },
                            "subnet": "default"
                        }
                    },
                    "region": {
                        "type": "string",
                        "description": "Region where the sandbox runs (for example us-pdx-1 or eu-lon-1). When omitted at creation, the closest region is selected.",
                        "example": "us-pdx-1"
                    },
                    "envs": {
                        "type": "array",
                        "description": "Environment variables injected into the sandbox.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxEnvV1"
                        },
                        "example": [
                            {
                                "name": "NODE_ENV",
                                "secret": false,
                                "value": "production"
                            },
                            {
                                "name": "PORT",
                                "secret": false,
                                "value": "3000"
                            }
                        ]
                    },
                    "image": {
                        "type": "string",
                        "description": "Image reference including its tag. Defaults to baseten/base-image:latest, the built-in sandbox execution API. This image is available directly without building, pushing, or listing images through GET /v1/sandboxes/images.",
                        "default": "baseten/base-image:latest",
                        "example": "baseten/base-image:latest"
                    },
                    "memory": {
                        "type": "integer",
                        "description": "Memory allocation in megabytes. Also determines CPU allocation (CPU cores = memory in MB / 2048, e.g., 4096MB = 2 CPUs). Defaults to 4096.",
                        "default": 4096,
                        "example": 4096,
                        "minimum": 1
                    },
                    "ports": {
                        "description": "Set of ports for a resource",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxPortsV1"
                            }
                        ],
                        "example": [
                            {
                                "name": "http",
                                "protocol": "HTTP",
                                "target": 3000
                            }
                        ]
                    },
                    "external_id": {
                        "type": "string",
                        "description": "Caller-owned identifier for external lookups. Max 64 chars, alphanumeric + dash.",
                        "example": "api-review-20260916-001",
                        "maxLength": 64,
                        "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "labels": {
                        "description": "Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxMetadataLabelsV1"
                            }
                        ],
                        "example": {
                            "env": "development",
                            "project": "api-review",
                            "team": "engineering"
                        }
                    }
                },
                "example": {
                    "name": "baseten-api-review-0916",
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    },
                                    "secrets": {
                                        "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering"
                    }
                }
            },
            "UpdateSandboxRequestV1": {
                "type": "object",
                "description": "Partial sandbox update. Omitted fields remain unchanged. Supplied arrays and maps (including labels) replace their previous values; supplied structured objects update only their supplied fields. Null is not accepted. The name, memory, network, region, image, and ports are immutable after creation. Supplying any of these fields returns 400, including unchanged, empty, or null values.",
                "properties": {
                    "lifecycle": {
                        "description": "Lifecycle configuration controlling automatic sandbox deletion based on idle time, max age, or specific dates",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxLifecycleV1"
                            }
                        ],
                        "example": {
                            "expiration_policies": [
                                {
                                    "action": "DELETE",
                                    "type": "TTL_IDLE",
                                    "value": "24h"
                                },
                                {
                                    "action": "DELETE",
                                    "type": "TTL_MAX_AGE",
                                    "value": "7d"
                                },
                                {
                                    "action": "DELETE",
                                    "type": "DATE",
                                    "value": "2026-09-23T21:26:58Z"
                                }
                            ],
                            "terminated_retention": "24h"
                        }
                    },
                    "envs": {
                        "type": "array",
                        "description": "Environment variables injected into the sandbox.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxEnvV1"
                        },
                        "example": [
                            {
                                "name": "NODE_ENV",
                                "secret": false,
                                "value": "production"
                            },
                            {
                                "name": "PORT",
                                "secret": false,
                                "value": "3000"
                            }
                        ]
                    },
                    "external_id": {
                        "type": "string",
                        "description": "Caller-owned identifier for external lookups. Max 64 chars, alphanumeric + dash.",
                        "example": "api-review-20260916-001",
                        "maxLength": 64,
                        "pattern": "^[A-Za-z0-9-]+$"
                    },
                    "labels": {
                        "description": "Key-value pairs for organizing and filtering resources. Labels can be used to categorize resources by environment, project, team, or any custom taxonomy.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxMetadataLabelsV1"
                            }
                        ],
                        "example": {
                            "env": "development",
                            "project": "api-review",
                            "team": "engineering",
                            "revision": "2"
                        }
                    }
                },
                "minProperties": 1,
                "example": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering",
                        "revision": "2"
                    }
                }
            },
            "SandboxV1": {
                "description": "Sandbox resource with configuration and server-managed fields at the root. No metadata, spec, or runtime wrapper.",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SandboxConfigurationV1"
                    },
                    {
                        "type": "object",
                        "description": "Server-managed sandbox fields.",
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "Immutable sandbox name, provided by the client or generated by the server, used in sandbox_name path parameters.",
                                "readOnly": true,
                                "example": "baseten-api-review-0916"
                            },
                            "url": {
                                "type": "string",
                                "description": "Base URL of this sandbox's execution API, always present on successful creation. The URL is assigned before deployment completes; inspect status for readiness. Use this exact returned URL; do not reconstruct its hostname. Authenticate requests with your authentication token using Authorization: Bearer <token>. Do not send the Baseten API key directly. No additional routing headers are required. Fetch GET {url}/swagger/doc.json with that header for the API reference served by this sandbox. For example, POST {url}/process with Content-Type: application/json and {\"command\":\"echo hello\",\"waitForCompletion\":true} executes a command and waits for its result. Execution API fields use camelCase, independently of this API's snake_case fields.",
                                "format": "uri",
                                "readOnly": true,
                                "example": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run"
                            },
                            "status": {
                                "description": "Sandbox deployment status.",
                                "allOf": [
                                    {
                                        "$ref": "#/components/schemas/SandboxStatusV1"
                                    }
                                ],
                                "example": "DEPLOYED"
                            },
                            "created_at": {
                                "type": "string",
                                "description": "Time the sandbox was created.",
                                "format": "date-time",
                                "readOnly": true,
                                "example": "2026-09-16T21:26:58.545765901Z"
                            },
                            "updated_at": {
                                "type": "string",
                                "description": "Time the sandbox was last updated.",
                                "format": "date-time",
                                "readOnly": true,
                                "example": "2026-09-16T21:31:13Z"
                            },
                            "created_by": {
                                "type": "string",
                                "description": "User or service account that created the sandbox.",
                                "readOnly": true,
                                "example": "sandbox-automation"
                            },
                            "updated_by": {
                                "type": "string",
                                "description": "User or service account that last updated the sandbox.",
                                "readOnly": true,
                                "example": "sandbox-automation"
                            },
                            "last_used_at": {
                                "type": "string",
                                "description": "Time the sandbox was last used.",
                                "format": "date-time",
                                "readOnly": true,
                                "example": "2026-09-16T21:31:13Z"
                            },
                            "expires_in": {
                                "type": "integer",
                                "description": "Seconds remaining before automatic deletion, when expiration is configured.",
                                "readOnly": true,
                                "minimum": 0,
                                "example": 86400
                            }
                        },
                        "required": [
                            "name",
                            "url",
                            "status",
                            "created_at"
                        ],
                        "example": {
                            "name": "baseten-api-review-0916",
                            "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                            "status": "DEPLOYED",
                            "created_at": "2026-09-16T21:26:58.545765901Z",
                            "updated_at": "2026-09-16T21:31:13Z",
                            "created_by": "sandbox-automation",
                            "updated_by": "sandbox-automation",
                            "last_used_at": "2026-09-16T21:31:13Z",
                            "expires_in": 86400
                        }
                    }
                ],
                "example": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering"
                    },
                    "name": "baseten-api-review-0916",
                    "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                    "status": "DEPLOYED",
                    "created_at": "2026-09-16T21:26:58.545765901Z",
                    "updated_at": "2026-09-16T21:31:13Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation",
                    "last_used_at": "2026-09-16T21:31:13Z",
                    "expires_in": 86400
                }
            },
            "SandboxStatusV1": {
                "type": "string",
                "description": "Sandbox deployment status, always uppercase. This tracks provisioning and differs from the execution API state, whose values such as running are lowercase.",
                "enum": [
                    "DEPLOYING",
                    "DEPLOYED",
                    "FAILED",
                    "DEACTIVATING",
                    "DEACTIVATED",
                    "DELETING",
                    "TERMINATED",
                    "ARCHIVING",
                    "ARCHIVED",
                    "UNARCHIVING",
                    "BUILDING",
                    "UPLOADING"
                ],
                "readOnly": true,
                "example": "DEPLOYED"
            },
            "SandboxApiPaginationV1": {
                "type": "object",
                "description": "Cursor pagination information. The cursor is present only when another page is available.",
                "properties": {
                    "has_more": {
                        "type": "boolean",
                        "description": "Whether another page is available.",
                        "example": true
                    },
                    "cursor": {
                        "type": "string",
                        "description": "Opaque cursor to pass to the next list request. Keep the same filters.",
                        "minLength": 1,
                        "example": "eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ"
                    }
                },
                "required": [
                    "has_more"
                ],
                "example": {
                    "has_more": true,
                    "cursor": "eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ"
                }
            },
            "ListSandboxesResponseV1": {
                "type": "object",
                "description": "One page of sandboxes.",
                "properties": {
                    "items": {
                        "type": "array",
                        "description": "Resources on this page.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxV1"
                        },
                        "example": [
                            {
                                "lifecycle": {
                                    "expiration_policies": [
                                        {
                                            "action": "DELETE",
                                            "type": "TTL_IDLE",
                                            "value": "24h"
                                        },
                                        {
                                            "action": "DELETE",
                                            "type": "TTL_MAX_AGE",
                                            "value": "7d"
                                        },
                                        {
                                            "action": "DELETE",
                                            "type": "DATE",
                                            "value": "2026-09-23T21:26:58Z"
                                        }
                                    ],
                                    "terminated_retention": "24h"
                                },
                                "network": {
                                    "proxy": {
                                        "allowed_domains": [
                                            "api.openai.com",
                                            "pypi.org",
                                            "files.pythonhosted.org",
                                            "registry.npmjs.org"
                                        ],
                                        "bypass": [
                                            "registry.npmjs.org"
                                        ],
                                        "forbidden_domains": [
                                            "facebook.com",
                                            "*.facebook.com"
                                        ],
                                        "routing": [
                                            {
                                                "destinations": [
                                                    "api.openai.com"
                                                ],
                                                "headers": {
                                                    "Authorization": "Bearer {{SECRET:openai-key}}"
                                                },
                                                "body": {
                                                    "user": "baseten-api-review-0916"
                                                }
                                            }
                                        ]
                                    },
                                    "subnet": "default"
                                },
                                "region": "us-pdx-1",
                                "envs": [
                                    {
                                        "name": "NODE_ENV",
                                        "secret": false,
                                        "value": "production"
                                    },
                                    {
                                        "name": "PORT",
                                        "secret": false,
                                        "value": "3000"
                                    }
                                ],
                                "image": "baseten/base-image:latest",
                                "memory": 4096,
                                "ports": [
                                    {
                                        "name": "http",
                                        "protocol": "HTTP",
                                        "target": 3000
                                    }
                                ],
                                "external_id": "api-review-20260916-001",
                                "labels": {
                                    "env": "development",
                                    "project": "api-review",
                                    "team": "engineering"
                                },
                                "name": "baseten-api-review-0916",
                                "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                                "status": "DEPLOYED",
                                "created_at": "2026-09-16T21:26:58.545765901Z",
                                "updated_at": "2026-09-16T21:31:13Z",
                                "created_by": "sandbox-automation",
                                "updated_by": "sandbox-automation",
                                "last_used_at": "2026-09-16T21:31:13Z",
                                "expires_in": 86400
                            }
                        ]
                    },
                    "pagination": {
                        "description": "Cursor pagination information. The cursor is present only when another page is available.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxApiPaginationV1"
                            }
                        ],
                        "example": {
                            "has_more": true,
                            "cursor": "eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ"
                        }
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "example": {
                    "items": [
                        {
                            "lifecycle": {
                                "expiration_policies": [
                                    {
                                        "action": "DELETE",
                                        "type": "TTL_IDLE",
                                        "value": "24h"
                                    },
                                    {
                                        "action": "DELETE",
                                        "type": "TTL_MAX_AGE",
                                        "value": "7d"
                                    },
                                    {
                                        "action": "DELETE",
                                        "type": "DATE",
                                        "value": "2026-09-23T21:26:58Z"
                                    }
                                ],
                                "terminated_retention": "24h"
                            },
                            "network": {
                                "proxy": {
                                    "allowed_domains": [
                                        "api.openai.com",
                                        "pypi.org",
                                        "files.pythonhosted.org",
                                        "registry.npmjs.org"
                                    ],
                                    "bypass": [
                                        "registry.npmjs.org"
                                    ],
                                    "forbidden_domains": [
                                        "facebook.com",
                                        "*.facebook.com"
                                    ],
                                    "routing": [
                                        {
                                            "destinations": [
                                                "api.openai.com"
                                            ],
                                            "headers": {
                                                "Authorization": "Bearer {{SECRET:openai-key}}"
                                            },
                                            "body": {
                                                "user": "baseten-api-review-0916"
                                            }
                                        }
                                    ]
                                },
                                "subnet": "default"
                            },
                            "region": "us-pdx-1",
                            "envs": [
                                {
                                    "name": "NODE_ENV",
                                    "secret": false,
                                    "value": "production"
                                },
                                {
                                    "name": "PORT",
                                    "secret": false,
                                    "value": "3000"
                                }
                            ],
                            "image": "baseten/base-image:latest",
                            "memory": 4096,
                            "ports": [
                                {
                                    "name": "http",
                                    "protocol": "HTTP",
                                    "target": 3000
                                }
                            ],
                            "external_id": "api-review-20260916-001",
                            "labels": {
                                "env": "development",
                                "project": "api-review",
                                "team": "engineering"
                            },
                            "name": "baseten-api-review-0916",
                            "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                            "status": "DEPLOYED",
                            "created_at": "2026-09-16T21:26:58.545765901Z",
                            "updated_at": "2026-09-16T21:31:13Z",
                            "created_by": "sandbox-automation",
                            "updated_by": "sandbox-automation",
                            "last_used_at": "2026-09-16T21:31:13Z",
                            "expires_in": 86400
                        }
                    ],
                    "pagination": {
                        "has_more": true,
                        "cursor": "eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ"
                    }
                }
            },
            "ListSandboxImagesResponseV1": {
                "type": "object",
                "description": "One page of image repository summaries. Fetch tags through the separate tag listing endpoint.",
                "properties": {
                    "items": {
                        "type": "array",
                        "description": "Image repositories on this page.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxImageSummaryV1"
                        }
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/SandboxApiPaginationV1"
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ]
            },
            "ListSandboxImageTagsResponseV1": {
                "type": "object",
                "description": "One page of image tags.",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SandboxImageTagV1"
                        }
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/SandboxApiPaginationV1"
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ]
            },
            "SandboxImageStatusV1": {
                "type": "string",
                "description": "Image processing status. Only BUILT images are ready to use.",
                "enum": [
                    "UPLOADING",
                    "BUILDING",
                    "BUILT",
                    "FAILED"
                ],
                "readOnly": true,
                "example": "BUILT"
            },
            "SandboxImageTagV1": {
                "type": "object",
                "description": "A tag identifying a version of a sandbox image.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Image tag name.",
                        "example": "latest"
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Time the tag was created.",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-09-16T21:20:00Z"
                    },
                    "updated_at": {
                        "type": "string",
                        "description": "Time the tag was last updated.",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-09-16T21:25:00Z"
                    },
                    "size": {
                        "type": "integer",
                        "description": "Image size in bytes.",
                        "format": "int64",
                        "minimum": 0,
                        "readOnly": true,
                        "example": 134217728
                    }
                },
                "required": [
                    "name"
                ],
                "example": {
                    "name": "latest",
                    "created_at": "2026-09-16T21:20:00Z",
                    "updated_at": "2026-09-16T21:25:00Z",
                    "size": 134217728
                }
            },
            "SandboxImageSummaryV1": {
                "type": "object",
                "description": "Sandbox image repository summary. Fetch tags through GET /sandboxes/images/{image_name}/tags.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Stable repository name supplied when pushing the image.",
                        "example": "base-image"
                    },
                    "status": {
                        "description": "Image processing status. Only BUILT images are ready to use.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxImageStatusV1"
                            }
                        ],
                        "example": "BUILT"
                    },
                    "created_at": {
                        "type": "string",
                        "description": "Time the image was created.",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-09-15T21:20:00Z"
                    },
                    "updated_at": {
                        "type": "string",
                        "description": "Time the image was last updated.",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-09-16T21:25:00Z"
                    },
                    "last_deployed_at": {
                        "type": "string",
                        "description": "Most recent deployment time across all tags, if deployed.",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-09-16T21:26:58.545765901Z"
                    },
                    "size": {
                        "type": "integer",
                        "description": "Total repository size in bytes.",
                        "format": "int64",
                        "minimum": 0,
                        "readOnly": true,
                        "example": 260046848
                    },
                    "tag_count": {
                        "type": "integer",
                        "format": "int64",
                        "minimum": 0,
                        "readOnly": true,
                        "description": "Number of image versions in the repository.",
                        "example": 2
                    }
                },
                "required": [
                    "name",
                    "status"
                ],
                "example": {
                    "name": "base-image",
                    "status": "BUILT",
                    "created_at": "2026-09-15T21:20:00Z",
                    "updated_at": "2026-09-16T21:25:00Z",
                    "last_deployed_at": "2026-09-16T21:26:58.545765901Z",
                    "size": 260046848,
                    "tag_count": 2
                }
            },
            "SandboxImageV1": {
                "description": "Sandbox image repository. Get operations return a summary with an empty tags array.",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SandboxImageSummaryV1"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "tags": {
                                "type": "array",
                                "description": "Empty for get summary responses. Use GET /sandboxes/images/{image_name}/tags to retrieve paginated image versions.",
                                "items": {
                                    "$ref": "#/components/schemas/SandboxImageTagV1"
                                },
                                "example": []
                            }
                        },
                        "required": [
                            "tags"
                        ]
                    }
                ],
                "example": {
                    "name": "base-image",
                    "status": "BUILT",
                    "created_at": "2026-09-15T21:20:00Z",
                    "updated_at": "2026-09-16T21:25:00Z",
                    "last_deployed_at": "2026-09-16T21:26:58.545765901Z",
                    "size": 260046848,
                    "tag_count": 2,
                    "tags": []
                }
            },
            "PushSandboxImageRequestV1": {
                "type": "object",
                "description": "Push a sandbox image from a source archive or an existing registry image.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Target image repository name. Reusing a name pushes a new version to the existing repository.",
                        "minLength": 1,
                        "example": "base-image"
                    },
                    "image": {
                        "type": "string",
                        "description": "Optional source registry image reference including a registry hostname. When omitted, the response provides an archive upload URL. The uploaded ZIP archive must not exceed 5 GB.",
                        "example": "docker.io/b10/base-image:latest"
                    },
                    "docker_config": {
                        "type": "string",
                        "description": "Optional serialized registry authentication configuration for importing a private image. Used only when image is supplied; never returned.",
                        "writeOnly": true,
                        "example": "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"YjEwLXJldmlldzpkZW1vLW5vdC1hLXZhbGlkLXJlZ2lzdHJ5LXRva2Vu\"}}}"
                    }
                },
                "required": [
                    "name"
                ],
                "example": {
                    "name": "base-image",
                    "image": "docker.io/b10/base-image:latest",
                    "docker_config": "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"YjEwLXJldmlldzpkZW1vLW5vdC1hLXZhbGlkLXJlZ2lzdHJ5LXRva2Vu\"}}}"
                }
            },
            "PushSandboxImageResponseV1": {
                "type": "object",
                "description": "Accepted image push. Acceptance does not imply readiness; poll GET /sandboxes/images/{image_name} until status is BUILT or FAILED.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Target image repository name.",
                        "example": "base-image"
                    },
                    "status": {
                        "description": "Image processing status. Only BUILT images are ready to use.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxImageStatusV1"
                            }
                        ],
                        "example": "BUILDING"
                    },
                    "upload_url": {
                        "type": "string",
                        "description": "Temporary signed URL for uploading the source ZIP archive with HTTP PUT. Present only when no source image was supplied. The uploaded ZIP archive must not exceed 5 GB. Uploading starts asynchronous processing. This storage upload is separate from the API endpoints.",
                        "format": "uri",
                        "example": "https://uploads.b10.run/images/base-image/20260916212658/source.zip?expires=2026-09-16T22%3A26%3A58Z&signature=demo-not-a-valid-upload-signature"
                    },
                    "image": {
                        "type": "string",
                        "description": "Registered image reference including its tag, when available. Tags are assigned by the service; GET /sandboxes/images/{image_name} returns the available tags once processing completes.",
                        "example": "b10/base-image:latest"
                    }
                },
                "required": [
                    "name",
                    "status"
                ],
                "example": {
                    "name": "base-image",
                    "status": "BUILDING",
                    "image": "b10/base-image:latest"
                }
            },
            "SandboxLibraryImageVolumeV1": {
                "type": "object",
                "description": "Volume attachment suggested by a built-in image.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Volume name, or an internal identifier for ephemeral volumes.",
                        "example": "scratch"
                    },
                    "mount_path": {
                        "type": "string",
                        "description": "Absolute filesystem path where the volume is mounted.",
                        "example": "/mnt/data"
                    },
                    "type": {
                        "type": "string",
                        "description": "Volume type, persistent when empty.",
                        "example": "ephemeral"
                    },
                    "size_mb": {
                        "type": "integer",
                        "description": "Storage capacity in megabytes for ephemeral volumes.",
                        "example": 10240
                    },
                    "read_only": {
                        "type": "boolean",
                        "description": "Whether the volume is mounted read-only.",
                        "example": false
                    }
                },
                "required": [
                    "name",
                    "mount_path"
                ]
            },
            "SandboxLibraryImageCreationOptionsV1": {
                "type": "object",
                "description": "Optional settings suggested when creating a sandbox from this image.",
                "properties": {
                    "extra_args": {
                        "type": "object",
                        "description": "Kernel selection arguments.",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "volumes": {
                        "type": "array",
                        "description": "Volume attachments.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxLibraryImageVolumeV1"
                        }
                    }
                }
            },
            "SandboxLibraryImageV1": {
                "type": "object",
                "description": "Built-in sandbox image usable directly as a sandbox image.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Stable identifier of the built-in image.",
                        "example": "base-image"
                    },
                    "display_name": {
                        "type": "string",
                        "description": "Human-readable name.",
                        "example": "Base Image"
                    },
                    "description": {
                        "type": "string",
                        "description": "Short description.",
                        "example": "A minimal sandbox environment with the sandbox execution API."
                    },
                    "long_description": {
                        "type": "string",
                        "description": "Detailed description."
                    },
                    "image": {
                        "type": "string",
                        "description": "Image reference including its tag, usable as the image of a sandbox.",
                        "example": "baseten/base-image:latest"
                    },
                    "memory": {
                        "type": "integer",
                        "description": "Recommended memory allocation in megabytes.",
                        "example": 4096
                    },
                    "ports": {
                        "$ref": "#/components/schemas/SandboxPortsV1"
                    },
                    "categories": {
                        "type": "array",
                        "description": "Categories of the image.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "tags": {
                        "type": "array",
                        "description": "Tags of the image.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "url": {
                        "type": "string",
                        "description": "Documentation URL."
                    },
                    "icon": {
                        "type": "string",
                        "description": "Icon URL."
                    },
                    "icon_light": {
                        "type": "string",
                        "description": "Light-mode icon URL."
                    },
                    "icon_dark": {
                        "type": "string",
                        "description": "Dark-mode icon URL."
                    },
                    "enterprise": {
                        "type": "boolean",
                        "description": "Whether the image requires an enterprise plan.",
                        "example": false
                    },
                    "hidden": {
                        "type": "boolean",
                        "description": "Whether the image is hidden. Always false in listings.",
                        "example": false
                    },
                    "coming_soon": {
                        "type": "boolean",
                        "description": "Whether the image is not yet available. Always false in listings.",
                        "example": false
                    },
                    "creation_options": {
                        "$ref": "#/components/schemas/SandboxLibraryImageCreationOptionsV1"
                    }
                },
                "required": [
                    "name",
                    "image"
                ]
            },
            "ListSandboxLibraryImagesResponseV1": {
                "type": "object",
                "description": "Built-in sandbox images.",
                "properties": {
                    "items": {
                        "type": "array",
                        "description": "Built-in images.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxLibraryImageV1"
                        }
                    }
                },
                "required": [
                    "items"
                ]
            },
            "CleanupSandboxImagesResponseV1": {
                "type": "object",
                "description": "Result of cleaning up unused sandbox images.",
                "properties": {
                    "deleted": {
                        "type": "integer",
                        "description": "Number of image versions removed.",
                        "minimum": 0,
                        "example": 3
                    },
                    "message": {
                        "type": "string",
                        "description": "Human-readable cleanup result.",
                        "example": "Removed 3 unused image versions. Image versions used by active sandboxes were retained."
                    }
                },
                "required": [
                    "deleted",
                    "message"
                ],
                "example": {
                    "deleted": 3,
                    "message": "Removed 3 unused image versions. Image versions used by active sandboxes were retained."
                }
            }
        },
        "parameters": {
            "volume_sync_id": {
                "schema": {
                    "type": "string"
                },
                "name": "volume_sync_id",
                "in": "path",
                "required": true
            },
            "volume_namespace": {
                "schema": {
                    "type": "string"
                },
                "name": "volume_namespace",
                "in": "path",
                "required": true
            },
            "volume_name": {
                "schema": {
                    "type": "string"
                },
                "name": "volume_name",
                "in": "path",
                "required": true
            },
            "volume_version": {
                "schema": {
                    "type": "string"
                },
                "name": "volume_version",
                "in": "path",
                "required": true
            },
            "secret_name": {
                "schema": {
                    "type": "string"
                },
                "name": "secret_name",
                "in": "path",
                "required": true
            },
            "team_id": {
                "schema": {
                    "type": "string"
                },
                "name": "team_id",
                "in": "path",
                "required": true
            },
            "env_name": {
                "schema": {
                    "type": "string"
                },
                "name": "env_name",
                "in": "path",
                "required": true
            },
            "model_id": {
                "schema": {
                    "type": "string"
                },
                "name": "model_id",
                "in": "path",
                "required": true
            },
            "deployment_id": {
                "schema": {
                    "type": "string"
                },
                "name": "deployment_id",
                "in": "path",
                "required": true
            },
            "replica_id": {
                "schema": {
                    "type": "string"
                },
                "name": "replica_id",
                "in": "path",
                "required": true
            },
            "chain_id": {
                "schema": {
                    "type": "string"
                },
                "name": "chain_id",
                "in": "path",
                "required": true
            },
            "chain_deployment_id": {
                "schema": {
                    "type": "string"
                },
                "name": "chain_deployment_id",
                "in": "path",
                "required": true
            },
            "chainlet_id": {
                "schema": {
                    "type": "string"
                },
                "name": "chainlet_id",
                "in": "path",
                "required": true
            },
            "training_project_id": {
                "schema": {
                    "type": "string"
                },
                "name": "training_project_id",
                "in": "path",
                "required": true
            },
            "training_job_id": {
                "schema": {
                    "type": "string"
                },
                "name": "training_job_id",
                "in": "path",
                "required": true
            },
            "session_id": {
                "schema": {
                    "type": "string"
                },
                "name": "session_id",
                "in": "path",
                "required": true
            },
            "run_id": {
                "schema": {
                    "type": "string"
                },
                "name": "run_id",
                "in": "path",
                "required": true
            },
            "sampler_id": {
                "schema": {
                    "type": "string"
                },
                "name": "sampler_id",
                "in": "path",
                "required": true
            },
            "checkpoint_id": {
                "schema": {
                    "type": "string"
                },
                "name": "checkpoint_id",
                "in": "path",
                "required": true
            },
            "api_key_prefix": {
                "schema": {
                    "type": "string"
                },
                "name": "api_key_prefix",
                "in": "path",
                "required": true
            },
            "model_api_name": {
                "schema": {
                    "type": "string"
                },
                "name": "model_api_name",
                "in": "path",
                "required": true
            },
            "user_defined_listing_id": {
                "schema": {
                    "type": "string"
                },
                "name": "user_defined_listing_id",
                "in": "path",
                "required": true
            },
            "version_tag": {
                "schema": {
                    "type": "string"
                },
                "name": "version_tag",
                "in": "path",
                "required": true
            },
            "user_id": {
                "schema": {
                    "type": "string"
                },
                "name": "user_id",
                "in": "path",
                "required": true
            },
            "connection_id": {
                "schema": {
                    "type": "string"
                },
                "name": "connection_id",
                "in": "path",
                "required": true
            },
            "route_id": {
                "schema": {
                    "type": "string"
                },
                "name": "route_id",
                "in": "path",
                "required": true
            },
            "endpoint_id": {
                "schema": {
                    "type": "string"
                },
                "name": "endpoint_id",
                "in": "path",
                "required": true
            },
            "group_id": {
                "schema": {
                    "type": "string"
                },
                "name": "group_id",
                "in": "path",
                "required": true
            },
            "TeamId": {
                "name": "team_id",
                "in": "query",
                "required": false,
                "description": "Optional team ID. Must match X-Team-Id when both are supplied. If neither selector is supplied, defaults to the caller's only accessible team. Callers with multiple accessible teams must select a team. Requests without access to any team are forbidden.",
                "schema": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "TeamIdHeader": {
                "name": "X-Team-Id",
                "in": "header",
                "required": false,
                "description": "Optional team ID. Must match the team_id query parameter when both are supplied. If neither selector is supplied, defaults to the caller's only accessible team. Callers with multiple accessible teams must select a team. Requests without access to any team are forbidden.",
                "schema": {
                    "type": "string",
                    "minLength": 1
                }
            },
            "SandboxName": {
                "name": "sandbox_name",
                "in": "path",
                "required": true,
                "description": "Immutable sandbox name returned by creation.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "example": "baseten-api-review-0916"
                }
            },
            "SandboxImageName": {
                "name": "image_name",
                "in": "path",
                "required": true,
                "description": "Image repository name.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "example": "base-image"
                }
            },
            "TagName": {
                "name": "tag_name",
                "in": "path",
                "required": true,
                "description": "Image tag name.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "example": "20260915212000"
                }
            },
            "Cursor": {
                "name": "cursor",
                "in": "query",
                "required": false,
                "description": "Opaque cursor from the previous page; omit for the first page.",
                "schema": {
                    "type": "string",
                    "example": "eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ"
                }
            },
            "Limit": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "Maximum number of items to return.",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20,
                    "example": 20
                }
            }
        },
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Send `Authorization: Bearer <api_key>`. The legacy `Authorization: Api-Key <api_key>` scheme is also accepted."
            }
        },
        "responses": {
            "SandboxError400": {
                "description": "Invalid request. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "INVALID_REQUEST",
                            "message": "One or more request parameters are invalid.",
                            "details": {
                                "request_id": "a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043"
                            }
                        }
                    }
                }
            },
            "SandboxError401": {
                "description": "Missing or invalid authentication. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "UNAUTHORIZED",
                            "message": "Provide a valid authentication token in the Authorization header.",
                            "details": {
                                "header": "Authorization"
                            }
                        }
                    }
                }
            },
            "SandboxError403": {
                "description": "Insufficient permissions. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "FORBIDDEN",
                            "message": "This authentication token does not grant permission to perform this operation.",
                            "details": {
                                "request_id": "a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043"
                            }
                        }
                    }
                }
            },
            "SandboxError404": {
                "description": "Resource not found. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "NOT_FOUND",
                            "message": "The requested resource was not found.",
                            "details": {
                                "request_id": "a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043"
                            }
                        }
                    }
                }
            },
            "SandboxError409": {
                "description": "Resource is currently in use or conflicts with the requested operation. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "RESOURCE_IN_USE",
                            "message": "The resource is currently in use or conflicts with the requested operation.",
                            "details": {
                                "request_id": "a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043"
                            }
                        }
                    }
                }
            },
            "SandboxError429": {
                "description": "Request limit exceeded. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "RATE_LIMITED",
                            "message": "Too many requests. Try again in 30 seconds.",
                            "details": {
                                "retry_after_seconds": 30
                            }
                        }
                    }
                }
            },
            "SandboxError500": {
                "description": "Internal server error. Returns a JSON error with code, message, and optional details.",
                "content": {
                    "application/json": {
                        "example": {
                            "code": "INTERNAL_ERROR",
                            "message": "The request could not be completed. Try again later.",
                            "details": {
                                "request_id": "a3b7c4d2-91e6-4f08-9b5a-2c6d7e8f1043"
                            }
                        }
                    }
                }
            }
        },
        "examples": {
            "CreateSandboxQuickstart": {
                "summary": "Run code with the built-in image",
                "description": "Create directly with the built-in image; no image discovery, build, or push is needed. Use the returned url to call the sandbox execution API with your authentication token as a Bearer token, not your Baseten API key.",
                "value": {
                    "image": "baseten/base-image:latest",
                    "memory": 2048,
                    "region": "us-was-1"
                }
            },
            "CreateSandbox": {
                "summary": "Create with every supported field",
                "value": {
                    "name": "baseten-api-review-0916",
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    },
                                    "secrets": {
                                        "openai-key": "sk-proj-demo-not-a-valid-api-key"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering"
                    }
                },
                "description": "All supported request fields are shown. Credential values are nonfunctional demonstration values."
            },
            "UpdateSandbox": {
                "summary": "Update every mutable field",
                "value": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering",
                        "revision": "2"
                    }
                },
                "description": "All mutable request fields are shown. Memory and network configuration are only accepted during creation."
            },
            "SandboxReady": {
                "summary": "Running sandbox with complete configuration",
                "value": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering"
                    },
                    "name": "baseten-api-review-0916",
                    "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                    "status": "DEPLOYED",
                    "created_at": "2026-09-16T21:26:58.545765901Z",
                    "updated_at": "2026-09-16T21:31:13Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation",
                    "last_used_at": "2026-09-16T21:31:13Z",
                    "expires_in": 86400
                },
                "description": "Example sandbox URL in the b10.run domain. Write-only proxy secrets are not returned. Other values illustrate a fully configured sandbox."
            },
            "SandboxUpdated": {
                "summary": "Updated sandbox with complete configuration",
                "value": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering",
                        "revision": "2"
                    },
                    "name": "baseten-api-review-0916",
                    "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                    "status": "DEPLOYED",
                    "created_at": "2026-09-16T21:26:58.545765901Z",
                    "updated_at": "2026-09-16T21:36:13Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation",
                    "last_used_at": "2026-09-16T21:36:13Z",
                    "expires_in": 86400
                }
            },
            "SandboxDeleting": {
                "summary": "Sandbox deletion accepted",
                "value": {
                    "lifecycle": {
                        "expiration_policies": [
                            {
                                "action": "DELETE",
                                "type": "TTL_IDLE",
                                "value": "24h"
                            },
                            {
                                "action": "DELETE",
                                "type": "TTL_MAX_AGE",
                                "value": "7d"
                            },
                            {
                                "action": "DELETE",
                                "type": "DATE",
                                "value": "2026-09-23T21:26:58Z"
                            }
                        ],
                        "terminated_retention": "24h"
                    },
                    "network": {
                        "proxy": {
                            "allowed_domains": [
                                "api.openai.com",
                                "pypi.org",
                                "files.pythonhosted.org",
                                "registry.npmjs.org"
                            ],
                            "bypass": [
                                "registry.npmjs.org"
                            ],
                            "forbidden_domains": [
                                "facebook.com",
                                "*.facebook.com"
                            ],
                            "routing": [
                                {
                                    "destinations": [
                                        "api.openai.com"
                                    ],
                                    "headers": {
                                        "Authorization": "Bearer {{SECRET:openai-key}}"
                                    },
                                    "body": {
                                        "user": "baseten-api-review-0916"
                                    }
                                }
                            ]
                        },
                        "subnet": "default"
                    },
                    "region": "us-pdx-1",
                    "envs": [
                        {
                            "name": "NODE_ENV",
                            "secret": false,
                            "value": "production"
                        },
                        {
                            "name": "PORT",
                            "secret": false,
                            "value": "3000"
                        }
                    ],
                    "image": "baseten/base-image:latest",
                    "memory": 4096,
                    "ports": [
                        {
                            "name": "http",
                            "protocol": "HTTP",
                            "target": 3000
                        }
                    ],
                    "external_id": "api-review-20260916-001",
                    "labels": {
                        "env": "development",
                        "project": "api-review",
                        "team": "engineering"
                    },
                    "name": "baseten-api-review-0916",
                    "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                    "status": "DELETING",
                    "created_at": "2026-09-16T21:26:58.545765901Z",
                    "updated_at": "2026-09-16T21:41:13Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation",
                    "last_used_at": "2026-09-16T21:31:13Z",
                    "expires_in": 85800
                }
            },
            "SandboxesPage": {
                "summary": "Sandbox page with another page available",
                "value": {
                    "items": [
                        {
                            "lifecycle": {
                                "expiration_policies": [
                                    {
                                        "action": "DELETE",
                                        "type": "TTL_IDLE",
                                        "value": "24h"
                                    },
                                    {
                                        "action": "DELETE",
                                        "type": "TTL_MAX_AGE",
                                        "value": "7d"
                                    },
                                    {
                                        "action": "DELETE",
                                        "type": "DATE",
                                        "value": "2026-09-23T21:26:58Z"
                                    }
                                ],
                                "terminated_retention": "24h"
                            },
                            "network": {
                                "proxy": {
                                    "allowed_domains": [
                                        "api.openai.com",
                                        "pypi.org",
                                        "files.pythonhosted.org",
                                        "registry.npmjs.org"
                                    ],
                                    "bypass": [
                                        "registry.npmjs.org"
                                    ],
                                    "forbidden_domains": [
                                        "facebook.com",
                                        "*.facebook.com"
                                    ],
                                    "routing": [
                                        {
                                            "destinations": [
                                                "api.openai.com"
                                            ],
                                            "headers": {
                                                "Authorization": "Bearer {{SECRET:openai-key}}"
                                            },
                                            "body": {
                                                "user": "baseten-api-review-0916"
                                            }
                                        }
                                    ]
                                },
                                "subnet": "default"
                            },
                            "region": "us-pdx-1",
                            "envs": [
                                {
                                    "name": "NODE_ENV",
                                    "secret": false,
                                    "value": "production"
                                },
                                {
                                    "name": "PORT",
                                    "secret": false,
                                    "value": "3000"
                                }
                            ],
                            "image": "baseten/base-image:latest",
                            "memory": 4096,
                            "ports": [
                                {
                                    "name": "http",
                                    "protocol": "HTTP",
                                    "target": 3000
                                }
                            ],
                            "external_id": "api-review-20260916-001",
                            "labels": {
                                "env": "development",
                                "project": "api-review",
                                "team": "engineering"
                            },
                            "name": "baseten-api-review-0916",
                            "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                            "status": "DEPLOYED",
                            "created_at": "2026-09-16T21:26:58.545765901Z",
                            "updated_at": "2026-09-16T21:31:13Z",
                            "created_by": "sandbox-automation",
                            "updated_by": "sandbox-automation",
                            "last_used_at": "2026-09-16T21:31:13Z",
                            "expires_in": 86400
                        }
                    ],
                    "pagination": {
                        "has_more": true,
                        "cursor": "eyJ2IjoxLCJsYXN0X2tleSI6ImJhc2V0ZW4tYXBpLXJldmlldy0wOTE2Iiwic29ydCI6ImRlc2MifQ"
                    }
                },
                "description": "The cursor illustrates an opaque pagination token; it is not a reusable live cursor."
            },
            "SandboxesLastPage": {
                "summary": "Last sandbox page",
                "value": {
                    "items": [
                        {
                            "lifecycle": {
                                "expiration_policies": [
                                    {
                                        "action": "DELETE",
                                        "type": "TTL_IDLE",
                                        "value": "24h"
                                    },
                                    {
                                        "action": "DELETE",
                                        "type": "TTL_MAX_AGE",
                                        "value": "7d"
                                    },
                                    {
                                        "action": "DELETE",
                                        "type": "DATE",
                                        "value": "2026-09-23T21:26:58Z"
                                    }
                                ],
                                "terminated_retention": "24h"
                            },
                            "network": {
                                "proxy": {
                                    "allowed_domains": [
                                        "api.openai.com",
                                        "pypi.org",
                                        "files.pythonhosted.org",
                                        "registry.npmjs.org"
                                    ],
                                    "bypass": [
                                        "registry.npmjs.org"
                                    ],
                                    "forbidden_domains": [
                                        "facebook.com",
                                        "*.facebook.com"
                                    ],
                                    "routing": [
                                        {
                                            "destinations": [
                                                "api.openai.com"
                                            ],
                                            "headers": {
                                                "Authorization": "Bearer {{SECRET:openai-key}}"
                                            },
                                            "body": {
                                                "user": "baseten-api-review-0916"
                                            }
                                        }
                                    ]
                                },
                                "subnet": "default"
                            },
                            "region": "us-pdx-1",
                            "envs": [
                                {
                                    "name": "NODE_ENV",
                                    "secret": false,
                                    "value": "production"
                                },
                                {
                                    "name": "PORT",
                                    "secret": false,
                                    "value": "3000"
                                }
                            ],
                            "image": "baseten/base-image:latest",
                            "memory": 4096,
                            "ports": [
                                {
                                    "name": "http",
                                    "protocol": "HTTP",
                                    "target": 3000
                                }
                            ],
                            "external_id": "api-review-20260916-001",
                            "labels": {
                                "env": "development",
                                "project": "api-review",
                                "team": "engineering"
                            },
                            "name": "baseten-api-review-0916",
                            "url": "https://sbx-baseten-api-review-0916-esb1qo.us-pdx-1.b10.run",
                            "status": "DEPLOYED",
                            "created_at": "2026-09-16T21:26:58.545765901Z",
                            "updated_at": "2026-09-16T21:31:13Z",
                            "created_by": "sandbox-automation",
                            "updated_by": "sandbox-automation",
                            "last_used_at": "2026-09-16T21:31:13Z",
                            "expires_in": 86400
                        }
                    ],
                    "pagination": {
                        "has_more": false
                    }
                }
            },
            "ImageReady": {
                "summary": "Built image with all metadata and tags",
                "value": {
                    "name": "base-image",
                    "status": "BUILT",
                    "created_at": "2026-09-15T21:20:00Z",
                    "updated_at": "2026-09-16T21:25:00Z",
                    "last_deployed_at": "2026-09-16T21:26:58.545765901Z",
                    "size": 260046848,
                    "tags": [
                        {
                            "name": "latest",
                            "created_at": "2026-09-16T21:20:00Z",
                            "updated_at": "2026-09-16T21:25:00Z",
                            "size": 134217728
                        },
                        {
                            "name": "20260915212000",
                            "created_at": "2026-09-15T21:20:00Z",
                            "updated_at": "2026-09-15T21:25:00Z",
                            "size": 125829120
                        }
                    ]
                },
                "description": "Dates and byte sizes are representative example data. Image references use the b10 namespace."
            },
            "ImageAfterTagDeletion": {
                "summary": "Image after deleting its older tag",
                "value": {
                    "name": "base-image",
                    "status": "BUILT",
                    "created_at": "2026-09-15T21:20:00Z",
                    "updated_at": "2026-09-16T21:41:13Z",
                    "last_deployed_at": "2026-09-16T21:26:58.545765901Z",
                    "size": 134217728,
                    "tags": [
                        {
                            "name": "latest",
                            "created_at": "2026-09-16T21:20:00Z",
                            "updated_at": "2026-09-16T21:25:00Z",
                            "size": 134217728
                        }
                    ]
                }
            },
            "ImageSummary": {
                "summary": "Image repository summary",
                "value": {
                    "name": "base-image",
                    "status": "BUILT",
                    "created_at": "2026-09-15T21:20:00Z",
                    "size": 260046848,
                    "tag_count": 2,
                    "tags": []
                }
            },
            "ImagesList": {
                "summary": "One page of image repositories",
                "value": {
                    "items": [
                        {
                            "name": "base-image",
                            "status": "BUILT",
                            "created_at": "2026-09-15T21:20:00Z",
                            "updated_at": "2026-09-16T21:25:00Z",
                            "last_deployed_at": "2026-09-16T21:26:58.545765901Z",
                            "size": 260046848,
                            "tag_count": 2
                        }
                    ],
                    "pagination": {
                        "has_more": false
                    }
                }
            },
            "PushArchive": {
                "summary": "Build an image from an uploaded source archive",
                "value": {
                    "name": "base-image"
                },
                "description": "Omit image and docker_config to request an upload URL. Those fields do not apply to source-archive uploads."
            },
            "PushRegistry": {
                "summary": "Import an image with registry authentication",
                "value": {
                    "name": "base-image",
                    "image": "docker.io/b10/base-image:latest",
                    "docker_config": "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"YjEwLXJldmlldzpkZW1vLW5vdC1hLXZhbGlkLXJlZ2lzdHJ5LXRva2Vu\"}}}"
                },
                "description": "Shows every request field. docker_config is serialized registry configuration with a deliberately invalid demonstration credential."
            },
            "PushArchiveAccepted": {
                "summary": "Source upload required",
                "value": {
                    "name": "base-image",
                    "status": "UPLOADING",
                    "upload_url": "https://uploads.b10.run/images/base-image/20260916212658/source.zip?expires=2026-09-16T22%3A26%3A58Z&signature=demo-not-a-valid-upload-signature"
                },
                "description": "The signed upload URL is illustrative, with a nonfunctional signature. image is unavailable until processing produces a registered image reference."
            },
            "PushRegistryAccepted": {
                "summary": "Image import accepted",
                "value": {
                    "name": "base-image",
                    "status": "BUILDING",
                    "image": "b10/base-image:latest"
                },
                "description": "No upload_url is returned for registry imports."
            },
            "SandboxLibraryImages": {
                "summary": "Built-in sandbox images",
                "value": {
                    "items": [
                        {
                            "name": "base-image",
                            "display_name": "Base Image",
                            "description": "A minimal sandbox environment with the sandbox execution API.",
                            "long_description": "",
                            "image": "baseten/base-image:latest",
                            "memory": 4096,
                            "ports": [
                                {
                                    "name": "sandbox-api",
                                    "protocol": "HTTP",
                                    "target": 8080
                                }
                            ],
                            "categories": [],
                            "tags": [],
                            "url": "",
                            "icon": "https://example.com/base-image.png",
                            "icon_light": "https://example.com/base-image.png",
                            "icon_dark": "https://example.com/base-image.png",
                            "enterprise": false,
                            "hidden": false,
                            "coming_soon": false
                        }
                    ]
                }
            },
            "CleanupImages": {
                "summary": "Unused image versions removed",
                "value": {
                    "deleted": 3,
                    "message": "Removed 3 unused image versions. Image versions used by active sandboxes were retained."
                }
            }
        }
    }
}