{
    "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. A page can hold fewer volumes than `limit`, or none, while more remain, so keep requesting with the returned cursor until `has_more` is false.",
                "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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  \"hosting\": 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, 'hosting': 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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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"
                                }
                            }
                        }
                    }
                }
            },
            "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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"
                                }
                            }
                        }
                    }
                }
            },
            "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"
                                }
                            }
                        }
                    }
                }
            },
            "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"
                                }
                            }
                        }
                    }
                }
            },
            "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"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a volume",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"expires_at\": \"2030-01-01T00:00:00Z\",\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    \"PATCH\",\n    url,\n    headers=headers,\n    json={'expires_at': '2030-01-01T00:00:00Z', 'expected_sequence': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a volume's settings, such as its expiration time. Only the settings in the request change.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PatchVolumeRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PatchVolumeResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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"
                                }
                            }
                        }
                    }
                }
            },
            "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"
                                }
                            }
                        }
                    }
                }
            },
            "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                },
                {
                    "$ref": "#/components/parameters/volume_version"
                }
            ]
        },
        "/v1/volumes/{volume_namespace}/{volume_name}/tags": {
            "post": {
                "summary": "Sets a volume tag",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/tags \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"tag\": \"nightly\",\n  \"version\": \"head\",\n  \"expires_at\": null,\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}/tags\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'tag': 'nightly', 'version': 'head', 'expires_at': None, 'expected_sequence': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Setting an existing tag overwrites it. The previous version remains available by digest. Pass `expires_at` to set the tag's expiration time. Omit `expires_at` to clear any expiration time on the tag. Version or volume expiration still deletes the tag. Setting `head` changes the version used by references without a tag or digest. You cannot set `head` on an expiring version or supply `expires_at` when setting `head`.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SetVolumeTagRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SetVolumeTagResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                }
            ]
        },
        "/v1/volumes/{volume_namespace}/{volume_name}/tags/{volume_tag}": {
            "delete": {
                "summary": "Deletes a volume tag",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/volumes/{volume_namespace}/{volume_name}/tags/{volume_tag} \\\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}/tags/{volume_tag}\"\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": "The version remains available by digest and any other tags. If the tag is absent, the request succeeds with `deleted` set to `false`. Deleting `head` makes references without a tag or digest stop resolving until `head` is set again.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DeleteVolumeTagRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeleteVolumeTagResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/volume_namespace"
                },
                {
                    "$ref": "#/components/parameters/volume_name"
                },
                {
                    "$ref": "#/components/parameters/volume_tag"
                }
            ]
        },
        "/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    \"autoscaling_settings\": {\n      \"max_replica\": 4,\n      \"min_replica\": 2\n    },\n    \"request_backpressure_settings\": {\n      \"policy\": \"REJECT_ON_FULL\"\n    },\n    \"autoscaling_schedule_settings\": null,\n    \"promotion_settings_override\": {\n      \"rolling_deploy_config\": {\n        \"max_surge_percent\": 50\n      }\n    },\n    \"instance_type_id\": 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, 'autoscaling_settings': {'max_replica': 4, 'min_replica': 2}, 'request_backpressure_settings': {'policy': 'REJECT_ON_FULL'}, 'autoscaling_schedule_settings': None, 'promotion_settings_override': {'rolling_deploy_config': {'max_surge_percent': 50}}, 'instance_type_id': 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. Requires a personal API key; team API keys can't read the workspace audit log. 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  \"environment_settings_update\": {\n    \"autoscaling_settings\": {\n      \"max_replica\": 4,\n      \"min_replica\": 2\n    }\n  },\n  \"promotion_settings_override\": {\n    \"rolling_deploy_config\": {\n      \"max_surge_percent\": 50\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/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, 'environment_settings_update': {'autoscaling_settings': {'max_replica': 4, 'min_replica': 2}}, 'promotion_settings_override': {'rolling_deploy_config': {'max_surge_percent': 50}}}\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  \"environment_settings_update\": {\n    \"autoscaling_settings\": {\n      \"max_replica\": 4,\n      \"min_replica\": 2\n    }\n  },\n  \"promotion_settings_override\": {\n    \"rolling_deploy_config\": {\n      \"max_surge_percent\": 50\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/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, 'environment_settings_update': {'autoscaling_settings': {'max_replica': 4, 'min_replica': 2}}, 'promotion_settings_override': {'rolling_deploy_config': {'max_surge_percent': 50}}}\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/MetricModeV1",
                            "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/GetMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/startups": {
            "get": {
                "summary": "Lists the startups of a model deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/startups \\\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}/startups\"\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, 'min_duration_ms': None, 'cursor': None, 'phase': None, 'search': None, 'sort_by': None, 'direction': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists replica startups in the given time range, newest first by default. Pass the `cursor` from a response to fetch the next page.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "Start of the query window, in epoch milliseconds.",
                        "schema": {
                            "title": "Start Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "End of the query window, in epoch milliseconds. Must be after the start.",
                        "schema": {
                            "title": "End Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "min_duration_ms",
                        "in": "query",
                        "required": false,
                        "description": "Only include startups that lasted at least this many milliseconds.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minimum": 0,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Min Duration Ms"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page. Pass the same filters and sort as the request that returned it.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of attempts to return.",
                        "schema": {
                            "default": 50,
                            "maximum": 100,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "outcomes",
                        "in": "query",
                        "required": false,
                        "description": "Only include attempts with one of these outcomes. Repeat to pass several.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/StartupOutcomeV1"
                            },
                            "title": "Outcomes",
                            "type": "array"
                        }
                    },
                    {
                        "name": "phase",
                        "in": "query",
                        "required": false,
                        "description": "Only include attempts that spent longer than 0 ms in this phase.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/StartupPhaseV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Only include attempts whose replica ID matches exactly, or whose deployment name contains this text (case-insensitive).",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "required": false,
                        "description": "Field to sort attempts by. Defaults to `STARTED_AT`.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/StartupSortFieldV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort direction. Defaults to `desc`.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StartupAttemptsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/startups/summary": {
            "get": {
                "summary": "Gets the startup summary 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}/startups/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/models/{model_id}/deployments/{deployment_id}/startups/summary\"\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, 'min_duration_ms': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the distribution of replica startup durations, in total and per phase, in the given time range.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "Start of the query window, in epoch milliseconds.",
                        "schema": {
                            "title": "Start Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "End of the query window, in epoch milliseconds. Must be after the start.",
                        "schema": {
                            "title": "End Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "min_duration_ms",
                        "in": "query",
                        "required": false,
                        "description": "Only include startups that lasted at least this many milliseconds.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minimum": 0,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Min Duration Ms"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StartupSummaryV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/replicas": {
            "get": {
                "summary": "Lists replicas for a deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas \\\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\"\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": "Includes terminated replicas and lifecycle information without metrics. Replicas are ordered by creation time, oldest first, with replica ID as a tie-breaker. For subsequent pages, pass pagination.cursor as cursor with unchanged filters. Cursors expire after one hour. Replica status may change between requests.",
                "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": "statuses",
                        "in": "query",
                        "required": false,
                        "description": "Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/DeploymentReplicaStatusV1"
                            },
                            "title": "Statuses",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentReplicasV1"
                                }
                            }
                        }
                    }
                }
            },
            "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. Returns 404 if no replica matches the replica ID. Returns 400 without requesting termination if multiple replicas match the replica ID.",
                "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"
                }
            ],
            "get": {
                "summary": "Gets a replica in a deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\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    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns lifecycle information without metrics, including for terminated replicas. Returns 404 if the replica does not exist in the specified deployment. Returns 400 if multiple replicas match the replica ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentReplicaV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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\": null,\n    \"ramp_up_while_promoting\": null,\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': None, 'ramp_up_while_promoting': None, '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\": null,\n    \"ramp_up_while_promoting\": null,\n    \"redeploy_on_promotion\": true,\n    \"rolling_deploy\": true,\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  \"traffic_routing_settings\": {\n    \"rules\": [\n      {\n        \"expires_at\": \"2026-10-13T18:00:00Z\",\n        \"percent_traffic\": 25,\n        \"propagate_client_cancellation\": true,\n        \"sampling_mode\": \"USER_SESSION\",\n        \"targets\": [\n          {\n            \"deployment_id\": \"abc123\"\n          }\n        ],\n        \"type\": \"SHADOW\"\n      }\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/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': None, 'ramp_up_while_promoting': None, 'redeploy_on_promotion': True, 'rolling_deploy': True, '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'}, 'traffic_routing_settings': {'rules': [{'expires_at': '2026-10-13T18:00:00Z', 'percent_traffic': 25, 'propagate_client_cancellation': True, 'sampling_mode': 'USER_SESSION', 'targets': [{'deployment_id': 'abc123'}], 'type': 'SHADOW'}]}}\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/MetricModeV1",
                            "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/GetMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/startups": {
            "get": {
                "summary": "Lists the startups of a model environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/startups \\\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}/startups\"\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, 'min_duration_ms': None, 'cursor': None, 'phase': None, 'search': None, 'sort_by': None, 'direction': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists replica startups of every deployment that was active on the environment in the given time range, newest first by default. Pass the `cursor` from a response to fetch the next page.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "Start of the query window, in epoch milliseconds.",
                        "schema": {
                            "title": "Start Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "End of the query window, in epoch milliseconds. Must be after the start.",
                        "schema": {
                            "title": "End Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "min_duration_ms",
                        "in": "query",
                        "required": false,
                        "description": "Only include startups that lasted at least this many milliseconds.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minimum": 0,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Min Duration Ms"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page. Pass the same filters and sort as the request that returned it.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of attempts to return.",
                        "schema": {
                            "default": 50,
                            "maximum": 100,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "outcomes",
                        "in": "query",
                        "required": false,
                        "description": "Only include attempts with one of these outcomes. Repeat to pass several.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/StartupOutcomeV1"
                            },
                            "title": "Outcomes",
                            "type": "array"
                        }
                    },
                    {
                        "name": "phase",
                        "in": "query",
                        "required": false,
                        "description": "Only include attempts that spent longer than 0 ms in this phase.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/StartupPhaseV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Only include attempts whose replica ID matches exactly, or whose deployment name contains this text (case-insensitive).",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Search"
                        }
                    },
                    {
                        "name": "sort_by",
                        "in": "query",
                        "required": false,
                        "description": "Field to sort attempts by. Defaults to `STARTED_AT`.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/StartupSortFieldV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort direction. Defaults to `desc`.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StartupAttemptsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/startups/summary": {
            "get": {
                "summary": "Gets the startup summary 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}/startups/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/models/{model_id}/environments/{env_name}/startups/summary\"\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, 'min_duration_ms': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gets the distribution of replica startup durations, in total and per phase, across every deployment that was active on the environment in the given time range.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "Start of the query window, in epoch milliseconds.",
                        "schema": {
                            "title": "Start Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": true,
                        "description": "End of the query window, in epoch milliseconds. Must be after the start.",
                        "schema": {
                            "title": "End Epoch Millis",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "min_duration_ms",
                        "in": "query",
                        "required": false,
                        "description": "Only include startups that lasted at least this many milliseconds.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minimum": 0,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Min Duration Ms"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StartupSummaryV1"
                                }
                            }
                        }
                    }
                },
                "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  \"environment_settings_update\": {\n    \"autoscaling_settings\": {\n      \"max_replica\": 4,\n      \"min_replica\": 2\n    }\n  },\n  \"promotion_settings_override\": {\n    \"rolling_deploy_config\": {\n      \"max_surge_percent\": 50\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/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, 'environment_settings_update': {'autoscaling_settings': {'max_replica': 4, 'min_replica': 2}}, 'promotion_settings_override': {'rolling_deploy_config': {'max_surge_percent': 50}}}\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/models/{model_id}/environments/{env_name}/replicas": {
            "get": {
                "summary": "Lists replicas for an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas \\\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}/replicas\"\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": "Includes retained terminated replicas from deployments active in the preceding hour. Orders replicas oldest first, with replica ID breaking ties. Pass pagination.cursor with unchanged filters for subsequent pages. Cursors pin deployment membership and expire after one hour.",
                "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": "statuses",
                        "in": "query",
                        "required": false,
                        "description": "Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/DeploymentReplicaStatusV1"
                            },
                            "title": "Statuses",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentReplicasV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/replicas/{replica_id}": {
            "delete": {
                "summary": "Terminates a replica in an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/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}/environments/{env_name}/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": "Requests replica termination in the environment's current deployment. Returns 404 if the environment has no current deployment or no replica matches the replica ID. Returns 400 without requesting termination if multiple replicas in the current deployment match the replica ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TerminateReplicaResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                },
                {
                    "$ref": "#/components/parameters/replica_id"
                }
            ],
            "get": {
                "summary": "Gets a replica in an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/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}/environments/{env_name}/replicas/{replica_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": "Searches deployments active in the environment during the preceding hour. Includes retained terminated replicas. Returns 404 if the replica is outside this scope. Returns 400 if multiple replicas match the replica ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentReplicaV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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    \"project_accelerator\": \"H100\"\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', 'project_accelerator': 'H100'}}\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    params={'name': None, 'cursor': None, 'limit': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the organization's training projects, newest first.",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "Return only the project with this exact name.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor from the pagination.cursor field of a previous response. Omit both cursor and limit to get every project in one response.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of projects to return, up to 1000.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Limit"
                        }
                    }
                ],
                "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    \"project_accelerator\": \"H100\"\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', 'project_accelerator': 'H100'}}\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    params={'cursor': None, 'limit': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the training project's jobs, newest first.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor from the pagination.cursor field of a previous response. Omit both cursor and limit to get every job in one response.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of jobs to return, newest first, up to 1000.",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Limit"
                        }
                    }
                ],
                "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    \"bdn\": {},\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        \"persistent_home\": false,\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': {'bdn': {}, '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', 'persistent_home': False, '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 (standard 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}/checkpoints/{checkpoint_id}/ttl": {
            "put": {
                "summary": "Sets a training job checkpoint's TTL",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PUT \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoints/{checkpoint_id}/ttl \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"ttl_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}/checkpoints/{checkpoint_id}/ttl\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PUT\",\n    url,\n    headers=headers,\n    json={'ttl_seconds': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Sets when a training job checkpoint expires, counted from now, or removes its TTL so it never expires. Once a job stops, a TTL can be set only after its checkpoint upload is confirmed as finished, which usually takes a few minutes. Checkpoints of a job whose upload is never confirmed, such as most that finished before checkpoint expiry was available, can't expire.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SetTrainingJobCheckpointTtlRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TrainingJobCheckpointV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                },
                {
                    "$ref": "#/components/parameters/checkpoint_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  \"cursor\": null,\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={'cursor': None, '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. Send the same filters with every page.",
                "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, 'enabled': True}\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. Models this workspace can run come first. Capacity is resolved when the run is created, not here. Pass ?enabled=true for only the models you can use. Pass ?model= to ask about one model \u2014 without ?enabled=, 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'. Without 'enabled', 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"
                        }
                    },
                    {
                        "name": "enabled",
                        "in": "query",
                        "required": false,
                        "description": "Pass true to list only the models this workspace can run now, or false for only the ones it cannot. Omit to list both. With 'model', an empty list can also mean the model is supported but filtered out.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "boolean"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                true
                            ],
                            "title": "Enabled"
                        }
                    }
                ],
                "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', 'session_id': 'k4q95w5', 'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops runs visible to the requesting user, optionally filtered by run id, base model, and/or session. 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": "session_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter runs by the session that created them. An unknown or inaccessible session returns an empty list.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Session Id"
                        }
                    },
                    {
                        "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  \"base_checkpoint\": null,\n  \"base_checkpoint_auth\": {\n    \"auth_method\": \"CUSTOM_SECRET\",\n    \"auth_secret_name\": \"hf_read_my_checkpoint\"\n  },\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, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, '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}": {
            "delete": {
                "summary": "Deletes a Loops run",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\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    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a Loops run by ID, deactivating it first if it is active, and deletes its checkpoints. Checkpoints still in use, such as deployed ones, are kept and listed in the response; they stay usable until that use stops. Deletion is permanent, and storage for some checkpoints is reclaimed later.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeleteLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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  \"base_checkpoint\": null,\n  \"base_checkpoint_auth\": {\n    \"auth_method\": \"CUSTOM_SECRET\",\n    \"auth_secret_name\": \"hf_read_my_checkpoint\"\n  },\n  \"scope\": \"default\"\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, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, 'scope': 'default'}\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={'session_id': 'k4q95w5', 'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops samplers (paired and standalone), optionally filtered by session. Defaults to the caller's own; pass ?scope=org to list every sampler in the caller's organization.",
                "parameters": [
                    {
                        "name": "session_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter samplers by the session that created them. An unknown or inaccessible session returns an empty list.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Session Id"
                        }
                    },
                    {
                        "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  \"scope\": \"default\"\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, 'scope': 'default'}\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  \"run_id\": \"k4q95w5\"\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', 'run_id': 'k4q95w5'}\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}": {
            "delete": {
                "summary": "Deletes a Loops checkpoint",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/loops/checkpoints/{checkpoint_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/checkpoints/{checkpoint_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 Loops checkpoint by ID and returns its tombstone. The checkpoint disappears from listings and can't be loaded, sampled, or deployed. Deletion is permanent, and storage for some checkpoints is reclaimed later. A checkpoint that is deployed, read by an unfinished LoRA merge, served by an active sampler, or the start of an active run can't be deleted, and the error says which. Deleting an already-deleted checkpoint returns the same tombstone.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoopsCheckpointTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/checkpoint_id"
                }
            ]
        },
        "/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/checkpoints/{checkpoint_id}/ttl": {
            "put": {
                "summary": "Sets a Loops checkpoint's TTL",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PUT \\\n--url https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/ttl \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"ttl_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/checkpoints/{checkpoint_id}/ttl\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PUT\",\n    url,\n    headers=headers,\n    json={'ttl_seconds': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Sets when a Loops checkpoint expires, counted from now, or removes its TTL so it's kept until you delete it. An expired checkpoint is deleted within 24 hours. If it's in use when it expires, it's deleted within 24 hours after it stops being used.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SetLoopsCheckpointTtlRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoopsCheckpointV1"
                                }
                            }
                        }
                    }
                }
            },
            "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 anyone with training access to 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', 'session_id': 'k4q95w5', '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, base model, and/or session.",
                "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": "session_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter runs by the session that created them. An unknown or inaccessible session returns an empty list.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Session Id"
                        }
                    },
                    {
                        "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  \"base_checkpoint\": null,\n  \"base_checkpoint_auth\": {\n    \"auth_method\": \"CUSTOM_SECRET\",\n    \"auth_secret_name\": \"hf_read_my_checkpoint\"\n  },\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, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, '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  \"base_checkpoint\": null,\n  \"base_checkpoint_auth\": {\n    \"auth_method\": \"CUSTOM_SECRET\",\n    \"auth_secret_name\": \"hf_read_my_checkpoint\"\n  },\n  \"scope\": \"default\"\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, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, 'scope': 'default'}\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={'session_id': 'k4q95w5', 'scope': 'org'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists Loops samplers (paired and standalone) in the given team, visible to the requesting user, optionally filtered by session. Defaults to the caller's own; pass ?scope=org to list every sampler in the team.",
                "parameters": [
                    {
                        "name": "session_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter samplers by the session that created them. An unknown or inaccessible session returns an empty list.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Session Id"
                        }
                    },
                    {
                        "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  \"scope\": \"default\"\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, 'scope': 'default'}\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 on-demand and spot GPU quotas and current usage for the teams you can view, plus organization-wide totals when you have organization-level access.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingGpuCapacityResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Sets a team's training GPU quota",
                "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 a team's GPU quota for a given type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota, and on-demand jobs can borrow past it from the organization's shared pool when one exists. Creates the quota if one doesn't exist for this (team, gpu_type) pair, otherwise updates it in place. Org-admin only: this is a quota 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 metadata with added-model details for teams where you can invoke Model APIs. Legacy Default Team fields remain deprecated but unchanged. Pass team_ids to narrow team details; unauthorized teams cause a 403. added_only=true returns models added by any team in scope. Models added in scope sort first, by their latest addition. Pagination is by model; cursor filters are preserved and reauthorized on every 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 items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "team_ids",
                        "in": "query",
                        "required": false,
                        "description": "Select teams for added-model details, filtering, and ordering, repeated once per team. Defaults to all teams where you can invoke Model APIs. Any unauthorized team causes a 403.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Team Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "added_only",
                        "in": "query",
                        "required": false,
                        "description": "When true, restrict the result to Model APIs added by any team where you can invoke Model APIs. Explicit team_ids narrow this to the selected teams. 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 Model APIs token usage for the teams you can manage as a series of contiguous time buckets, broken down by the dimensions you pass in group_by. Organization admins receive organization-wide totals by default; other callers may receive lower totals than callers with management-access to more teams. 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, or team. 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": "team_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these teams, repeated once per team. Defaults to all teams you can manage.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Team Ids",
                            "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}/metrics": {
            "get": {
                "summary": "Gets the metrics for a Model API",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis/{model_api_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/model_apis/{model_api_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 the metrics for a Model API in the given time range for the teams you can manage, with each series labeled by team_id. Organization admins receive organization-wide metrics by default. For a Model API your lab organization lists, other organizations' consumption is included regardless of team_ids.",
                "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/MetricModeV1",
                            "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_model_api_inference_requests_total, baseten_model_api_incoming_inference_requests_total, and baseten_model_api_tokens_total. Unknown names are rejected; valid names that are not enabled for your organization are omitted from the response.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Metrics",
                            "type": "array"
                        }
                    },
                    {
                        "name": "team_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only metrics for these teams, repeated once per team. Defaults to all teams you can manage. Any unauthorized team causes a 403.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Team Ids",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_api_name"
                }
            ]
        },
        "/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    params={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns model metadata with added-model details for teams where you can invoke Model APIs. Legacy Default Team fields remain deprecated but unchanged. Pass team_ids to narrow team details; unauthorized teams cause a 403.",
                "parameters": [
                    {
                        "name": "team_ids",
                        "in": "query",
                        "required": false,
                        "description": "Select teams for added-model details, repeated once per team. Defaults to all teams where you can invoke Model APIs. Any unauthorized team causes a 403.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Team Ids",
                            "type": "array"
                        }
                    }
                ],
                "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  \"deployment_name\": 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  \"bdn\": null,\n  \"egress_restrictions\": null,\n  \"runtime\": null,\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, 'deployment_name': 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'}], 'bdn': None, 'egress_restrictions': None, 'runtime': None, '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  \"deployment_name\": 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  \"bdn\": null,\n  \"egress_restrictions\": null,\n  \"runtime\": null,\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, 'deployment_name': 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'}], 'bdn': None, 'egress_restrictions': None, 'runtime': None, '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  \"deployment_name\": 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  \"bdn\": null,\n  \"egress_restrictions\": null,\n  \"runtime\": 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/{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, 'deployment_name': 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'}], 'bdn': None, 'egress_restrictions': None, 'runtime': None}\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  \"is_listed\": 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, 'is_listed': None, 'metadata': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a library listing. Supported fields are the display name, public visibility, listed status, trending status, and the model-level metadata. An unlisted listing is left out of catalogs but still deploys from its direct link. 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 the teams you can manage, with optional filtering and grouping by API key, user, model, service tier, and team. Organization admins receive organization-wide totals by default; other callers may receive lower totals than callers with management access to more teams. 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. Team attribution began on October 12, 2026 at 21:54 UTC, with no historical backfill. October 12 is a partial day for team-scoped queries. Only unfiltered organization-admin queries include older unattributed usage.",
                "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, service_tier, or team. 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 totals across all teams you can manage.",
                        "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"
                        }
                    },
                    {
                        "name": "team_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only costs attributed to these teams, repeated once per team. Defaults to all teams you can manage.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Team Ids",
                            "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 within [start_date, end_date): the start date is inclusive and the end date is exclusive. Both dates are normalized to midnight UTC. Includes dedicated model serving, training, and model APIs usage. For multi-team organizations, Model APIs usage is split by team. Historical usage without a recorded team is assigned to Default Team. Usage subtotals are before credits; credits are deducted only at the product summary level. The date range must not exceed 31 days.",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": true,
                        "description": "Inclusive start date (ISO 8601, normalized to midnight UTC). Earliest queryable: 2026-01-01.",
                        "schema": {
                            "format": "date-time",
                            "title": "Start Date",
                            "type": "string"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": true,
                        "description": "Exclusive end date (ISO 8601, normalized to midnight 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. Defaults to teams you can manage; org admins include all organization history. Use team_ids to narrow the scope and group_by=TEAM for per-team rows. An unauthorized team filter causes a 403 response.",
                "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"
                        }
                    },
                    {
                        "name": "team_ids",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these teams, repeated once per team. Defaults to all teams you can manage. An unauthorized team ID causes a 403 response.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Team Ids",
                            "type": "array"
                        }
                    },
                    {
                        "name": "group_by",
                        "in": "query",
                        "required": false,
                        "description": "Pass TEAM to split daily rows by team. Defaults to aggregating across teams.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/ToolCallUsageDimensionV1"
                            },
                            "title": "Group By",
                            "type": "array"
                        }
                    }
                ],
                "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/me/access": {
            "get": {
                "summary": "Gets your roles and the permissions they grant",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users/me/access \\\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/access\"\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 every role you hold: assigned to you or a directory group you're in, or held through organization and team membership. Users and service accounts can call it. Once fine-grained authorization decides your organization's requests, it needs `access.self.read`.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EffectiveAccessV1"
                                }
                            }
                        }
                    }
                },
                "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/users/{user_id}/access": {
            "get": {
                "summary": "Gets a user's roles and the permissions they grant",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users/{user_id}/access \\\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}/access\"\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": "Needs `access.member.read` for the organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EffectiveAccessV1"
                                }
                            }
                        }
                    }
                },
                "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"
            },
            "patch": {
                "summary": "Updates the authenticated organization",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/organizations/me \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"allow_personal_api_keys\": null,\n  \"allow_service_account_api_keys\": null,\n  \"allow_team_admins_to_manage_roles\": 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/organizations/me\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'allow_personal_api_keys': None, 'allow_service_account_api_keys': None, 'allow_team_admins_to_manage_roles': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates settings of the organization of the user making the request. Only organization admins can call it. Omitted fields are unchanged.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateOrganizationRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrganizationInfoV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/service_accounts": {
            "get": {
                "summary": "Lists service accounts",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/service_accounts \\\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/service_accounts\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'name': None, 'team_id': None, 'disabled': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the service accounts you administer: every account for an organization admin, and your teams' accounts for a team admin. Workload identity federation tokens act as service accounts.",
                "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": "name",
                        "in": "query",
                        "required": false,
                        "description": "Only the account with this name, ignoring case",
                        "schema": {
                            "anyOf": [
                                {
                                    "minLength": 1,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    },
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this team's accounts",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    },
                    {
                        "name": "disabled",
                        "in": "query",
                        "required": false,
                        "description": "Only disabled or enabled accounts",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "boolean"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Disabled"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceAccountsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a service account",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/service_accounts \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"ci-deployer\",\n  \"description\": \"GitHub Actions deploys from acme/models\",\n  \"team_id\": \"abcd1234\",\n  \"preset_permissions\": {\n    \"type\": \"WORKSPACE_MANAGE_ALL\"\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/service_accounts\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'ci-deployer', 'description': 'GitHub Actions deploys from acme/models', 'team_id': 'abcd1234', 'preset_permissions': {'type': 'WORKSPACE_MANAGE_ALL'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a service account that workload identity federation tokens act as. It's enabled at once. Omit `team_id` for an organization account, which only an organization admin can create. A team admin can create accounts for their own team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateServiceAccountRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceAccountV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/service_accounts/{service_account_id}": {
            "delete": {
                "summary": "Deletes a service account",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_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/service_accounts/{service_account_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 disabled service account that no trust rule uses. Disable the account and delete its trust rules first.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedServiceAccountV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/service_account_id"
                }
            ],
            "get": {
                "summary": "Gets a service account",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_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/service_accounts/{service_account_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/ServiceAccountV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a service account",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"disabled\": 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/service_accounts/{service_account_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'disabled': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the fields you send. Set `disabled` to true to stop the account being used, and back to false to restore it. `preset_permissions` replaces the account's access as a whole. The owning team can't change.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateServiceAccountRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceAccountV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/service_accounts/{service_account_id}/access": {
            "get": {
                "summary": "Gets a service account's roles and the permissions they grant",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_id}/access \\\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/service_accounts/{service_account_id}/access\"\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": "Needs `service_account.read` where the account belongs.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EffectiveAccessV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/service_account_id"
                }
            ]
        },
        "/v1/access/predefined_identity_providers": {
            "get": {
                "summary": "Lists predefined identity providers",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/predefined_identity_providers \\\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/access/predefined_identity_providers\"\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 identity providers Baseten supports, with the issuer format for those where each account, tenant, or cluster has its own issuer.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PredefinedIdentityProvidersV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/identity_providers": {
            "get": {
                "summary": "Lists identity providers",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/identity_providers \\\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/access/identity_providers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'name': None, 'predefined_kind': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the organization's identity providers. Organization and team admins can list them.",
                "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": "name",
                        "in": "query",
                        "required": false,
                        "description": "Only the provider with this name, ignoring case",
                        "schema": {
                            "anyOf": [
                                {
                                    "minLength": 1,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    },
                    {
                        "name": "predefined_kind",
                        "in": "query",
                        "required": false,
                        "description": "Only this predefined provider's issuers",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IdentityProvidersV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Adds an identity provider",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/identity_providers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"prod-eks\",\n  \"predefined\": {\n    \"kind\": \"AWS_EKS\",\n    \"issuer_url\": \"https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE\"\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/access/identity_providers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'prod-eks', 'predefined': {'kind': 'AWS_EKS', 'issuer_url': 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Adds an identity provider to the organization. For a provider with a per-customer issuer, the issuer must match the provider's format, and its signing keys are fetched before it's saved; a failure returns 422 with the reason. Each provider with a fixed issuer can be added once. Only organization admins can call this endpoint.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateIdentityProviderRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IdentityProviderV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/identity_providers/verify": {
            "post": {
                "summary": "Checks an identity provider before adding it",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/identity_providers/verify \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"predefined\": {\n    \"kind\": \"AWS_EKS\",\n    \"issuer_url\": \"https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE\"\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/access/identity_providers/verify\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'predefined': {'kind': 'AWS_EKS', 'issuer_url': 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Runs the checks that adding the identity provider runs, without adding it: the issuer's format, that the organization doesn't have it yet, and, for a provider with a per-customer issuer, that its signing keys can be fetched. A failed check returns 200 with `valid` false and the reason. Only organization admins can call this endpoint.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/VerifyIdentityProviderRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VerificationV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/identity_providers/{identity_provider_id}": {
            "delete": {
                "summary": "Deletes an identity provider",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/access/identity_providers/{identity_provider_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/access/identity_providers/{identity_provider_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": "Removes the identity provider from the organization. Returns 409 while a trust rule uses it. Only organization admins can call this endpoint.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedIdentityProviderV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/identity_provider_id"
                }
            ],
            "get": {
                "summary": "Gets an identity provider",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/identity_providers/{identity_provider_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/access/identity_providers/{identity_provider_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/IdentityProviderV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates an identity provider",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/access/identity_providers/{identity_provider_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"prod-eks\"\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/access/identity_providers/{identity_provider_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'name': 'prod-eks'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the fields you send. The provider and issuer can't change. Only organization admins can call this endpoint.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateIdentityProviderRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/IdentityProviderV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/trust_rules": {
            "get": {
                "summary": "Lists trust rules",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/trust_rules \\\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/access/trust_rules\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'name': None, 'identity_provider_id': None, 'service_account_id': None, 'team_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Lists the trust rules you administer: every rule for an organization admin, and rules for your teams' service accounts for a team admin.",
                "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": "name",
                        "in": "query",
                        "required": false,
                        "description": "Only the rule with this name, ignoring case",
                        "schema": {
                            "anyOf": [
                                {
                                    "minLength": 1,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    },
                    {
                        "name": "identity_provider_id",
                        "in": "query",
                        "required": false,
                        "description": "Only this provider's rules",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Identity Provider Id"
                        }
                    },
                    {
                        "name": "service_account_id",
                        "in": "query",
                        "required": false,
                        "description": "Only rules for this service account",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Service Account Id"
                        }
                    },
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "Only rules for this team's service accounts",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessTrustRulesV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a trust rule",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/trust_rules \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"models-main-deploy\",\n  \"identity_provider_id\": \"abcd1234\",\n  \"service_account_id\": \"wxyz5678\",\n  \"condition\": \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\",\n  \"audience\": \"https://api.baseten.co\"\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/access/trust_rules\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'models-main-deploy', 'identity_provider_id': 'abcd1234', 'service_account_id': 'wxyz5678', 'condition': \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\", 'audience': 'https://api.baseten.co'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a rule that lets tokens from an identity provider act as a service account. Organization admins can create rules for any service account, team admins for their own team's. An organization API key manager key can't target organization accounts.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateAccessTrustRuleRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessTrustRuleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/trust_rules/verify": {
            "post": {
                "summary": "Checks a trust rule's condition and audience",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/trust_rules/verify \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"identity_provider_id\": \"abcd1234\",\n  \"condition\": \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\",\n  \"audience\": \"https://api.baseten.co\"\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/access/trust_rules/verify\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'identity_provider_id': 'abcd1234', 'condition': \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\", 'audience': 'https://api.baseten.co'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Runs the checks that creating or updating a trust rule runs on its condition and audience, without saving anything: that the condition compiles and pins the claims the identity provider requires. A failed check returns 200 with `valid` false and the reason.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/VerifyAccessTrustRuleRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VerificationV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/trust_rules/{trust_rule_id}": {
            "delete": {
                "summary": "Deletes a trust rule",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/access/trust_rules/{trust_rule_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/access/trust_rules/{trust_rule_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": "New exchanges through the rule fail at once; tokens already issued keep working until they expire.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedAccessTrustRuleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/trust_rule_id"
                }
            ],
            "get": {
                "summary": "Gets a trust rule",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/trust_rules/{trust_rule_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/access/trust_rules/{trust_rule_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/AccessTrustRuleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a trust rule",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/access/trust_rules/{trust_rule_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"models-release-deploy\"\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/access/trust_rules/{trust_rule_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'name': 'models-release-deploy'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the fields you send. Changes apply to new exchanges only. The identity provider can't change.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateAccessTrustRuleRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessTrustRuleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/permissions": {
            "get": {
                "summary": "Lists permissions and their categories",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/permissions \\\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/access/permissions\"\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": "Every caller gets the same permissions and categories; only `available` depends on your organization. Users and service accounts can call it, with the same access as `GET /v1/users/me/access`.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessPermissionsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/roles": {
            "get": {
                "summary": "Lists roles",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/roles \\\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/access/roles\"\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 built-in roles and your organization's custom roles, sorted by name. Needs `access.role.read`, or `access.role.write` in the team you pass as `team_id`.",
                "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": "ID of a team. Lists only the roles available there: built-in roles and the team roles it can use.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "Lists only the roles with this name",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Name"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessRolesV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a custom role",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/roles \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": null,\n  \"kind\": \"ORGANIZATION\",\n  \"team_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/access/roles\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': None, 'kind': 'ORGANIZATION', 'team_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Needs `access.role.write` for the organization, or in the role's team while your organization lets team admins manage roles. Unknown, reserved, or unavailable permissions return 400 with the `reason` in the error details.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateAccessRoleRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessRoleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/roles/{role_id}": {
            "delete": {
                "summary": "Deletes a custom role",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/access/roles/{role_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/access/roles/{role_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": "Needs `access.role.delete` where the role applies; for a team's role, for the organization unless it lets team admins manage roles. While any assignment uses the role, it returns 409 with reason `ROLE_IN_USE`. Built-in roles return 400.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessRoleTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/role_id"
                }
            ],
            "get": {
                "summary": "Gets a role",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/roles/{role_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/access/roles/{role_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'team_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Needs `access.role.read`, or `access.role.write` in the role's team. Pass `team_id` to get the role as that team's role list shows it: `access.role.write` in that team is then enough, and a role the list leaves out returns 404.",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "ID of a team. Gets the role only if `GET /v1/access/roles` lists it for that team, and checks your access in that team.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessRoleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a custom role",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/access/roles/{role_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": null,\n  \"description\": 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/access/roles/{role_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'name': None, 'description': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Changes the fields you send. `permissions` and `include_role_ids` add to the role's lists, and the `_to_delete` fields remove from them. Needs `access.role.write` where the role applies; for a team's role, for the organization unless it lets team admins manage roles. Built-in roles return 400.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateAccessRoleRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessRoleV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/assignments": {
            "get": {
                "summary": "Lists role assignments",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/assignments \\\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/access/assignments\"\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, 'role_id': None, 'subject_type': None, 'subject_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Needs `access.member.read` for the organization, or in the team you pass as `team_id`. Roles held through organization and team membership aren't 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 items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "ID of a team. Lists only the assignments in it.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    },
                    {
                        "name": "role_id",
                        "in": "query",
                        "required": false,
                        "description": "ID of a role. Lists only its assignments.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Role Id"
                        }
                    },
                    {
                        "name": "subject_type",
                        "in": "query",
                        "required": false,
                        "description": "Lists only the assignments to this type of subject",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/AccessSubjectTypeV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "subject_id",
                        "in": "query",
                        "required": false,
                        "description": "ID of a user, service account, or directory group. Lists only its assignments.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Subject Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessAssignmentsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Assigns a role",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/assignments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"role_id\": null,\n  \"subject_type\": \"USER\",\n  \"subject_id\": null,\n  \"team_id\": null,\n  \"resources\": null,\n  \"environments\": 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/access/assignments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'role_id': None, 'subject_type': 'USER', 'subject_id': None, 'team_id': None, 'resources': None, 'environments': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Gives a user, service account, or directory group a role, for the organization or in a team. Needs `access.member.write` there, or `access.group.write` for a directory group. A service account's roles also need `service_account.write` where the account belongs.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateAccessAssignmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessAssignmentV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/assignments/{assignment_id}": {
            "delete": {
                "summary": "Removes a role assignment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/access/assignments/{assignment_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/access/assignments/{assignment_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": "Needs `access.member.delete` where the role applies, or `access.group.write` for a directory group. A service account's roles also need `service_account.write` where the account belongs.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessAssignmentTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/assignment_id"
                }
            ],
            "get": {
                "summary": "Gets a role assignment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/assignments/{assignment_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/access/assignments/{assignment_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": "Needs `access.member.read` where the role applies.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessAssignmentV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/access/check": {
            "post": {
                "summary": "Checks whether you hold permissions",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/check \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"checks\": 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/access/check\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'checks': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Answers each check as fine-grained authorization decides it. Users and service accounts can call it, with the same access as `GET /v1/users/me/access`. Returns 503 while authorization is unavailable.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CheckAccessRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CheckAccessResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/auth/token": {
            "post": {
                "summary": "Exchanges an identity provider's JWT for an access token",
                "security": [],
                "description": "Exchanges a JWT from your identity provider for a short-lived Baseten access token, as described in RFC 8693. Send no API key: the JWT is the credential. Name the trust rule to check the JWT against as the `audience`, and send the access token as `Authorization: Bearer` on later requests. Errors follow RFC 6749 section 5.2: a 400 response with an `error` of `invalid_request`, `unsupported_grant_type`, or `invalid_grant`. A well-formed request that is refused always returns `invalid_grant`, whatever the reason.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TokenExchangeRequestV1"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/TokenExchangeRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TokenExchangeResponseV1"
                                }
                            }
                        }
                    }
                },
                "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/grid/token": {
            "post": {
                "summary": "Creates a Grid access token",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/token \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": \"abc1234\"\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/grid/token\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'team_id': 'abc1234'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Exchanges your Baseten credentials for a short-lived token that authenticates against the Grid gateway as you, in the given team. Tokens expire after four hours and cannot be renewed; request a new one when needed. Routes keys cannot create tokens.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGridTokenRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridTokenV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/routes": {
            "get": {
                "summary": "Lists routes",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/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/grid/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, newest first, optionally filtered by exact name. Without `team_id`, routes from every team where you can invoke routes. With `for_harnesses`, exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.",
                "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": "Limit routes to this team. Without it, routes from every team where you can invoke routes.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    },
                    {
                        "name": "for_harnesses",
                        "in": "query",
                        "required": false,
                        "description": "Set by harness setup and sync. Returns routes from exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.",
                        "schema": {
                            "default": false,
                            "title": "For Harnesses",
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "Filter by exact route name, the value to send in the inference request's `model` field. Matches a route's name or any of its aliases. 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/GridRoutesResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/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/grid/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. CONNECTION targets reference a connection owned by the route's team; create the connection first. INTELLIGENT targets reference a route classifier from GET /v1/grid/route_classifiers.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGridRouteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridRouteV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/routes/usage": {
            "get": {
                "summary": "Gets daily Grid usage and estimated costs",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/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/grid/routes/usage\"\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, '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 Grid usage in the organization. Team admins see usage in teams they manage. Other members, including viewers, see only usage from Routes keys they created, including keys that have since expired, been revoked, or been deleted. Usage can be filtered and grouped by the team it was metered in. 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": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "Limit usage to a team you can access. Organization admins can view all usage in the team, team admins can view usage in teams they manage, and other members can view only their own usage. Without a team, organization admins see all organization usage, team admins see their managed teams, and other members see their own usage.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    },
                    {
                        "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, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, HARNESS, or API_KEY. 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. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. API_KEY includes usage without an API key, such as requests authenticated by a signed-in session, as a null group. Defaults to MODEL.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/GridRouteUsageDimensionV1"
                            },
                            "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/GridProviderV1"
                            },
                            "title": "Providers",
                            "type": "array"
                        }
                    },
                    {
                        "name": "harnesses",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage for these harnesses, repeated once per harness. Omit to include all usage, including usage with no recorded harness.",
                        "schema": {
                            "items": {
                                "$ref": "#/components/schemas/GridRouteUsageHarnessV1"
                            },
                            "title": "Harnesses",
                            "type": "array"
                        }
                    },
                    {
                        "name": "api_key_prefixes",
                        "in": "query",
                        "required": false,
                        "description": "Return only usage made with these API keys, repeated once per key prefix. Omit to include all usage, including usage without an API key.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Api Key Prefixes",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridRouteUsageResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/routes/{route_id}": {
            "delete": {
                "summary": "Deletes a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/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/grid/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/GridRouteTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "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/grid/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/grid/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/GridRouteV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a route",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/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}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/grid/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'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "The route name, target, and owning team are immutable.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateGridRouteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridRouteV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/team_settings": {
            "get": {
                "summary": "Gets a team's Grid settings by team ID or your only team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings \\\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/grid/team_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'team_id': 'abc1234'}\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. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minLength": 1,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "abc1234"
                            ],
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridTeamSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a team's Grid settings by team ID or your only team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/team_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"harness_defaults\": null,\n  \"spend_limit\": null,\n  \"team_id\": \"abc1234\"\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/grid/team_settings\"\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, 'team_id': 'abc1234'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Changes only the fields in the request, all or nothing. Requires team admin, and organization admin to change the team-wide spend limit. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateGridTeamSettingsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridTeamSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/team_settings/users": {
            "get": {
                "summary": "Lists members' Grid settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings/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/grid/team_settings/users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'cursor': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns each member's settings in each team, including organization admins and Grid service accounts, one row per team membership. With `team_id`, one team, which requires team admin for it or organization admin; without it, every team you administer, which is none for members.",
                "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": "Limit the list to this team. Without it, the members of every team you administer, one row per team.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minLength": 1,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "abc1234"
                            ],
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridTeamUserSettingsListV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/team_settings/users/{user_id}": {
            "get": {
                "summary": "Gets a user's Grid settings by team ID or your only team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_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/grid/team_settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    params={'team_id': 'abc1234'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the user's spend limit for Baseten Grid in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; team admins can read members' settings in teams they administer, and organization admins can read anyone's. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.",
                "parameters": [
                    {
                        "name": "team_id",
                        "in": "query",
                        "required": false,
                        "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.",
                        "schema": {
                            "anyOf": [
                                {
                                    "minLength": 1,
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "abc1234"
                            ],
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridTeamUserSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_id"
                }
            ],
            "patch": {
                "summary": "Updates a user's Grid settings by team ID or your only team",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/team_settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"spend_limit\": null,\n  \"team_id\": \"abc1234\"\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/grid/team_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, 'team_id': 'abc1234'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team 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. Requires team admin for the specified team or organization admin. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateGridUserSettingsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridTeamUserSettingsV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/connections": {
            "get": {
                "summary": "Lists connections",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/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/grid/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 connections, newest first: the team's with `team_id`, else those of every team where you can invoke routes.",
                "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": "Limit connections to this team. Without it, connections from every team where you can invoke routes.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridConnectionsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": \"abc1234\",\n  \"config\": {\n    \"provider\": \"ANTHROPIC\",\n    \"secret_name\": \"anthropic-key\"\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/grid/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_name': 'anthropic-key'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a connection from the team to an upstream provider.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGridConnectionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridConnectionV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/connections/{connection_id}": {
            "delete": {
                "summary": "Deletes a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/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/grid/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/GridConnectionTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/connection_id"
                }
            ],
            "get": {
                "summary": "Gets a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/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/grid/connections/{connection_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/GridConnectionV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a connection",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"config\": {\n    \"provider\": \"ANTHROPIC\",\n    \"secret_name\": \"anthropic-key\"\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/grid/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_name': 'anthropic-key'}}\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/UpdateGridConnectionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridConnectionV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/route_classifiers": {
            "get": {
                "summary": "Lists route classifiers available for intelligent routes",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/route_classifiers \\\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/grid/route_classifiers\"\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 Baseten-managed route classifiers available to your organization, ordered by identifier. Route classifiers cannot be created or modified through this API.",
                "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"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridRouteClassifiersResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/route_classifiers/{route_classifier_id}": {
            "get": {
                "summary": "Gets a route classifier available for intelligent routes",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/route_classifiers/{route_classifier_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/grid/route_classifiers/{route_classifier_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/GridRouteClassifierV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/route_classifier_id"
                }
            ]
        },
        "/v1/grid/machine_users": {
            "get": {
                "summary": "Lists machine users",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/machine_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/grid/machine_users\"\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 machine users, newest first: the team's with `team_id`, which requires team admin for it, else those of every team you administer.",
                "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": "Limit machine users to this team. Without it, every team you administer.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Team Id"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridMachineUsersResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "post": {
                "summary": "Creates a machine user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/machine_users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": \"abc1234\",\n  \"name\": \"night-shift\",\n  \"api_key\": 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/grid/machine_users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'team_id': 'abc1234', 'name': 'night-shift', 'api_key': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a team-owned identity for an application, with its own Grid budget. Set `api_key` to also create its first API key, which the response returns only once. Set the machine user's spend limit with the user settings endpoint, using its `id` as the user ID. Requires team admin.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGridMachineUserRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreatedGridMachineUserV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/machine_users/{machine_user_id}": {
            "delete": {
                "summary": "Deletes a machine user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/machine_users/{machine_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/grid/machine_users/{machine_user_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": "Revokes the machine user's API keys and deletes it. Its usage history remains. Requires team admin for the machine user's team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridMachineUserTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/machine_user_id"
                }
            ],
            "get": {
                "summary": "Gets a machine user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/machine_users/{machine_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/grid/machine_users/{machine_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": "Requires team admin for the machine user's team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridMachineUserV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "patch": {
                "summary": "Updates a machine user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/machine_users/{machine_user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\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/grid/machine_users/{machine_user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Changes only the fields in the request. Requires team admin for the machine user's team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateGridMachineUserRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GridMachineUserV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/machine_users/{machine_user_id}/api_keys": {
            "get": {
                "summary": "Lists a machine user's API keys",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/machine_users/{machine_user_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/grid/machine_users/{machine_user_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)"
                    }
                ],
                "description": "Lists the machine user's active API keys, newest first. Requires team admin for the machine user's team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeysV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/machine_user_id"
                }
            ],
            "post": {
                "summary": "Creates an API key for a machine user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/machine_users/{machine_user_id}/api_keys \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"production\"\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/grid/machine_users/{machine_user_id}/api_keys\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'production'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "The machine user's other API keys stay active. Requires team admin for the machine user's team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateGridMachineUserAPIKeyRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeyV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/grid/machine_users/{machine_user_id}/api_keys/{api_key_prefix}": {
            "delete": {
                "summary": "Revokes a machine user's API key",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/machine_users/{machine_user_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/grid/machine_users/{machine_user_id}/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": "The machine user's other API keys stay active. Requires team admin for the machine user's team.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/APIKeyTombstoneV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/machine_user_id"
                },
                {
                    "$ref": "#/components/parameters/api_key_prefix"
                }
            ]
        },
        "/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 with labeled request counts, CPU cores, and RSS memory bytes. CURRENT returns one snapshot at now, with\nrequest counts over the preceding minute and latest gauges.\nSUMMARY returns one value set over the window. SERIES snaps the window outward\nto UTC step boundaries and echoes those boundaries; each value covers\n[start_epoch_millis, start_epoch_millis + step_seconds).\nMissing gauge samples remain null. Request counts are zero after\ncreation without traffic, and null before creation. CPU averages are averages\nof valid sampled CPU rates; memory averages are averages of sampled RSS.\nWindows default to one hour, are limited to 7 days after alignment, and at most\n10000 intervals. Telemetry failures return an error.\n",
                "tags": [
                    "Sandboxes"
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/SandboxName"
                    },
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/SandboxMetricMode"
                    },
                    {
                        "$ref": "#/components/parameters/SandboxMetricStart"
                    },
                    {
                        "$ref": "#/components/parameters/SandboxMetricEnd"
                    },
                    {
                        "$ref": "#/components/parameters/SandboxMetricNames"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Index-aligned sandbox metrics.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxMetricsV1"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid range, mode, step, metric selection, or response size."
                    },
                    "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, region, image, ports, filesystem, and volumes 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 configuration.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "code": "INVALID_REQUEST",
                                    "message": "Memory 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/instances/{sandbox_name}/previews": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxName"
                }
            ],
            "get": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "operationId": "ListSandboxPreviews",
                "summary": "List sandbox previews",
                "description": "Return the previews of the sandbox in the paginated list format. cursor and limit are accepted but not applied yet; all previews fit on one page, so has_more is false. Follow pagination.cursor while has_more is true to stay compatible when they are applied.",
                "tags": [
                    "Previews"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxPreviewsResponseV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewsList"
                                    }
                                }
                            }
                        }
                    },
                    "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"
            },
            "post": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "CreateSandboxPreview",
                "summary": "Create a sandbox preview",
                "description": "Expose a port of the sandbox on an HTTPS URL. A public preview is reachable by anyone with the URL. A private preview requires a preview token, created with the tokens endpoint and sent as the preview_token query parameter; the first request sets a cookie so a browser can keep navigating without it. Port 80 and the sandbox's reserved system ports are rejected, and port 443 must stay private. Without a name, the name is generated from the sandbox name and port, or is public-<port> or private-<port> when create_if_not_exists is true.",
                "tags": [
                    "Previews"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateSandboxPreviewRequestV1"
                            },
                            "examples": {
                                "public": {
                                    "$ref": "#/components/examples/CreateSandboxPreviewPublic"
                                },
                                "private": {
                                    "$ref": "#/components/examples/CreateSandboxPreviewPrivate"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Preview created.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxPreviewV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewReady"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "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/instances/{sandbox_name}/previews/{preview_name}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxName"
                },
                {
                    "$ref": "#/components/parameters/PreviewName"
                }
            ],
            "get": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "name": "show_secrets",
                        "in": "query",
                        "description": "Reveal request header values for workspace administrators, for example to change one header and send the full set back in a PATCH. Defaults to false. Callers without the admin role receive masked values even when true.",
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    }
                ],
                "operationId": "GetSandboxPreview",
                "summary": "Get a sandbox preview",
                "description": "Return the preview configuration, URL and status.",
                "tags": [
                    "Previews"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxPreviewV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewReady"
                                    }
                                }
                            }
                        }
                    },
                    "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": "UpdateSandboxPreview",
                "summary": "Update a sandbox preview",
                "description": "Partially update the preview. Omitted fields remain unchanged; supplied header maps replace their previous values. The URL does not change. Setting ttl or expires_at replaces any previous expiration and restarts it from now. The name and port are immutable; supplying either returns 400.",
                "tags": [
                    "Previews"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateSandboxPreviewRequestV1"
                            },
                            "examples": {
                                "complete": {
                                    "$ref": "#/components/examples/UpdateSandboxPreview"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxPreviewV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewReady"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "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": "DeleteSandboxPreview",
                "summary": "Delete a sandbox preview",
                "description": "Delete the preview and revoke its tokens. The URL stops serving immediately. Return the deleted preview, with status TERMINATED, or DELETING while a preview with many tokens finishes in the background.",
                "tags": [
                    "Previews"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxPreviewV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewDeleted"
                                    }
                                }
                            }
                        }
                    },
                    "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/instances/{sandbox_name}/previews/{preview_name}/tokens": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxName"
                },
                {
                    "$ref": "#/components/parameters/PreviewName"
                }
            ],
            "get": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    }
                ],
                "operationId": "ListSandboxPreviewTokens",
                "summary": "List preview tokens",
                "description": "Return the tokens of a private preview in the paginated list format, including expired tokens until they are removed. cursor and limit are accepted but not applied yet; all tokens fit on one page, so has_more is false. Follow pagination.cursor while has_more is true to stay compatible when they are applied.",
                "tags": [
                    "Previews"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxPreviewTokensResponseV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewTokensList"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The preview is public, so it has no tokens. Returns a JSON error with code, message, and optional details.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "code": "INVALID_REQUEST",
                                    "message": "Public preview cannot have tokens."
                                }
                            }
                        }
                    },
                    "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"
            },
            "post": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "CreateSandboxPreviewToken",
                "summary": "Create a preview token",
                "description": "Create a token granting access to a private preview until expires_at. Append it to the preview URL as ?preview_token=<token>.",
                "tags": [
                    "Previews"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateSandboxPreviewTokenRequestV1"
                            },
                            "examples": {
                                "complete": {
                                    "$ref": "#/components/examples/CreateSandboxPreviewToken"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Token created.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxPreviewTokenV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxPreviewToken"
                                    }
                                }
                            }
                        }
                    },
                    "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/instances/{sandbox_name}/previews/{preview_name}/tokens/{token_name}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/SandboxName"
                },
                {
                    "$ref": "#/components/parameters/PreviewName"
                },
                {
                    "$ref": "#/components/parameters/PreviewTokenName"
                }
            ],
            "delete": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "DeleteSandboxPreviewToken",
                "summary": "Delete a preview token",
                "description": "Revoke the token. Requests using it are rejected immediately.",
                "tags": [
                    "Previews"
                ],
                "responses": {
                    "204": {
                        "description": "Token deleted."
                    },
                    "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/volumes": {
            "get": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "$ref": "#/components/parameters/Limit"
                    },
                    {
                        "name": "q",
                        "in": "query",
                        "description": "Search volume names. Search is applied before pagination.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "datasets"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Volume statuses. Repeat the query parameter for each status, for example status=DEPLOYED&status=FAILED. Unknown values are rejected.",
                        "required": false,
                        "style": "form",
                        "explode": true,
                        "schema": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "$ref": "#/components/schemas/SandboxVolumeStatusV1"
                            }
                        }
                    }
                ],
                "operationId": "ListSandboxVolumes",
                "summary": "List volumes",
                "description": "Return a cursor-paginated page of persistent volumes, newest first. Keep q and status unchanged when following a cursor.",
                "tags": [
                    "Volumes"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListSandboxVolumesResponseV1"
                                },
                                "examples": {
                                    "page": {
                                        "$ref": "#/components/examples/SandboxVolumesPage"
                                    }
                                }
                            }
                        }
                    },
                    "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": "CreateSandboxVolume",
                "summary": "Create a volume",
                "description": "Create a persistent volume that outlives the sandboxes it is mounted in. Mount it at sandbox creation with the volumes field; a volume is mounted in at most one sandbox at a time and must be in the same region. The name is generated when omitted. Volume size and count are limited by the team's plan.",
                "tags": [
                    "Volumes"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateSandboxVolumeRequestV1"
                            },
                            "examples": {
                                "complete": {
                                    "$ref": "#/components/examples/CreateSandboxVolume"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Volume created. Provisioning may continue; inspect status for readiness.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxVolumeV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxVolumeReady"
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/SandboxError400"
                    },
                    "401": {
                        "$ref": "#/components/responses/SandboxError401"
                    },
                    "403": {
                        "$ref": "#/components/responses/SandboxError403"
                    },
                    "409": {
                        "$ref": "#/components/responses/SandboxError409"
                    },
                    "429": {
                        "$ref": "#/components/responses/SandboxError429"
                    },
                    "500": {
                        "$ref": "#/components/responses/SandboxError500"
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/sandboxes/volumes/{volume_name}": {
            "parameters": [
                {
                    "$ref": "#/components/parameters/VolumeName"
                }
            ],
            "get": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "GetSandboxVolume",
                "summary": "Get a volume",
                "description": "Return the volume, its status and the sandbox it is mounted in, if any.",
                "tags": [
                    "Volumes"
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxVolumeV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxVolumeReady"
                                    }
                                }
                            }
                        }
                    },
                    "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": "UpdateSandboxVolume",
                "summary": "Update a volume",
                "description": "Grow the volume or replace its labels. size can only increase. The name and region are immutable; supplying either returns 400.",
                "tags": [
                    "Volumes"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateSandboxVolumeRequestV1"
                            },
                            "examples": {
                                "complete": {
                                    "$ref": "#/components/examples/UpdateSandboxVolume"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxVolumeV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxVolumeReady"
                                    }
                                }
                            }
                        }
                    },
                    "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"
            },
            "delete": {
                "parameters": [
                    {
                        "$ref": "#/components/parameters/TeamId"
                    },
                    {
                        "$ref": "#/components/parameters/TeamIdHeader"
                    }
                ],
                "operationId": "DeleteSandboxVolume",
                "summary": "Delete a volume",
                "description": "Permanently delete the volume and its data asynchronously. The returned resource has status DELETING. A volume mounted in a sandbox cannot be deleted (409); delete the sandbox first. Repeating the call while it is deleting returns the same resource.",
                "tags": [
                    "Volumes"
                ],
                "responses": {
                    "202": {
                        "description": "Request accepted.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SandboxVolumeV1"
                                },
                                "examples": {
                                    "complete": {
                                        "$ref": "#/components/examples/SandboxVolumeDeleting"
                                    }
                                }
                            }
                        }
                    },
                    "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. Set memory and volume to size the temporary environment that builds or imports the image; for a source archive, upload with the returned upload_headers.",
                "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. One call runs for a limited time; when has_more is true, only part of the unused versions were removed and the call should be repeated.",
                "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 repository summary. Use the tag listing endpoint for remaining image versions.",
                "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"
            },
            "VolumeHostingV1": {
                "description": "Where volumes are stored. The same name under two hostings is two different volumes.\n\n- ``BASETEN_CLOUD``: Baseten's shared fleet.\n- ``SINGLE_TENANT``: your organization's single-tenant workload planes.\n- ``SELF_HOSTED``: workload planes in your own cloud account.",
                "enum": [
                    "BASETEN_CLOUD",
                    "SINGLE_TENANT",
                    "SELF_HOSTED"
                ],
                "title": "VolumeHostingV1",
                "type": "string"
            },
            "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"
                    },
                    "hosting": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeHostingV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Where the volumes are stored. Defaults to your organization's hosting when it has one, and is required when it has more than one."
                    },
                    "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"
                    },
                    "hosting": {
                        "$ref": "#/components/schemas/VolumeHostingV1",
                        "description": "Where the granted volumes are stored."
                    },
                    "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",
                    "hosting",
                    "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"
            },
            "VolumeSyncAuthenticationHuggingFaceOIDCV1": {
                "description": "Authentication using a Hugging Face trusted publisher and Baseten workload identity.",
                "properties": {
                    "resource": {
                        "description": "Hugging Face username for an account CI/CD identity, or namespace/repository for a repository trusted publisher. Configure trust in Hugging Face before starting the sync.",
                        "examples": [
                            "hf-user",
                            "organization/private-model"
                        ],
                        "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]*(/[A-Za-z0-9_][A-Za-z0-9_.-]*)?$",
                        "title": "Resource",
                        "type": "string"
                    }
                },
                "required": [
                    "resource"
                ],
                "title": "VolumeSyncAuthenticationHuggingFaceOIDCV1",
                "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"
                    },
                    "hf_oidc": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/VolumeSyncAuthenticationHuggingFaceOIDCV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Hugging Face OIDC authentication for this source. Cannot be combined with auth_secret_name."
                    }
                },
                "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": {
                "additionalProperties": false,
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "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"
            },
            "PatchVolumeRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Time at which the volume expires, in ISO 8601 format, with a UTC offset. It must be in the future and at most ten years ahead. Set it to null to clear the expiration time. A body that sets no field is rejected. When the volume expires, all live versions are deleted, all tags are removed, and the volume disappears from listings. Clearing the expiration time afterward does not restore deleted versions. Each deleted version can be restored until its delete_after time. Setting or clearing the expiration time requires the same permission as deleting the volume.",
                        "examples": [
                            "2030-01-01T00:00:00Z"
                        ],
                        "title": "Expires At",
                        "x-null-distinct": true
                    },
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Revision the volume is expected to be at. When set, the update fails with a conflict if the volume has changed since. Take the value from a volume's sequence, or from volume_sequence.",
                        "title": "Expected Sequence"
                    }
                },
                "title": "PatchVolumeRequestV1",
                "type": "object"
            },
            "PatchVolumeResponseV1": {
                "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"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Volume expiration time in ISO 8601 format. Null when no expiration time is set.",
                        "title": "Expires At"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume after the update.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "expires_at",
                    "volume_sequence"
                ],
                "title": "PatchVolumeResponseV1",
                "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": {
                "additionalProperties": false,
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "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": {
                "additionalProperties": false,
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "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"
            },
            "SetVolumeTagRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "tag": {
                        "description": "Name of the tag to set. Tags are case-sensitive. Setting a tag that already exists overwrites it, and the version it pointed at before stays reachable by digest.",
                        "examples": [
                            "nightly"
                        ],
                        "pattern": "^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$",
                        "title": "Tag",
                        "type": "string"
                    },
                    "version": {
                        "description": "Version to set the tag on. 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.",
                        "examples": [
                            "head"
                        ],
                        "title": "Version",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Time at which the tag expires, in ISO 8601 format, with a UTC offset. It must be in the future and at most ten years ahead. Omit it for a tag with no expiration time of its own. Omitting it also clears the expiration time of an existing tag. Version or volume expiration still deletes the tag. Do not specify it when setting `head`.",
                        "title": "Expires At"
                    },
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Revision the volume is expected to be at. When set, the request fails with a conflict if the volume has changed since. Take the value from volume_sequence.",
                        "title": "Expected Sequence"
                    }
                },
                "required": [
                    "tag",
                    "version"
                ],
                "title": "SetVolumeTagRequestV1",
                "type": "object"
            },
            "SetVolumeTagResponseV1": {
                "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"
                    },
                    "tag": {
                        "description": "Name of the tag that was set, with its original capitalization.",
                        "title": "Tag",
                        "type": "string"
                    },
                    "digest": {
                        "description": "Content digest of the version the tag points at, as `b3:<hex>`.",
                        "title": "Digest",
                        "type": "string"
                    },
                    "version_ref": {
                        "description": "Full address of the tagged version, as `bdn:<namespace>/<volume>@<digest>`. Paste it into a config.yaml to pin this version, even if the tag is later set on another version.",
                        "title": "Version Ref",
                        "type": "string"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume after the tag was set.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Tag expiration time in ISO 8601 format. Null when the tag has no expiration time of its own.",
                        "title": "Expires At"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "tag",
                    "digest",
                    "version_ref",
                    "volume_sequence",
                    "expires_at"
                ],
                "title": "SetVolumeTagResponseV1",
                "type": "object"
            },
            "DeleteVolumeTagRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "expected_sequence": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "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 delete a tag someone else has just set on another version. Take the value from volume_sequence.",
                        "title": "Expected Sequence"
                    }
                },
                "title": "DeleteVolumeTagRequestV1",
                "type": "object"
            },
            "DeleteVolumeTagResponseV1": {
                "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"
                    },
                    "tag": {
                        "description": "Tag name from the request, with its original capitalization.",
                        "title": "Tag",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the tag existed and was deleted. False when the volume had no tag by that name, which is not an error.",
                        "title": "Deleted",
                        "type": "boolean"
                    },
                    "volume_sequence": {
                        "description": "Revision of the volume after the delete.",
                        "title": "Volume Sequence",
                        "type": "integer"
                    }
                },
                "required": [
                    "namespace",
                    "volume",
                    "tag",
                    "deleted",
                    "volume_sequence"
                ],
                "title": "DeleteVolumeTagResponseV1",
                "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"
            },
            "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"
            },
            "AutoscalingScheduleWeekdayV1": {
                "enum": [
                    "SUNDAY",
                    "MONDAY",
                    "TUESDAY",
                    "WEDNESDAY",
                    "THURSDAY",
                    "FRIDAY",
                    "SATURDAY"
                ],
                "title": "AutoscalingScheduleWeekdayV1",
                "type": "string"
            },
            "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"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the new deployment. The new deployment starts from the settings of the environment named by `environment_name` with these changes applied, and the environment keeps the result when the promotion completes. Requires `environment_name`.",
                        "examples": [
                            {
                                "max_replica": 4,
                                "min_replica": 2
                            }
                        ]
                    },
                    "request_backpressure_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRequestBackpressureSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Request backpressure settings for the new deployment, applied the same way as `autoscaling_settings`.",
                        "examples": [
                            {
                                "policy": "REJECT_ON_FULL"
                            }
                        ]
                    },
                    "autoscaling_schedule_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingScheduleSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling schedule changes for the environment named by `environment_name`, applied when the promotion completes. Requires `environment_name`."
                    },
                    "promotion_settings_override": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for promoting the new deployment into the environment named by `environment_name`, for this promotion only. Omitted fields keep the environment's values, and the environment's promotion settings are unchanged. Requires `environment_name`.",
                        "examples": [
                            {
                                "rolling_deploy_config": {
                                    "max_surge_percent": 50
                                }
                            }
                        ]
                    },
                    "instance_type_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Instance type for the new deployment, from `GET /v1/instance_types`, in place of the one in `config`. The environment named by `environment_name` takes it when the promotion completes. Requires `environment_name`. Cannot be set with `preserve_env_instance_type: true`.",
                        "title": "Instance Type Id"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "DeploymentArchivePayloadV1",
                "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"
            },
            "PromotionCleanupStrategyV1": {
                "description": "The promotion cleanup strategy.",
                "enum": [
                    "KEEP",
                    "SCALE_TO_ZERO",
                    "DEACTIVATE"
                ],
                "title": "PromotionCleanupStrategyV1",
                "type": "string"
            },
            "RequestBackpressurePolicyV1": {
                "enum": [
                    "QUEUE_ON_FULL",
                    "REJECT_ON_FULL"
                ],
                "title": "RequestBackpressurePolicyV1",
                "type": "string"
            },
            "RollingDeployStrategyV1": {
                "description": "The rolling deploy strategy.",
                "enum": [
                    "REPLICA"
                ],
                "title": "RollingDeployStrategyV1",
                "type": "string"
            },
            "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"
            },
            "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"
            },
            "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"
            },
            "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"
            },
            "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"
            },
            "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"
            },
            "AuditFieldChangeV1": {
                "description": "A field's value before and after an update.",
                "properties": {
                    "old": {
                        "description": "The value before the update.",
                        "title": "Old"
                    },
                    "new": {
                        "description": "The value after the update.",
                        "title": "New"
                    }
                },
                "required": [
                    "old",
                    "new"
                ],
                "title": "AuditFieldChangeV1",
                "type": "object"
            },
            "AuditLogActorTypeV1": {
                "description": "Kind of actor that performed an audited action.",
                "enum": [
                    "USER",
                    "API_KEY",
                    "BASETEN_USER",
                    "BASETEN_SYSTEM",
                    "TOMBSTONE_USER",
                    "SERVICE_ACCOUNT"
                ],
                "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"
                    },
                    "service_account_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the acting service account, when the actor is a service account.",
                        "title": "Service Account Id"
                    },
                    "service_account_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Current name of the acting service account, when the actor is a service account.",
                        "title": "Service Account Name"
                    },
                    "trust_rule_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the trust rule the acting workload identity federation token was exchanged through, when the actor is a service account.",
                        "title": "Trust Rule Id"
                    }
                },
                "required": [
                    "type"
                ],
                "title": "AuditLogActorV1",
                "type": "object"
            },
            "AuditLogApiKeyRevocationReasonV1": {
                "description": "Reason an API key was revoked.",
                "enum": [
                    "INACTIVITY",
                    "CREDENTIAL_EXPOSURE"
                ],
                "title": "AuditLogApiKeyRevocationReasonV1",
                "type": "string"
            },
            "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_ALL_DEDICATED_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",
                                "API_KEY_LIFETIME_LIMITS_UPDATED": "#/components/schemas/AuditLogEventApiKeyLifetimeLimitsUpdatedV1",
                                "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",
                                "GRID_GUARDRAIL_CREATED": "#/components/schemas/AuditLogEventGridGuardrailCreatedV1",
                                "GRID_GUARDRAIL_DELETED": "#/components/schemas/AuditLogEventGridGuardrailDeletedV1",
                                "GRID_GUARDRAIL_UPDATED": "#/components/schemas/AuditLogEventGridGuardrailUpdatedV1",
                                "GRID_MACHINE_USER_CREATED": "#/components/schemas/AuditLogEventGridMachineUserCreatedV1",
                                "GRID_MACHINE_USER_DELETED": "#/components/schemas/AuditLogEventGridMachineUserDeletedV1",
                                "GRID_MACHINE_USER_UPDATED": "#/components/schemas/AuditLogEventGridMachineUserUpdatedV1",
                                "IDENTITY_PROVIDER_CREATED": "#/components/schemas/AuditLogEventIdentityProviderCreatedV1",
                                "IDENTITY_PROVIDER_DELETED": "#/components/schemas/AuditLogEventIdentityProviderDeletedV1",
                                "IDENTITY_PROVIDER_UPDATED": "#/components/schemas/AuditLogEventIdentityProviderUpdatedV1",
                                "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",
                                "ORGANIZATION_API_KEY_SETTINGS_UPDATED": "#/components/schemas/AuditLogEventOrganizationApiKeySettingsUpdatedV1",
                                "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",
                                "SERVICE_ACCOUNT_CREATED": "#/components/schemas/AuditLogEventServiceAccountCreatedV1",
                                "SERVICE_ACCOUNT_DELETED": "#/components/schemas/AuditLogEventServiceAccountDeletedV1",
                                "SERVICE_ACCOUNT_UPDATED": "#/components/schemas/AuditLogEventServiceAccountUpdatedV1",
                                "SSH_CERTIFICATE_SIGNED": "#/components/schemas/AuditLogEventSshCertificateSignedV1",
                                "TELEMETRY_EXPORT_CREATED": "#/components/schemas/AuditLogEventTelemetryExportCreatedV1",
                                "TELEMETRY_EXPORT_DELETED": "#/components/schemas/AuditLogEventTelemetryExportDeletedV1",
                                "TELEMETRY_EXPORT_UPDATED": "#/components/schemas/AuditLogEventTelemetryExportUpdatedV1",
                                "TRUST_RULE_CREATED": "#/components/schemas/AuditLogEventTrustRuleCreatedV1",
                                "TRUST_RULE_DELETED": "#/components/schemas/AuditLogEventTrustRuleDeletedV1",
                                "TRUST_RULE_UPDATED": "#/components/schemas/AuditLogEventTrustRuleUpdatedV1",
                                "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_TAG_DELETED": "#/components/schemas/AuditLogEventVolumeTagDeletedV1",
                                "VOLUME_TAG_SET": "#/components/schemas/AuditLogEventVolumeTagSetV1",
                                "VOLUME_UPDATED": "#/components/schemas/AuditLogEventVolumeUpdatedV1",
                                "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/AuditLogEventApiKeyLifetimeLimitsUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventOrganizationApiKeySettingsUpdatedV1"
                            },
                            {
                                "$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/AuditLogEventGridMachineUserCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGridMachineUserUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGridMachineUserDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGridGuardrailCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGridGuardrailUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventGridGuardrailDeletedV1"
                            },
                            {
                                "$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"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventVolumeTagSetV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventVolumeTagDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventVolumeUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventTelemetryExportCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventTelemetryExportUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventTelemetryExportDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventServiceAccountCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventServiceAccountUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventServiceAccountDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventIdentityProviderCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventIdentityProviderUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventIdentityProviderDeletedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventTrustRuleCreatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventTrustRuleUpdatedV1"
                            },
                            {
                                "$ref": "#/components/schemas/AuditLogEventTrustRuleDeletedV1"
                            }
                        ],
                        "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"
                    },
                    "revocation_reason": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogApiKeyRevocationReasonV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null
                    }
                },
                "required": [
                    "event_type",
                    "api_key_id",
                    "api_key_type",
                    "prefix"
                ],
                "title": "AuditLogEventApiKeyDeletedV1",
                "type": "object"
            },
            "AuditLogEventApiKeyLifetimeLimitsUpdatedV1": {
                "description": "An administrator updated the organization's API key lifetime limits.",
                "properties": {
                    "event_type": {
                        "const": "API_KEY_LIFETIME_LIMITS_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "organization_id": {
                        "title": "Organization Id",
                        "type": "string"
                    },
                    "previous_personal_limit_days": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Previous Personal Limit Days"
                    },
                    "new_personal_limit_days": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "New Personal Limit Days"
                    },
                    "previous_team_limit_days": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Previous Team Limit Days"
                    },
                    "new_team_limit_days": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "New Team Limit Days"
                    }
                },
                "required": [
                    "event_type",
                    "organization_id",
                    "previous_personal_limit_days",
                    "new_personal_limit_days",
                    "previous_team_limit_days",
                    "new_team_limit_days"
                ],
                "title": "AuditLogEventApiKeyLifetimeLimitsUpdatedV1",
                "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"
            },
            "AuditLogEventAutoscalingScheduleOperationsV1": {
                "description": "The autoscaling schedule changes a request asked for. Not itself a union payload.",
                "properties": {
                    "timezone": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Timezone"
                    },
                    "schedules": {
                        "items": {
                            "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleUpsertV1"
                        },
                        "title": "Schedules",
                        "type": "array"
                    },
                    "delete_schedule_ids": {
                        "items": {
                            "type": "string"
                        },
                        "title": "Delete Schedule Ids",
                        "type": "array"
                    }
                },
                "required": [
                    "timezone",
                    "schedules",
                    "delete_schedule_ids"
                ],
                "title": "AuditLogEventAutoscalingScheduleOperationsV1",
                "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"
            },
            "AuditLogEventAutoscalingScheduleUpsertV1": {
                "description": "One schedule a request creates (`schedule_id` null) or replaces. `timezone` is the\nrequest's, null when it keeps the environment's. 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": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Timezone"
                    },
                    "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"
                    },
                    "schedule_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Schedule Id"
                    }
                },
                "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",
                    "schedule_id"
                ],
                "title": "AuditLogEventAutoscalingScheduleUpsertV1",
                "type": "object"
            },
            "AuditLogEventAutoscalingSettingsUpdateV1": {
                "description": "Autoscaling settings a request set, null where it left a setting unchanged. Not itself a\npayload in the discriminated union.",
                "properties": {
                    "min_replica": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Min Replica"
                    },
                    "max_replica": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Max Replica"
                    },
                    "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"
                    }
                },
                "required": [
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate"
                ],
                "title": "AuditLogEventAutoscalingSettingsUpdateV1",
                "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": {
                    "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"
                    },
                    "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"
                    },
                    "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": [
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy",
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "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": {
                    "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"
                    },
                    "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"
                    },
                    "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": [
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy",
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "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"
                    },
                    "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"
                    },
                    "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"
                    },
                    "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",
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy",
                    "min_replica",
                    "max_replica",
                    "concurrency_target",
                    "autoscaling_window",
                    "scale_down_delay",
                    "target_utilization_percentage",
                    "target_in_flight_tokens",
                    "max_scale_down_rate",
                    "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"
            },
            "AuditLogEventGridGuardrailCreatedV1": {
                "description": "A Grid guardrail was added to a team.",
                "properties": {
                    "event_type": {
                        "const": "GRID_GUARDRAIL_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "grid_guardrail_id": {
                        "title": "Grid Guardrail Id",
                        "type": "string"
                    },
                    "guardrail_name": {
                        "title": "Guardrail Name",
                        "type": "string"
                    },
                    "provider": {
                        "title": "Provider",
                        "type": "string"
                    },
                    "provider_guardrail_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Provider Guardrail Id"
                    },
                    "provider_guardrail_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Provider Guardrail Version"
                    },
                    "enabled": {
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "grid_guardrail_id",
                    "guardrail_name",
                    "provider",
                    "provider_guardrail_id",
                    "provider_guardrail_version",
                    "enabled",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventGridGuardrailCreatedV1",
                "type": "object"
            },
            "AuditLogEventGridGuardrailDeletedV1": {
                "description": "A Grid guardrail was removed from a team.",
                "properties": {
                    "event_type": {
                        "const": "GRID_GUARDRAIL_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "grid_guardrail_id": {
                        "title": "Grid Guardrail Id",
                        "type": "string"
                    },
                    "guardrail_name": {
                        "title": "Guardrail Name",
                        "type": "string"
                    },
                    "provider": {
                        "title": "Provider",
                        "type": "string"
                    },
                    "provider_guardrail_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Provider Guardrail Id"
                    },
                    "provider_guardrail_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Provider Guardrail Version"
                    },
                    "enabled": {
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "grid_guardrail_id",
                    "guardrail_name",
                    "provider",
                    "provider_guardrail_id",
                    "provider_guardrail_version",
                    "enabled",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventGridGuardrailDeletedV1",
                "type": "object"
            },
            "AuditLogEventGridGuardrailUpdatedV1": {
                "description": "A Grid guardrail was renamed, reconfigured, or turned on or off.",
                "properties": {
                    "event_type": {
                        "const": "GRID_GUARDRAIL_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "grid_guardrail_id": {
                        "title": "Grid Guardrail Id",
                        "type": "string"
                    },
                    "guardrail_name": {
                        "title": "Guardrail Name",
                        "type": "string"
                    },
                    "provider": {
                        "title": "Provider",
                        "type": "string"
                    },
                    "provider_guardrail_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Provider Guardrail Id"
                    },
                    "provider_guardrail_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Provider Guardrail Version"
                    },
                    "enabled": {
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "grid_guardrail_id",
                    "guardrail_name",
                    "provider",
                    "provider_guardrail_id",
                    "provider_guardrail_version",
                    "enabled",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventGridGuardrailUpdatedV1",
                "type": "object"
            },
            "AuditLogEventGridMachineUserCreatedV1": {
                "description": "A Grid machine user was created.",
                "properties": {
                    "event_type": {
                        "const": "GRID_MACHINE_USER_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "machine_user_id": {
                        "title": "Machine User Id",
                        "type": "string"
                    },
                    "machine_user_name": {
                        "title": "Machine User Name",
                        "type": "string"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "machine_user_id",
                    "machine_user_name",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventGridMachineUserCreatedV1",
                "type": "object"
            },
            "AuditLogEventGridMachineUserDeletedV1": {
                "description": "A Grid machine user was deleted, revoking its API keys.",
                "properties": {
                    "event_type": {
                        "const": "GRID_MACHINE_USER_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "machine_user_id": {
                        "title": "Machine User Id",
                        "type": "string"
                    },
                    "machine_user_name": {
                        "title": "Machine User Name",
                        "type": "string"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "machine_user_id",
                    "machine_user_name",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventGridMachineUserDeletedV1",
                "type": "object"
            },
            "AuditLogEventGridMachineUserUpdatedV1": {
                "description": "A Grid machine user was renamed.",
                "properties": {
                    "event_type": {
                        "const": "GRID_MACHINE_USER_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "machine_user_id": {
                        "title": "Machine User Id",
                        "type": "string"
                    },
                    "machine_user_name": {
                        "title": "Machine User Name",
                        "type": "string"
                    },
                    "previous_machine_user_name": {
                        "title": "Previous Machine User Name",
                        "type": "string"
                    },
                    "team_id": {
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "machine_user_id",
                    "machine_user_name",
                    "previous_machine_user_name",
                    "team_id",
                    "team_name"
                ],
                "title": "AuditLogEventGridMachineUserUpdatedV1",
                "type": "object"
            },
            "AuditLogEventIdentityProviderCreatedV1": {
                "description": "An identity provider was added.",
                "properties": {
                    "event_type": {
                        "const": "IDENTITY_PROVIDER_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "identity_provider_id": {
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Null when the provider was added without one.",
                        "title": "Description"
                    },
                    "predefined": {
                        "$ref": "#/components/schemas/AuditLogEventPredefinedIdentityProviderConfigV1",
                        "description": "The provider's settings, as the identity provider resource returns them."
                    }
                },
                "required": [
                    "event_type",
                    "identity_provider_id",
                    "name",
                    "predefined"
                ],
                "title": "AuditLogEventIdentityProviderCreatedV1",
                "type": "object"
            },
            "AuditLogEventIdentityProviderDeletedV1": {
                "description": "An identity provider was deleted.",
                "properties": {
                    "event_type": {
                        "const": "IDENTITY_PROVIDER_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "identity_provider_id": {
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "identity_provider_id",
                    "name"
                ],
                "title": "AuditLogEventIdentityProviderDeletedV1",
                "type": "object"
            },
            "AuditLogEventIdentityProviderUpdatedV1": {
                "description": "An identity provider was updated.",
                "properties": {
                    "event_type": {
                        "const": "IDENTITY_PROVIDER_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "identity_provider_id": {
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    },
                    "changes": {
                        "additionalProperties": {
                            "$ref": "#/components/schemas/AuditFieldChangeV1"
                        },
                        "description": "The fields the update changed, keyed by field name.",
                        "title": "Changes",
                        "type": "object"
                    }
                },
                "required": [
                    "event_type",
                    "identity_provider_id",
                    "name",
                    "changes"
                ],
                "title": "AuditLogEventIdentityProviderUpdatedV1",
                "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"
                    },
                    "region_update": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Region Update"
                    },
                    "instance_type_id_update": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Instance Type Id Update"
                    },
                    "promotion_settings_override": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventPromotionSettingsOverrideV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "autoscaling_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingSettingsUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "request_backpressure_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventRequestBackpressureSettingsUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "autoscaling_schedule_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleOperationsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "scale_previous_to_zero",
                    "trusted",
                    "publish",
                    "environment_name",
                    "region_update",
                    "instance_type_id_update",
                    "promotion_settings_override",
                    "autoscaling_settings_update",
                    "request_backpressure_settings_update",
                    "autoscaling_schedule_settings_update"
                ],
                "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"
                    },
                    "region_update": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Region Update"
                    },
                    "instance_type_id_update": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Instance Type Id Update"
                    },
                    "promotion_settings_override": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventPromotionSettingsOverrideV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "autoscaling_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingSettingsUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "request_backpressure_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventRequestBackpressureSettingsUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "autoscaling_schedule_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AuditLogEventAutoscalingScheduleOperationsV1"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                },
                "required": [
                    "event_type",
                    "model_id",
                    "model_name",
                    "deployment_id",
                    "deployment_name",
                    "environment_name",
                    "environment_id",
                    "region_update",
                    "instance_type_id_update",
                    "promotion_settings_override",
                    "autoscaling_settings_update",
                    "request_backpressure_settings_update",
                    "autoscaling_schedule_settings_update"
                ],
                "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"
            },
            "AuditLogEventOrganizationApiKeySettingsUpdatedV1": {
                "description": "An administrator changed which classes of API key the organization allows creating.",
                "properties": {
                    "event_type": {
                        "const": "ORGANIZATION_API_KEY_SETTINGS_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "organization_id": {
                        "title": "Organization Id",
                        "type": "string"
                    },
                    "previous_allow_personal_api_keys": {
                        "title": "Previous Allow Personal Api Keys",
                        "type": "boolean"
                    },
                    "new_allow_personal_api_keys": {
                        "title": "New Allow Personal Api Keys",
                        "type": "boolean"
                    },
                    "previous_allow_service_account_api_keys": {
                        "title": "Previous Allow Service Account Api Keys",
                        "type": "boolean"
                    },
                    "new_allow_service_account_api_keys": {
                        "title": "New Allow Service Account Api Keys",
                        "type": "boolean"
                    }
                },
                "required": [
                    "event_type",
                    "organization_id",
                    "previous_allow_personal_api_keys",
                    "new_allow_personal_api_keys",
                    "previous_allow_service_account_api_keys",
                    "new_allow_service_account_api_keys"
                ],
                "title": "AuditLogEventOrganizationApiKeySettingsUpdatedV1",
                "type": "object"
            },
            "AuditLogEventPredefinedIdentityProviderConfigV1": {
                "description": "Settings of a predefined identity provider, as recorded on an identity provider event. Not\nitself an event payload.",
                "properties": {
                    "kind": {
                        "description": "Which predefined provider, for example `AWS_EKS`.",
                        "title": "Kind",
                        "type": "string"
                    },
                    "issuer_url": {
                        "description": "The `iss` claim of the provider's tokens.",
                        "title": "Issuer Url",
                        "type": "string"
                    }
                },
                "required": [
                    "kind",
                    "issuer_url"
                ],
                "title": "AuditLogEventPredefinedIdentityProviderConfigV1",
                "type": "object"
            },
            "AuditLogEventPromotionSettingsOverrideV1": {
                "description": "Promotion settings overridden for one promotion. Null means the environment's value. Not\nitself a payload in the discriminated union.",
                "properties": {
                    "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"
                    }
                },
                "required": [
                    "redeploy_on_promotion",
                    "rolling_deploy",
                    "rolling_deploy_strategy",
                    "max_unavailable_percent",
                    "max_surge_percent",
                    "stabilization_time_seconds",
                    "replica_overhead_percent",
                    "promotion_cleanup_strategy"
                ],
                "title": "AuditLogEventPromotionSettingsOverrideV1",
                "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"
            },
            "AuditLogEventRequestBackpressureSettingsUpdateV1": {
                "description": "A request backpressure policy a request set; a null policy clears it. Not itself a\npayload in the discriminated union.",
                "properties": {
                    "policy": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Policy"
                    }
                },
                "required": [
                    "policy"
                ],
                "title": "AuditLogEventRequestBackpressureSettingsUpdateV1",
                "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"
            },
            "AuditLogEventServiceAccountCreatedV1": {
                "description": "A service account was created.",
                "properties": {
                    "event_type": {
                        "const": "SERVICE_ACCOUNT_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "service_account_id": {
                        "title": "Service Account Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Null when the account was created without one.",
                        "title": "Description"
                    },
                    "owner_team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The team that owns the account. Null for an organization account.",
                        "title": "Owner Team Id"
                    },
                    "preset_permissions": {
                        "$ref": "#/components/schemas/AuditLogEventServiceAccountPresetPermissionsV1"
                    }
                },
                "required": [
                    "event_type",
                    "service_account_id",
                    "name",
                    "preset_permissions"
                ],
                "title": "AuditLogEventServiceAccountCreatedV1",
                "type": "object"
            },
            "AuditLogEventServiceAccountDeletedV1": {
                "description": "A service account was deleted.",
                "properties": {
                    "event_type": {
                        "const": "SERVICE_ACCOUNT_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "service_account_id": {
                        "title": "Service Account Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "service_account_id",
                    "name"
                ],
                "title": "AuditLogEventServiceAccountDeletedV1",
                "type": "object"
            },
            "AuditLogEventServiceAccountPresetPermissionsV1": {
                "description": "A service account's access, as recorded on a service account event. Not itself an event\npayload.",
                "properties": {
                    "api_key_type": {
                        "description": "The API key type whose permissions the account has, as API key events record it.",
                        "title": "Api Key Type",
                        "type": "string"
                    },
                    "model_ids": {
                        "description": "Models the access is limited to; empty for all.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Model Ids",
                        "type": "array"
                    },
                    "environment_names": {
                        "description": "Environments the access is limited to, or may also manage; empty for none.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Environment Names",
                        "type": "array"
                    },
                    "model_api_slugs": {
                        "description": "Model APIs the access is limited to; empty for all.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Model Api Slugs",
                        "type": "array"
                    }
                },
                "required": [
                    "api_key_type",
                    "model_ids",
                    "environment_names",
                    "model_api_slugs"
                ],
                "title": "AuditLogEventServiceAccountPresetPermissionsV1",
                "type": "object"
            },
            "AuditLogEventServiceAccountUpdatedV1": {
                "description": "A service account was updated. Disabling or enabling it is a change to `disabled`.",
                "properties": {
                    "event_type": {
                        "const": "SERVICE_ACCOUNT_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "service_account_id": {
                        "title": "Service Account Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    },
                    "changes": {
                        "additionalProperties": {
                            "$ref": "#/components/schemas/AuditFieldChangeV1"
                        },
                        "description": "The fields the update changed, keyed by field name.",
                        "title": "Changes",
                        "type": "object"
                    }
                },
                "required": [
                    "event_type",
                    "service_account_id",
                    "name",
                    "changes"
                ],
                "title": "AuditLogEventServiceAccountUpdatedV1",
                "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"
            },
            "AuditLogEventTelemetryExportCreatedV1": {
                "description": "A telemetry export configuration was created.",
                "properties": {
                    "telemetry_export_configuration_id": {
                        "title": "Telemetry Export Configuration Id",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "TELEMETRY_EXPORT_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    }
                },
                "required": [
                    "telemetry_export_configuration_id",
                    "event_type"
                ],
                "title": "AuditLogEventTelemetryExportCreatedV1",
                "type": "object"
            },
            "AuditLogEventTelemetryExportDeletedV1": {
                "description": "A telemetry export configuration was deleted.",
                "properties": {
                    "telemetry_export_configuration_id": {
                        "title": "Telemetry Export Configuration Id",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "TELEMETRY_EXPORT_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    }
                },
                "required": [
                    "telemetry_export_configuration_id",
                    "event_type"
                ],
                "title": "AuditLogEventTelemetryExportDeletedV1",
                "type": "object"
            },
            "AuditLogEventTelemetryExportUpdatedV1": {
                "description": "A telemetry export configuration was updated. `enabled` is the new value when this update\npaused or resumed exporting and null when only the endpoint, protocol, headers, or credential\nchanged; a pause whose actor is the Baseten system was Baseten's own.",
                "properties": {
                    "telemetry_export_configuration_id": {
                        "title": "Telemetry Export Configuration Id",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "TELEMETRY_EXPORT_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "credential_rotated": {
                        "title": "Credential Rotated",
                        "type": "boolean"
                    },
                    "enabled": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "title": "Enabled"
                    }
                },
                "required": [
                    "telemetry_export_configuration_id",
                    "event_type",
                    "credential_rotated",
                    "enabled"
                ],
                "title": "AuditLogEventTelemetryExportUpdatedV1",
                "type": "object"
            },
            "AuditLogEventTrustRuleCreatedV1": {
                "description": "A trust rule was created.",
                "properties": {
                    "event_type": {
                        "const": "TRUST_RULE_CREATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "trust_rule_id": {
                        "title": "Trust Rule Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Null when the rule was created without one.",
                        "title": "Description"
                    },
                    "identity_provider_id": {
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "service_account_id": {
                        "title": "Service Account Id",
                        "type": "string"
                    },
                    "condition": {
                        "description": "The CEL expression a token's claims must satisfy.",
                        "title": "Condition",
                        "type": "string"
                    },
                    "audience": {
                        "description": "The `aud` claim a token must carry.",
                        "title": "Audience",
                        "type": "string"
                    },
                    "max_access_token_lifetime_seconds": {
                        "description": "The longest lifetime, in seconds, of an access token the rule issues.",
                        "title": "Max Access Token Lifetime Seconds",
                        "type": "integer"
                    }
                },
                "required": [
                    "event_type",
                    "trust_rule_id",
                    "name",
                    "identity_provider_id",
                    "service_account_id",
                    "condition",
                    "audience",
                    "max_access_token_lifetime_seconds"
                ],
                "title": "AuditLogEventTrustRuleCreatedV1",
                "type": "object"
            },
            "AuditLogEventTrustRuleDeletedV1": {
                "description": "A trust rule was deleted.",
                "properties": {
                    "event_type": {
                        "const": "TRUST_RULE_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "trust_rule_id": {
                        "title": "Trust Rule Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "event_type",
                    "trust_rule_id",
                    "name"
                ],
                "title": "AuditLogEventTrustRuleDeletedV1",
                "type": "object"
            },
            "AuditLogEventTrustRuleUpdatedV1": {
                "description": "A trust rule was updated.",
                "properties": {
                    "event_type": {
                        "const": "TRUST_RULE_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "trust_rule_id": {
                        "title": "Trust Rule Id",
                        "type": "string"
                    },
                    "name": {
                        "title": "Name",
                        "type": "string"
                    },
                    "changes": {
                        "additionalProperties": {
                            "$ref": "#/components/schemas/AuditFieldChangeV1"
                        },
                        "description": "The fields the update changed, keyed by field name.",
                        "title": "Changes",
                        "type": "object"
                    }
                },
                "required": [
                    "event_type",
                    "trust_rule_id",
                    "name",
                    "changes"
                ],
                "title": "AuditLogEventTrustRuleUpdatedV1",
                "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",
                    "API_KEY_LIFETIME_LIMITS_UPDATED",
                    "GATEWAY_ENDPOINT_CREATED",
                    "GATEWAY_ENDPOINT_UPDATED",
                    "GATEWAY_ENDPOINT_DELETED",
                    "PROVIDER_CONNECTION_CREATED",
                    "PROVIDER_CONNECTION_UPDATED",
                    "PROVIDER_CONNECTION_DELETED",
                    "GRID_MACHINE_USER_CREATED",
                    "GRID_MACHINE_USER_UPDATED",
                    "GRID_MACHINE_USER_DELETED",
                    "GRID_GUARDRAIL_CREATED",
                    "GRID_GUARDRAIL_UPDATED",
                    "GRID_GUARDRAIL_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",
                    "VOLUME_TAG_SET",
                    "VOLUME_TAG_DELETED",
                    "VOLUME_UPDATED",
                    "TELEMETRY_EXPORT_CREATED",
                    "TELEMETRY_EXPORT_UPDATED",
                    "TELEMETRY_EXPORT_DELETED",
                    "SERVICE_ACCOUNT_CREATED",
                    "SERVICE_ACCOUNT_UPDATED",
                    "SERVICE_ACCOUNT_DELETED",
                    "IDENTITY_PROVIDER_CREATED",
                    "IDENTITY_PROVIDER_UPDATED",
                    "IDENTITY_PROVIDER_DELETED",
                    "TRUST_RULE_CREATED",
                    "TRUST_RULE_UPDATED",
                    "TRUST_RULE_DELETED",
                    "ORGANIZATION_API_KEY_SETTINGS_UPDATED"
                ],
                "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": {
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "hosting": {
                        "default": "BASETEN_CLOUD",
                        "description": "Where the volume is stored: BASETEN_CLOUD, SINGLE_TENANT, or SELF_HOSTED. The same volume_ref under two hostings names two different volumes.",
                        "title": "Hosting",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "VOLUME_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "namespace": {
                        "title": "Namespace",
                        "type": "string"
                    },
                    "volume_name": {
                        "title": "Volume Name",
                        "type": "string"
                    },
                    "versions_deleted": {
                        "title": "Versions Deleted",
                        "type": "integer"
                    }
                },
                "required": [
                    "volume_ref",
                    "event_type",
                    "namespace",
                    "volume_name",
                    "versions_deleted"
                ],
                "title": "AuditLogEventVolumeDeletedV1",
                "type": "object"
            },
            "AuditLogEventVolumeTagDeletedV1": {
                "description": "Deleting a volume tag succeeded. `deleted` is false if the tag was already absent.",
                "properties": {
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "hosting": {
                        "default": "BASETEN_CLOUD",
                        "description": "Where the volume is stored: BASETEN_CLOUD, SINGLE_TENANT, or SELF_HOSTED. The same volume_ref under two hostings names two different volumes.",
                        "title": "Hosting",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "VOLUME_TAG_DELETED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "tag": {
                        "title": "Tag",
                        "type": "string"
                    },
                    "deleted": {
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "volume_ref",
                    "event_type",
                    "tag",
                    "deleted"
                ],
                "title": "AuditLogEventVolumeTagDeletedV1",
                "type": "object"
            },
            "AuditLogEventVolumeTagSetV1": {
                "description": "A volume tag was set on a version.",
                "properties": {
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "hosting": {
                        "default": "BASETEN_CLOUD",
                        "description": "Where the volume is stored: BASETEN_CLOUD, SINGLE_TENANT, or SELF_HOSTED. The same volume_ref under two hostings names two different volumes.",
                        "title": "Hosting",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "VOLUME_TAG_SET",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "tag": {
                        "title": "Tag",
                        "type": "string"
                    },
                    "digest": {
                        "title": "Digest",
                        "type": "string"
                    }
                },
                "required": [
                    "volume_ref",
                    "event_type",
                    "tag",
                    "digest"
                ],
                "title": "AuditLogEventVolumeTagSetV1",
                "type": "object"
            },
            "AuditLogEventVolumeUpdatedV1": {
                "description": "A volume's settings were updated.",
                "properties": {
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "hosting": {
                        "default": "BASETEN_CLOUD",
                        "description": "Where the volume is stored: BASETEN_CLOUD, SINGLE_TENANT, or SELF_HOSTED. The same volume_ref under two hostings names two different volumes.",
                        "title": "Hosting",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "VOLUME_UPDATED",
                        "title": "Event Type",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The volume's expiration time after the update, as an ISO 8601 string. Null when the update cleared it.",
                        "title": "Expires At"
                    },
                    "previous_expires_at": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The expiration time the update replaced, as an ISO 8601 string. Null when the volume had none.",
                        "title": "Previous Expires At"
                    }
                },
                "required": [
                    "volume_ref",
                    "event_type",
                    "expires_at",
                    "previous_expires_at"
                ],
                "title": "AuditLogEventVolumeUpdatedV1",
                "type": "object"
            },
            "AuditLogEventVolumeVersionDeletedV1": {
                "description": "One version of a volume was deleted.",
                "properties": {
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "hosting": {
                        "default": "BASETEN_CLOUD",
                        "description": "Where the volume is stored: BASETEN_CLOUD, SINGLE_TENANT, or SELF_HOSTED. The same volume_ref under two hostings names two different volumes.",
                        "title": "Hosting",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "VOLUME_VERSION_DELETED",
                        "title": "Event Type",
                        "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": [
                    "volume_ref",
                    "event_type",
                    "namespace",
                    "volume_name",
                    "version",
                    "digest"
                ],
                "title": "AuditLogEventVolumeVersionDeletedV1",
                "type": "object"
            },
            "AuditLogEventVolumeVersionRestoredV1": {
                "description": "A deleted version of a volume was restored.",
                "properties": {
                    "volume_ref": {
                        "title": "Volume Ref",
                        "type": "string"
                    },
                    "hosting": {
                        "default": "BASETEN_CLOUD",
                        "description": "Where the volume is stored: BASETEN_CLOUD, SINGLE_TENANT, or SELF_HOSTED. The same volume_ref under two hostings names two different volumes.",
                        "title": "Hosting",
                        "type": "string"
                    },
                    "event_type": {
                        "const": "VOLUME_VERSION_RESTORED",
                        "title": "Event Type",
                        "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": [
                    "volume_ref",
                    "event_type",
                    "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",
                    "GRID",
                    "WEBHOOK_SIGNING_SECRETS",
                    "USER_MANAGEMENT",
                    "DIRECTORY_GROUP_MANAGEMENT",
                    "SSH",
                    "TELEMETRY_EXPORT",
                    "WORKLOAD_IDENTITY"
                ],
                "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."
                    },
                    "failure_reason": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Why the deployment failed. Set only when the status is DEPLOY_FAILED; null otherwise.",
                        "title": "Failure Reason"
                    }
                },
                "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"
            },
            "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"
            },
            "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"
            },
            "PromotionEnvironmentSettingsUpdateV1": {
                "description": "Changes to an environment's settings, applied to a promoted deployment.",
                "properties": {
                    "region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Region for the promoted deployment, from `GET /v1/teams/{team_id}/regions`. Use an empty string for Global. If omitted, the deployment keeps its region. Regional environments only accept Global deployments.",
                        "title": "Region"
                    },
                    "instance_type_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Instance type for the promoted deployment, from `GET /v1/instance_types`. A different instance type than the deployment's creates a new deployment on it. Cannot be set with `preserve_env_instance_type: true`.",
                        "title": "Instance Type Id"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the promoted deployment."
                    },
                    "request_backpressure_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRequestBackpressureSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Request backpressure settings for the promoted deployment. A null policy clears it."
                    },
                    "autoscaling_schedule_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingScheduleSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling schedule changes for the environment, applied when the promotion completes."
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment, also used for this promotion."
                    }
                },
                "title": "PromotionEnvironmentSettingsUpdateV1",
                "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"
                    },
                    "environment_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PromotionEnvironmentSettingsUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Changes to the environment's settings. Omitted fields are unchanged. The promoted deployment uses the environment's current settings with these changes applied, and the environment keeps the result when the promotion completes.",
                        "examples": [
                            {
                                "autoscaling_settings": {
                                    "max_replica": 4,
                                    "min_replica": 2
                                }
                            }
                        ]
                    },
                    "promotion_settings_override": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for this promotion only. Omitted fields keep the environment's values, and the environment's promotion settings are unchanged.",
                        "examples": [
                            {
                                "rolling_deploy_config": {
                                    "max_surge_percent": 50
                                }
                            }
                        ]
                    }
                },
                "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"
            },
            "MetricDescriptorV1": {
                "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/MetricUnitHintV1",
                        "description": "Advisory unit of the metric's values."
                    },
                    "kind": {
                        "$ref": "#/components/schemas/MetricKindV1",
                        "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'}.",
                        "items": {
                            "additionalProperties": {
                                "type": "string"
                            },
                            "type": "object"
                        },
                        "title": "Label Sets",
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "unit_hint",
                    "kind",
                    "label_sets"
                ],
                "title": "MetricDescriptorV1",
                "type": "object"
            },
            "MetricKindV1": {
                "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": "MetricKindV1",
                "type": "string"
            },
            "MetricModeV1": {
                "description": "How metric values are aggregated over the request.",
                "enum": [
                    "CURRENT",
                    "SUMMARY",
                    "SERIES"
                ],
                "title": "MetricModeV1",
                "type": "string"
            },
            "MetricUnitHintV1": {
                "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).\n- ``CELSIUS``: a temperature in degrees Celsius.\n- ``WATTS``: power draw in watts.",
                "enum": [
                    "PER_SECOND",
                    "SECONDS",
                    "BYTES",
                    "MEBIBYTES",
                    "COUNT",
                    "RATIO",
                    "CELSIUS",
                    "WATTS"
                ],
                "title": "MetricUnitHintV1",
                "type": "string"
            },
            "MetricValueSetV1": {
                "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": "MetricValueSetV1",
                "type": "object"
            },
            "GetMetricsResponseV1": {
                "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/MetricModeV1",
                        "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/MetricDescriptorV1"
                        },
                        "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/MetricValueSetV1"
                        },
                        "title": "Metric Values",
                        "type": "array"
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis",
                    "mode",
                    "step_seconds",
                    "metric_descriptors",
                    "metric_values"
                ],
                "title": "GetMetricsResponseV1",
                "type": "object"
            },
            "GetDeploymentMetricsRequestV1": {
                "description": "Query params for ``GET /v1/models/.../deployments/.../metrics``.",
                "properties": {
                    "mode": {
                        "$ref": "#/components/schemas/MetricModeV1",
                        "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"
            },
            "StartupAttemptV1": {
                "description": "One startup attempt of a replica.",
                "properties": {
                    "model_id": {
                        "description": "Unique identifier of the model.",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Unique identifier of the deployment.",
                        "title": "Deployment Id"
                    },
                    "deployment_name": {
                        "description": "Name of the deployment.",
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Name of the environment. Null when querying a deployment.",
                        "title": "Environment Name"
                    },
                    "replica_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Identifier of the replica that started.",
                        "title": "Replica Id"
                    },
                    "started_at_epoch_millis": {
                        "description": "Time the attempt started, in epoch milliseconds.",
                        "title": "Started At Epoch Millis",
                        "type": "integer"
                    },
                    "ready_at_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Time the replica became ready, in epoch milliseconds. Null if it never did.",
                        "title": "Ready At Epoch Millis"
                    },
                    "duration_ms": {
                        "description": "Duration of the attempt, in milliseconds.",
                        "title": "Duration Ms",
                        "type": "integer"
                    },
                    "outcome": {
                        "$ref": "#/components/schemas/StartupOutcomeV1",
                        "description": "Outcome of the attempt."
                    },
                    "phase_summary": {
                        "description": "Phases recorded during the attempt.",
                        "items": {
                            "$ref": "#/components/schemas/StartupPhaseSummaryV1"
                        },
                        "title": "Phase Summary",
                        "type": "array"
                    }
                },
                "required": [
                    "model_id",
                    "deployment_id",
                    "deployment_name",
                    "environment_name",
                    "replica_id",
                    "started_at_epoch_millis",
                    "ready_at_epoch_millis",
                    "duration_ms",
                    "outcome",
                    "phase_summary"
                ],
                "title": "StartupAttemptV1",
                "type": "object"
            },
            "StartupOutcomeV1": {
                "description": "Outcome of a whole startup attempt.",
                "enum": [
                    "SUCCESS",
                    "FAILED",
                    "STALLED"
                ],
                "title": "StartupOutcomeV1",
                "type": "string"
            },
            "StartupPhaseStatusV1": {
                "description": "Outcome of one phase, independent of the outcome of the whole startup.",
                "enum": [
                    "COMPLETED",
                    "FAILED"
                ],
                "title": "StartupPhaseStatusV1",
                "type": "string"
            },
            "StartupPhaseSummaryV1": {
                "description": "One phase recorded during a startup attempt.",
                "properties": {
                    "phase": {
                        "$ref": "#/components/schemas/StartupPhaseV1",
                        "description": "The phase."
                    },
                    "status": {
                        "$ref": "#/components/schemas/StartupPhaseStatusV1",
                        "description": "Outcome of the phase."
                    },
                    "offset_ms": {
                        "description": "Time from the start of the attempt to the start of the phase, in milliseconds.",
                        "title": "Offset Ms",
                        "type": "integer"
                    },
                    "duration_ms": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Duration of the phase, in milliseconds. Can be 0 for a phase that finished within a second. Null if the phase did not finish.",
                        "title": "Duration Ms"
                    }
                },
                "required": [
                    "phase",
                    "status",
                    "offset_ms",
                    "duration_ms"
                ],
                "title": "StartupPhaseSummaryV1",
                "type": "object"
            },
            "StartupPhaseV1": {
                "description": "A stage of a replica startup.\n\n- ``SCHEDULING``: waiting for the replica to be placed on a node.\n- ``IMAGE_PULL``: pulling the container image.\n- ``WEIGHT_DOWNLOAD``: downloading model weights.\n- ``CONTAINER_CREATE``: creating and starting the model container, including\n  ``CONTAINER_START`` and ``READINESS``.\n- ``CONTAINER_START``: starting the model container.\n- ``READINESS``: waiting for the model to pass its readiness check.\n\n``CONTAINER_START`` and ``READINESS`` are accepted as filters but are reported only as\npart of ``CONTAINER_CREATE``.",
                "enum": [
                    "SCHEDULING",
                    "IMAGE_PULL",
                    "WEIGHT_DOWNLOAD",
                    "CONTAINER_CREATE",
                    "CONTAINER_START",
                    "READINESS"
                ],
                "title": "StartupPhaseV1",
                "type": "string"
            },
            "StartupAttemptsV1": {
                "description": "A page of startup attempts, newest first by default.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/StartupAttemptV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    },
                    "total_count": {
                        "description": "Number of attempts matching the filters, counted within the 1,000 most recent startups in the window.",
                        "title": "Total Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "items",
                    "pagination",
                    "total_count"
                ],
                "title": "StartupAttemptsV1",
                "type": "object"
            },
            "StartupSortFieldV1": {
                "description": "Field to sort startup attempts by.",
                "enum": [
                    "OUTCOME",
                    "STARTED_AT",
                    "READY_AT",
                    "DURATION"
                ],
                "title": "StartupSortFieldV1",
                "type": "string"
            },
            "GetStartupAttemptsRequestV1": {
                "description": "Query params for a startup attempts request (a deployment or an environment).",
                "properties": {
                    "start_epoch_millis": {
                        "description": "Start of the query window, in epoch milliseconds.",
                        "title": "Start Epoch Millis",
                        "type": "integer"
                    },
                    "end_epoch_millis": {
                        "description": "End of the query window, in epoch milliseconds. Must be after the start.",
                        "title": "End Epoch Millis",
                        "type": "integer"
                    },
                    "min_duration_ms": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only include startups that lasted at least this many milliseconds.",
                        "title": "Min Duration Ms"
                    },
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page. Pass the same filters and sort as the request that returned it.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 50,
                        "description": "Maximum number of attempts to return.",
                        "maximum": 100,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "outcomes": {
                        "description": "Only include attempts with one of these outcomes. Repeat to pass several.",
                        "items": {
                            "$ref": "#/components/schemas/StartupOutcomeV1"
                        },
                        "title": "Outcomes",
                        "type": "array"
                    },
                    "phase": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/StartupPhaseV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only include attempts that spent longer than 0 ms in this phase."
                    },
                    "search": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only include attempts whose replica ID matches exactly, or whose deployment name contains this text (case-insensitive).",
                        "title": "Search"
                    },
                    "sort_by": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/StartupSortFieldV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Field to sort attempts by. Defaults to `STARTED_AT`."
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort direction. Defaults to `desc`."
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis"
                ],
                "title": "GetStartupAttemptsRequestV1",
                "type": "object"
            },
            "StartupPercentilesV1": {
                "description": "A distribution of startup durations.\n\nStatistics cover only samples longer than 0 ms and are null when there are none.",
                "properties": {
                    "sample_count": {
                        "description": "Number of startups in the distribution, including those that took 0 ms. A phase that finishes within a second can record 0 ms.",
                        "title": "Sample Count",
                        "type": "integer"
                    },
                    "mean_ms": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Mean duration, in milliseconds.",
                        "title": "Mean Ms"
                    },
                    "p50_ms": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "50th percentile duration, in milliseconds.",
                        "title": "P50 Ms"
                    },
                    "p90_ms": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "90th percentile duration, in milliseconds.",
                        "title": "P90 Ms"
                    },
                    "p95_ms": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "95th percentile duration, in milliseconds.",
                        "title": "P95 Ms"
                    },
                    "p99_ms": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "99th percentile duration, in milliseconds.",
                        "title": "P99 Ms"
                    }
                },
                "required": [
                    "sample_count",
                    "mean_ms",
                    "p50_ms",
                    "p90_ms",
                    "p95_ms",
                    "p99_ms"
                ],
                "title": "StartupPercentilesV1",
                "type": "object"
            },
            "StartupPhasePercentilesV1": {
                "description": "The duration distribution of one startup phase.",
                "properties": {
                    "phase": {
                        "$ref": "#/components/schemas/StartupPhaseV1",
                        "description": "The phase."
                    },
                    "duration_ms": {
                        "$ref": "#/components/schemas/StartupPercentilesV1",
                        "description": "Durations of the phase."
                    }
                },
                "required": [
                    "phase",
                    "duration_ms"
                ],
                "title": "StartupPhasePercentilesV1",
                "type": "object"
            },
            "StartupSummaryV1": {
                "description": "Startup duration distributions over a time window.",
                "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"
                    },
                    "total_duration_ms": {
                        "$ref": "#/components/schemas/StartupPercentilesV1",
                        "description": "Durations of whole startups, sampled from the 1,000 most recent in the window."
                    },
                    "phase_duration_ms": {
                        "description": "Durations of each phase that was recorded in the window.",
                        "items": {
                            "$ref": "#/components/schemas/StartupPhasePercentilesV1"
                        },
                        "title": "Phase Duration Ms",
                        "type": "array"
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis",
                    "total_duration_ms",
                    "phase_duration_ms"
                ],
                "title": "StartupSummaryV1",
                "type": "object"
            },
            "GetStartupSummaryRequestV1": {
                "description": "Query params for a startup summary request (a deployment or an environment).",
                "properties": {
                    "start_epoch_millis": {
                        "description": "Start of the query window, in epoch milliseconds.",
                        "title": "Start Epoch Millis",
                        "type": "integer"
                    },
                    "end_epoch_millis": {
                        "description": "End of the query window, in epoch milliseconds. Must be after the start.",
                        "title": "End Epoch Millis",
                        "type": "integer"
                    },
                    "min_duration_ms": {
                        "anyOf": [
                            {
                                "minimum": 0,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only include startups that lasted at least this many milliseconds.",
                        "title": "Min Duration Ms"
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis"
                ],
                "title": "GetStartupSummaryRequestV1",
                "type": "object"
            },
            "DeploymentReplicaStatusV1": {
                "enum": [
                    "STARTING",
                    "ACTIVE",
                    "UNHEALTHY",
                    "TERMINATING",
                    "TERMINATED",
                    "UNKNOWN"
                ],
                "title": "DeploymentReplicaStatusV1",
                "type": "string"
            },
            "DeploymentReplicaV1": {
                "properties": {
                    "id": {
                        "description": "Pod-name suffix used for replica lookup and termination, usually five characters.",
                        "title": "Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "description": "ID of the replica's deployment.",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "deployment_name": {
                        "description": "Name of the replica's deployment.",
                        "title": "Deployment Name",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/DeploymentReplicaStatusV1",
                        "description": "Current replica lifecycle status."
                    },
                    "created_at": {
                        "description": "Replica creation time in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "terminated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Observed termination completion time in ISO 8601 format, or null if unavailable.",
                        "title": "Terminated At"
                    },
                    "age_seconds": {
                        "description": "Age in seconds since creation, frozen at termination.",
                        "title": "Age Seconds",
                        "type": "number"
                    },
                    "restart_count": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Model container lifetime restart count, or null if unavailable.",
                        "title": "Restart Count"
                    }
                },
                "required": [
                    "id",
                    "deployment_id",
                    "deployment_name",
                    "status",
                    "created_at",
                    "terminated_at",
                    "age_seconds",
                    "restart_count"
                ],
                "title": "DeploymentReplicaV1",
                "type": "object"
            },
            "DeploymentReplicasV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/DeploymentReplicaV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "DeploymentReplicasV1",
                "type": "object"
            },
            "DeploymentReplicasRequestV1": {
                "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"
                    },
                    "statuses": {
                        "description": "Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.",
                        "items": {
                            "$ref": "#/components/schemas/DeploymentReplicaStatusV1"
                        },
                        "title": "Statuses",
                        "type": "array"
                    }
                },
                "title": "DeploymentReplicasRequestV1",
                "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"
            },
            "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"
            },
            "EnvironmentTrafficRoutingV1": {
                "properties": {
                    "rules": {
                        "description": "The environment's active rules",
                        "items": {
                            "$ref": "#/components/schemas/TrafficRoutingRuleV1"
                        },
                        "title": "Rules",
                        "type": "array"
                    }
                },
                "required": [
                    "rules"
                ],
                "title": "EnvironmentTrafficRoutingV1",
                "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/ModelPromotionSettingsV1",
                        "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"
                    },
                    "traffic_routing": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/EnvironmentTrafficRoutingV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The environment's traffic routing rules. In development."
                    }
                },
                "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"
            },
            "ModelPromotionSettingsV1": {
                "description": "Promotion settings for promoting models",
                "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,
                        "deprecated": true,
                        "description": "Deprecated: models don't support canary promotions. Use `rolling_deploy`.",
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 600,
                        "deprecated": true,
                        "description": "Deprecated: models don't support canary promotions.",
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "title": "ModelPromotionSettingsV1",
                "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"
            },
            "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"
            },
            "TrafficRoutingRuleShadowSamplingModeV1": {
                "description": "How a shadow rule picks which requests to shadow. RANDOM picks each request\nindependently. USER_SESSION keeps a whole session together, so every request in a sampled\nsession is shadowed.",
                "enum": [
                    "RANDOM",
                    "USER_SESSION"
                ],
                "title": "TrafficRoutingRuleShadowSamplingModeV1",
                "type": "string"
            },
            "TrafficRoutingRuleV1": {
                "description": "A traffic routing rule on an environment.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the rule",
                        "title": "Id",
                        "type": "string"
                    },
                    "type": {
                        "const": "SHADOW",
                        "description": "Rule type. A shadow rule sends a copy of the environment's traffic to its target.",
                        "title": "Type",
                        "type": "string"
                    },
                    "targets": {
                        "description": "Where the rule sends traffic. Empty if the target has been deleted.",
                        "items": {
                            "$ref": "#/components/schemas/TrafficRoutingTargetV1"
                        },
                        "title": "Targets",
                        "type": "array"
                    },
                    "percent_traffic": {
                        "description": "Percentage of the environment's traffic shadowed",
                        "title": "Percent Traffic",
                        "type": "integer"
                    },
                    "expires_at": {
                        "description": "When the rule stops, in ISO 8601 format",
                        "format": "date-time",
                        "title": "Expires At",
                        "type": "string"
                    },
                    "sampling_mode": {
                        "$ref": "#/components/schemas/TrafficRoutingRuleShadowSamplingModeV1",
                        "description": "How requests are picked for shadowing"
                    },
                    "propagate_client_cancellation": {
                        "description": "Whether a shadow request is cancelled when the original client disconnects",
                        "title": "Propagate Client Cancellation",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "type",
                    "targets",
                    "percent_traffic",
                    "expires_at",
                    "sampling_mode",
                    "propagate_client_cancellation"
                ],
                "title": "TrafficRoutingRuleV1",
                "type": "object"
            },
            "TrafficRoutingTargetV1": {
                "description": "Where a rule sends traffic. Exactly one of deployment_id and environment is set.",
                "properties": {
                    "model_id": {
                        "description": "ID of the target's model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the target deployment",
                        "title": "Deployment Id"
                    },
                    "environment": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the target environment. Traffic goes to whichever deployment the environment is serving.",
                        "title": "Environment"
                    }
                },
                "required": [
                    "model_id"
                ],
                "title": "TrafficRoutingTargetV1",
                "type": "object"
            },
            "EnvironmentsV1": {
                "description": "list of environments",
                "properties": {
                    "environments": {
                        "items": {
                            "$ref": "#/components/schemas/EnvironmentV1"
                        },
                        "title": "Environments",
                        "type": "array"
                    }
                },
                "required": [
                    "environments"
                ],
                "title": "EnvironmentsV1",
                "type": "object"
            },
            "UpdateModelPromotionSettingsV1": {
                "description": "Promotion settings to update for a model environment",
                "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,
                        "deprecated": true,
                        "description": "Deprecated: models don't support canary promotions, and `true` is rejected. Use `rolling_deploy`.",
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "deprecated": true,
                        "description": "Deprecated: models don't support canary promotions.",
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "title": "UpdateModelPromotionSettingsV1",
                "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/UpdateModelPromotionSettingsV1"
                            },
                            {
                                "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": null,
                                "ramp_up_while_promoting": null,
                                "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"
            },
            "TrafficRoutingRuleUpsertV1": {
                "additionalProperties": false,
                "description": "A complete rule to create or replace.",
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Omit to create a rule, or pass an existing rule's ID to replace it. A replace can't change the target: delete the rule and create a new one instead.",
                        "title": "Id"
                    },
                    "type": {
                        "const": "SHADOW",
                        "description": "Rule type. A shadow rule sends a copy of the environment's traffic to its target.",
                        "title": "Type",
                        "type": "string"
                    },
                    "targets": {
                        "description": "Where the rule sends traffic. Exactly one target.",
                        "items": {
                            "$ref": "#/components/schemas/TrafficRoutingTargetUpsertV1"
                        },
                        "maxItems": 1,
                        "minItems": 1,
                        "title": "Targets",
                        "type": "array"
                    },
                    "percent_traffic": {
                        "description": "Percentage of the environment's traffic to shadow",
                        "maximum": 100,
                        "minimum": 1,
                        "title": "Percent Traffic",
                        "type": "integer"
                    },
                    "expires_at": {
                        "description": "When the rule stops, in ISO 8601 format with a timezone, at most 7 days out",
                        "format": "date-time",
                        "title": "Expires At",
                        "type": "string"
                    },
                    "sampling_mode": {
                        "$ref": "#/components/schemas/TrafficRoutingRuleShadowSamplingModeV1",
                        "default": "USER_SESSION",
                        "description": "How requests are picked for shadowing. Defaults to USER_SESSION."
                    },
                    "propagate_client_cancellation": {
                        "description": "Whether a shadow request is cancelled when the original client disconnects",
                        "title": "Propagate Client Cancellation",
                        "type": "boolean"
                    }
                },
                "required": [
                    "type",
                    "targets",
                    "percent_traffic",
                    "expires_at",
                    "propagate_client_cancellation"
                ],
                "title": "TrafficRoutingRuleUpsertV1",
                "type": "object"
            },
            "TrafficRoutingTargetUpsertV1": {
                "description": "Where a rule sends traffic. Set exactly one of deployment_id and environment.",
                "properties": {
                    "deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the target deployment",
                        "title": "Deployment Id"
                    },
                    "environment": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the target environment. Traffic goes to whichever deployment the environment is serving.",
                        "title": "Environment"
                    }
                },
                "title": "TrafficRoutingTargetUpsertV1",
                "type": "object"
            },
            "UpdateTrafficRoutingSettingsV1": {
                "additionalProperties": false,
                "description": "Partial update of an environment's traffic routing rules.",
                "properties": {
                    "rules": {
                        "description": "Complete rules to create or replace. Existing rules omitted here are unchanged.",
                        "items": {
                            "$ref": "#/components/schemas/TrafficRoutingRuleUpsertV1"
                        },
                        "title": "Rules",
                        "type": "array"
                    },
                    "delete_rules": {
                        "description": "IDs of rules to delete",
                        "items": {
                            "type": "string"
                        },
                        "title": "Delete Rules",
                        "type": "array"
                    }
                },
                "title": "UpdateTrafficRoutingSettingsV1",
                "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/UpdateModelPromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": null,
                                "ramp_up_while_promoting": null,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": true,
                                "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"
                            }
                        ]
                    },
                    "traffic_routing_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateTrafficRoutingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Partial traffic routing rule update. Each submitted rule is a complete create or replace. Deletes are applied first. In development.",
                        "examples": [
                            {
                                "rules": [
                                    {
                                        "expires_at": "2026-10-13T18:00:00Z",
                                        "percent_traffic": 25,
                                        "propagate_client_cancellation": true,
                                        "sampling_mode": "USER_SESSION",
                                        "targets": [
                                            {
                                                "deployment_id": "abc123"
                                            }
                                        ],
                                        "type": "SHADOW"
                                    }
                                ]
                            },
                            {
                                "delete_rules": [
                                    "rule-id"
                                ]
                            }
                        ]
                    }
                },
                "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/MetricModeV1",
                        "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"
                    },
                    "environment_settings_update": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PromotionEnvironmentSettingsUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Changes to the environment's settings. Omitted fields are unchanged. The promoted deployment uses the environment's current settings with these changes applied, and the environment keeps the result when the promotion completes.",
                        "examples": [
                            {
                                "autoscaling_settings": {
                                    "max_replica": 4,
                                    "min_replica": 2
                                }
                            }
                        ]
                    },
                    "promotion_settings_override": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for this promotion only. Omitted fields keep the environment's values, and the environment's promotion settings are unchanged.",
                        "examples": [
                            {
                                "rolling_deploy_config": {
                                    "max_surge_percent": 50
                                }
                            }
                        ]
                    }
                },
                "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"
            },
            "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"
            },
            "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"
                    },
                    "project_accelerator": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional default GPU type for cache-enabled CPU job placement, such as H100. GPU jobs use their requested GPU type; uncached CPU jobs use normal CPU routing. Omitting this field preserves the stored default; providing a value updates it. Existing cache-affinity requirements still apply.",
                        "examples": [
                            "H100"
                        ],
                        "title": "Project Accelerator"
                    }
                },
                "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"
            },
            "AvailabilityModelV1": {
                "description": "Capacity a training job or Loops trainer runs on.",
                "enum": [
                    "standard",
                    "spot"
                ],
                "title": "AvailabilityModelV1",
                "type": "string"
            },
            "CheckpointSyncStatus": {
                "description": "Lifecycle state for the checkpoint uploader.",
                "enum": [
                    "SYNCING",
                    "COMPLETED"
                ],
                "title": "CheckpointSyncStatus",
                "type": "string"
            },
            "TrainingBDNConfigResponseV1": {
                "properties": {
                    "mounts": {
                        "items": {
                            "$ref": "#/components/schemas/TrainingBDNMountResponseV1"
                        },
                        "title": "Mounts",
                        "type": "array"
                    }
                },
                "title": "TrainingBDNConfigResponseV1",
                "type": "object"
            },
            "TrainingBDNMountResponseV1": {
                "properties": {
                    "source": {
                        "title": "Source",
                        "type": "string"
                    },
                    "path": {
                        "title": "Path",
                        "type": "string"
                    },
                    "include": {
                        "description": "Relative glob patterns selecting files to mount; empty includes all files.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Relative glob patterns excluding files from the mount; exclusions win.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    }
                },
                "required": [
                    "source",
                    "path"
                ],
                "title": "TrainingBDNMountResponseV1",
                "type": "object"
            },
            "TrainingJobV1": {
                "properties": {
                    "bdn": {
                        "$ref": "#/components/schemas/TrainingBDNConfigResponseV1"
                    },
                    "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. While the job is pending, a hint when switching it to spot capacity would let it start sooner.",
                        "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/AvailabilityModelV1",
                        "default": "standard",
                        "description": "Capacity guarantee for the job. 'standard' runs on capacity that is not preempted. 'spot' runs on interruptible capacity that may be preempted; you are responsible for checkpointing your own progress."
                    },
                    "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"
                    },
                    "project_accelerator": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Default GPU type for cache-enabled CPU job placement.",
                        "title": "Project Accelerator"
                    },
                    "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"
            },
            "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"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "training_projects",
                    "pagination"
                ],
                "title": "ListTrainingProjectsResponseV1",
                "type": "object"
            },
            "ListTrainingProjectsRequestV1": {
                "description": "A request to list training projects.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Return only the project with this exact name.",
                        "title": "Name"
                    },
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor from the pagination.cursor field of a previous response. Omit both cursor and limit to get every project in one response.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum number of projects to return, up to 1000.",
                        "title": "Limit"
                    }
                },
                "title": "ListTrainingProjectsRequestV1",
                "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"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "training_project",
                    "training_jobs",
                    "pagination"
                ],
                "title": "ListTrainingJobsResponseV1",
                "type": "object"
            },
            "ListTrainingJobsRequestV1": {
                "description": "A request to list a training project's jobs.",
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor from the pagination.cursor field of a previous response. Omit both cursor and limit to get every job in one response.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum number of jobs to return, newest first, up to 1000.",
                        "title": "Limit"
                    }
                },
                "title": "ListTrainingJobsRequestV1",
                "type": "object"
            },
            "AuthMethod": {
                "enum": [
                    "CUSTOM_SECRET",
                    "AWS_OIDC",
                    "GCP_OIDC",
                    "HUGGING_FACE_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"
                    },
                    "persistent_home": {
                        "default": false,
                        "description": "Whether to keep `$HOME` in a per-job directory on the project cache, so its contents outlive the job. Requires `enabled`.",
                        "examples": [
                            true,
                            false
                        ],
                        "title": "Persistent Home",
                        "type": "boolean"
                    }
                },
                "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/AvailabilityModelV1",
                        "default": "standard",
                        "description": "Capacity guarantee for the job. Defaults to 'standard'. 'standard' runs on capacity that is not preempted. 'spot' runs on interruptible capacity that may be preempted; you are responsible for checkpointing your 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",
                                "persistent_home": false,
                                "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 of the uploaded runtime artifact. Use the `s3_bucket` returned by `GET /v1/blobs/credentials/train`.",
                        "title": "S3 Bucket",
                        "type": "string"
                    },
                    "s3_key": {
                        "description": "S3 key of the uploaded runtime artifact. Use the `s3_key` returned by `GET /v1/blobs/credentials/train`.",
                        "examples": [
                            "organizations/abc123/training/1f0e8c2a-7b3d-4e5f-9a6b-2c4d8e0f1a3b/scripts.tgz"
                        ],
                        "title": "S3 Key",
                        "type": "string"
                    }
                },
                "required": [
                    "s3_bucket",
                    "s3_key"
                ],
                "title": "CreateTrainingJobS3Artifact",
                "type": "object"
            },
            "CreateTrainingJobV1": {
                "description": "Configuration for a training job.",
                "properties": {
                    "bdn": {
                        "$ref": "#/components/schemas/TrainingBDNConfigV1"
                    },
                    "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"
            },
            "TrainingBDNConfigV1": {
                "additionalProperties": false,
                "description": "Read-only BDN mounts with the same reference semantics as inference.",
                "properties": {
                    "mounts": {
                        "items": {
                            "$ref": "#/components/schemas/TrainingBDNMountV1"
                        },
                        "maxItems": 32,
                        "title": "Mounts",
                        "type": "array"
                    }
                },
                "title": "TrainingBDNConfigV1",
                "type": "object"
            },
            "TrainingBDNMountV1": {
                "additionalProperties": false,
                "description": "A requested read-only BDN dataset mount.",
                "properties": {
                    "source": {
                        "title": "Source",
                        "type": "string"
                    },
                    "path": {
                        "title": "Path",
                        "type": "string"
                    },
                    "include": {
                        "description": "Relative glob patterns selecting files to mount; empty includes all files.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include",
                        "type": "array"
                    },
                    "exclude": {
                        "description": "Relative glob patterns excluding files from the mount; exclusions win.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Exclude",
                        "type": "array"
                    }
                },
                "required": [
                    "source",
                    "path"
                ],
                "title": "TrainingBDNMountV1",
                "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/AvailabilityModelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New capacity guarantee for a PENDING training job. 'standard' runs on capacity that is not preempted. 'spot' runs on interruptible capacity that may be preempted; you are responsible for checkpointing your 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. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to the share of time the GPU's streaming multiprocessors have work assigned, from 0 to 1. This counts any GPU work, not only tensor core math; see gpu_tensor_core_utilization for that. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "gpu_temperature_celsius": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to GPU temperature in degrees Celsius. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Temperature Celsius",
                        "type": "object"
                    },
                    "gpu_power_usage_watts": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to GPU power draw in watts. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Power Usage Watts",
                        "type": "object"
                    },
                    "gpu_tensor_core_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to the share of time the GPU tensor cores are active, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Tensor Core Utilization",
                        "type": "object"
                    },
                    "gpu_memory_bandwidth_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to the share of cycles GPU memory is actively reading or writing, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Memory Bandwidth Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "The CPU usage measured in cores. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "The CPU memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "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. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node."
                    }
                },
                "required": [
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "gpu_temperature_celsius",
                    "gpu_power_usage_watts",
                    "gpu_tensor_core_utilization",
                    "gpu_memory_bandwidth_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. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to the share of time the GPU's streaming multiprocessors have work assigned, from 0 to 1. This counts any GPU work, not only tensor core math; see gpu_tensor_core_utilization for that. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "gpu_temperature_celsius": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to GPU temperature in degrees Celsius. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Temperature Celsius",
                        "type": "object"
                    },
                    "gpu_power_usage_watts": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to GPU power draw in watts. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Power Usage Watts",
                        "type": "object"
                    },
                    "gpu_tensor_core_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to the share of time the GPU tensor cores are active, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Tensor Core Utilization",
                        "type": "object"
                    },
                    "gpu_memory_bandwidth_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to the share of cycles GPU memory is actively reading or writing, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "title": "Gpu Memory Bandwidth Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "The CPU usage measured in cores. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "The CPU memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.",
                        "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. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node."
                    },
                    "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",
                    "gpu_temperature_celsius",
                    "gpu_power_usage_watts",
                    "gpu_tensor_core_utilization",
                    "gpu_memory_bandwidth_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": {
                        "deprecated": true,
                        "description": "Deprecated: use `checkpoint_name`, which has the same value.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "checkpoint_name": {
                        "description": "The checkpoint's name, for example `checkpoint-500`. To refer to the checkpoint in a URL, use its `id`.",
                        "title": "Checkpoint Name",
                        "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's unique ID, used in checkpoint URLs.",
                        "title": "Id",
                        "type": "string"
                    },
                    "training_job_id": {
                        "description": "The ID of the training job.",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the checkpoint expires and is deleted. Null means it never expires.",
                        "title": "Expires At"
                    }
                },
                "required": [
                    "checkpoint_id",
                    "checkpoint_name",
                    "created_at",
                    "checkpoint_type",
                    "base_model",
                    "lora_adapter_config",
                    "size_bytes",
                    "id",
                    "training_job_id",
                    "expires_at"
                ],
                "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"
            },
            "SetTrainingJobCheckpointTtlRequestV1": {
                "properties": {
                    "ttl_seconds": {
                        "anyOf": [
                            {
                                "maximum": 315360000,
                                "minimum": 3600,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Seconds from now until the checkpoint expires and is deleted, from 3600 (1 hour) to 315360000 (10 years). Null removes the TTL, so the checkpoint never expires.",
                        "title": "Ttl Seconds"
                    }
                },
                "required": [
                    "ttl_seconds"
                ],
                "title": "SetTrainingJobCheckpointTtlRequestV1",
                "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": {
                    "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": 1000,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "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"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "training_jobs",
                    "pagination"
                ],
                "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"
            },
            "LoopsServerlessPricingV1": {
                "description": "A model's current serverless Loops prices for this workspace, in USD per million tokens.\n\nPrices come from the workspace's plan, so they include its price overrides. A meter the plan\ndoes not price is null.",
                "properties": {
                    "cost_per_million_uncached_prefill_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "USD per million prompt tokens that miss the prefix cache.",
                        "examples": [
                            "0.15"
                        ],
                        "title": "Cost Per Million Uncached Prefill Tokens"
                    },
                    "cost_per_million_cached_prefill_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "USD per million prompt tokens served from the prefix cache.",
                        "examples": [
                            "0.03"
                        ],
                        "title": "Cost Per Million Cached Prefill Tokens"
                    },
                    "cost_per_million_sample_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "USD per million tokens the sampler generates.",
                        "examples": [
                            "0.6"
                        ],
                        "title": "Cost Per Million Sample Tokens"
                    },
                    "cost_per_million_train_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "USD per million tokens the trainer processes.",
                        "examples": [
                            "1.2"
                        ],
                        "title": "Cost Per Million Train Tokens"
                    }
                },
                "required": [
                    "cost_per_million_uncached_prefill_tokens",
                    "cost_per_million_cached_prefill_tokens",
                    "cost_per_million_sample_tokens",
                    "cost_per_million_train_tokens"
                ],
                "title": "LoopsServerlessPricingV1",
                "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"
                    },
                    "serverless": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Early access only. Whether this workspace can use serverless Loops for this model.",
                        "title": "Serverless"
                    },
                    "serverless_pricing": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoopsServerlessPricingV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Early access only. This workspace's current serverless prices for the model. Present only when 'serverless' is true and the workspace's plan prices the model."
                    },
                    "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 without ``enabled`` 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. Models this workspace can run come first, then the rest, each group sorted by name.",
                        "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'. Without 'enabled', 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"
                    },
                    "enabled": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Pass true to list only the models this workspace can run now, or false for only the ones it cannot. Omit to list both. With 'model', an empty list can also mean the model is supported but filtered out.",
                        "examples": [
                            true
                        ],
                        "title": "Enabled"
                    }
                },
                "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"
                    },
                    "lora_config_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The run's immutable LoRA config version.",
                        "title": "Lora Config Version"
                    },
                    "base_checkpoint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The custom base checkpoint the run started from, pinned to a commit (hf://<org>/<repo>@<sha>). Null when it uses the base model's own weights.",
                        "title": "Base Checkpoint"
                    },
                    "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"
                    },
                    "session_id": {
                        "description": "The session ID this sampler belongs to.",
                        "title": "Session 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": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Hashid of the underlying Baseten model. Null for a serverless sampler.",
                        "title": "Model Id"
                    },
                    "deployment_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Hashid of the specific model deployment (version). Null for a serverless sampler.",
                        "title": "Deployment Id"
                    },
                    "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"
                    },
                    "base_checkpoint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The custom base checkpoint the sampler serves, pinned to a commit (hf://<org>/<repo>@<sha>). Null when it uses the base model's own weights.",
                        "title": "Base Checkpoint"
                    }
                },
                "required": [
                    "id",
                    "session_id",
                    "base_url",
                    "base_model",
                    "created_at",
                    "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"
                    },
                    "session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter runs by the session that created them. An unknown or inaccessible session returns an empty list.",
                        "examples": [
                            "k4q95w5"
                        ],
                        "title": "Session Id"
                    },
                    "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/AvailabilityModelV1",
                        "default": "standard",
                        "description": "Capacity the trainer runs on. 'standard' 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"
                    },
                    "base_checkpoint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf://<org>/<repo>[@<revision>]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://<project>@<job_id>/<checkpoint>, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.",
                        "title": "Base Checkpoint"
                    },
                    "base_checkpoint_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingWeightAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.",
                        "examples": [
                            {
                                "auth_method": "CUSTOM_SECRET",
                                "auth_secret_name": "hf_read_my_checkpoint"
                            }
                        ]
                    },
                    "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"
            },
            "LoopsCheckpointV1": {
                "description": "A checkpoint saved by a Loops run.",
                "properties": {
                    "checkpoint_id": {
                        "deprecated": true,
                        "description": "Deprecated: use `checkpoint_name`, which has the same value.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "checkpoint_name": {
                        "description": "The checkpoint's name, for example `checkpoint-500`. To refer to the checkpoint in a URL, use its `id`.",
                        "title": "Checkpoint Name",
                        "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's unique ID, used in checkpoint URLs.",
                        "title": "Id",
                        "type": "string"
                    },
                    "lora_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoopsLoRAConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The immutable LoRA config used to save this checkpoint. Null means the checkpoint is unsupported and cannot be loaded."
                    },
                    "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."
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the checkpoint expires and is deleted, set from the TTL it was saved with. Null means it's kept until you delete it. A checkpoint that's still in use when it expires, for example deployed, is deleted once it's released.",
                        "title": "Expires At"
                    }
                },
                "required": [
                    "checkpoint_id",
                    "checkpoint_name",
                    "created_at",
                    "checkpoint_type",
                    "base_model",
                    "lora_adapter_config",
                    "size_bytes",
                    "id",
                    "lora_config",
                    "run_id",
                    "target",
                    "expires_at"
                ],
                "title": "LoopsCheckpointV1",
                "type": "object"
            },
            "LoopsLoRAConfigV1": {
                "description": "A published LoRA config: which modules the adapter targets and how experts are laid out.",
                "properties": {
                    "config_version": {
                        "description": "The config version, like v1.",
                        "title": "Config Version",
                        "type": "string"
                    },
                    "targets": {
                        "description": "The module names the LoRA adapter targets.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Targets",
                        "type": "array"
                    },
                    "expert_layout": {
                        "anyOf": [
                            {
                                "enum": [
                                    "per_expert",
                                    "shared_outer",
                                    "shared_adapter"
                                ],
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "How routed-expert LoRA weights are laid out. Null when no experts are targeted.",
                        "title": "Expert Layout"
                    }
                },
                "required": [
                    "config_version",
                    "targets"
                ],
                "title": "LoopsLoRAConfigV1",
                "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"
            },
            "DeleteLoopsRunResponseV1": {
                "description": "A Loops run whose delete was accepted.",
                "properties": {
                    "id": {
                        "description": "The deleted Loops run ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "kept_checkpoints": {
                        "description": "The run's checkpoints that were not deleted because something still uses them, such as a deployment. They stay usable until that stops.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsCheckpointV1"
                        },
                        "title": "Kept Checkpoints",
                        "type": "array"
                    }
                },
                "required": [
                    "id",
                    "kept_checkpoints"
                ],
                "title": "DeleteLoopsRunResponseV1",
                "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"
            },
            "LoopsPlacementScopeV1": {
                "description": "Where a Loops run's trainer or a standalone sampler runs.",
                "enum": [
                    "default",
                    "serverless",
                    "dedicated"
                ],
                "title": "LoopsPlacementScopeV1",
                "type": "string"
            },
            "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/AvailabilityModelV1",
                        "default": "standard",
                        "description": "Capacity the trainer runs on. 'standard' 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"
                    },
                    "base_checkpoint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf://<org>/<repo>[@<revision>]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://<project>@<job_id>/<checkpoint>, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.",
                        "title": "Base Checkpoint"
                    },
                    "base_checkpoint_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingWeightAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.",
                        "examples": [
                            {
                                "auth_method": "CUSTOM_SECRET",
                                "auth_secret_name": "hf_read_my_checkpoint"
                            }
                        ]
                    },
                    "scope": {
                        "$ref": "#/components/schemas/LoopsPlacementScopeV1",
                        "default": "default",
                        "description": "Choose where this runs. 'default' lets Baseten choose. 'serverless' runs on Baseten's shared capacity, and fails instead of falling back when shared capacity can't serve the request. 'dedicated' gives it its own deployment, which you size and pay for."
                    }
                },
                "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": {
                    "session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter samplers by the session that created them. An unknown or inaccessible session returns an empty list.",
                        "examples": [
                            "k4q95w5"
                        ],
                        "title": "Session Id"
                    },
                    "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/AvailabilityModelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Capacity the sampler runs on. 'spot' allows preemption when its GPUs are reclaimed. Defaults to 'standard' 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"
                    },
                    "scope": {
                        "$ref": "#/components/schemas/LoopsPlacementScopeV1",
                        "default": "default",
                        "description": "Choose where this runs. 'default' lets Baseten choose. 'serverless' runs on Baseten's shared capacity, and fails instead of falling back when shared capacity can't serve the request. 'dedicated' gives it its own deployment, which you size and pay for. Standalone samplers only: a run's sampler runs where its run does."
                    }
                },
                "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"
            },
            "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"
                    },
                    "run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Loops run whose sampler will load the checkpoint. The checkpoint must use the run's LoRA config.",
                        "examples": [
                            "k4q95w5"
                        ],
                        "title": "Run Id"
                    }
                },
                "required": [
                    "checkpoint_path"
                ],
                "title": "ValidateLoopsCheckpointRequestV1",
                "type": "object"
            },
            "ValidateLoopsCheckpointResponseV1": {
                "description": "Response for ``POST /v1/loops/checkpoints/validate``. Empty on success;\ninaccessible or malformed paths, and checkpoints of another LoRA config than\n``run_id``'s, 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"
            },
            "LoopsCheckpointTombstoneV1": {
                "description": "A Loops checkpoint whose delete was accepted.",
                "properties": {
                    "id": {
                        "description": "The deleted checkpoint ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "run_id": {
                        "description": "The ID of the run that produced the checkpoint.",
                        "title": "Run Id",
                        "type": "string"
                    },
                    "checkpoint_id": {
                        "deprecated": true,
                        "description": "Deprecated: use `checkpoint_name`, which has the same value.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "checkpoint_name": {
                        "description": "The name the checkpoint was saved under.",
                        "title": "Checkpoint Name",
                        "type": "string"
                    },
                    "target": {
                        "$ref": "#/components/schemas/TrainerCheckpointTarget",
                        "description": "Whether the checkpoint was loadable by the sampler or by the run."
                    },
                    "path": {
                        "description": "The checkpoint's bt:// path.",
                        "title": "Path",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "run_id",
                    "checkpoint_id",
                    "checkpoint_name",
                    "target",
                    "path"
                ],
                "title": "LoopsCheckpointTombstoneV1",
                "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. Empty when the checkpoint is the whole version.",
                        "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"
            },
            "SetLoopsCheckpointTtlRequestV1": {
                "properties": {
                    "ttl_seconds": {
                        "anyOf": [
                            {
                                "maximum": 315360000,
                                "minimum": 3600,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Seconds from now until the checkpoint expires and is deleted, from 3600 (1 hour) to 315360000 (10 years). Null removes the TTL, so the checkpoint never expires.",
                        "title": "Ttl Seconds"
                    }
                },
                "required": [
                    "ttl_seconds"
                ],
                "title": "SetLoopsCheckpointTtlRequestV1",
                "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_checkpoint": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The custom base checkpoint the deployment's trainer loaded, pinned to a commit (hf://<org>/<repo>@<sha>). Null when it uses the base model's own weights.",
                        "title": "Base Checkpoint"
                    },
                    "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/AvailabilityModelV1",
                        "default": "standard",
                        "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": "Configured minimum GPU allocation for the team. Not enforced. 0 if not configured.",
                        "title": "Baseline",
                        "type": "integer"
                    },
                    "limit": {
                        "description": "The team's GPU quota for this type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota. On-demand jobs can run past it by borrowing from the organization's shared pool, when one exists.",
                        "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 on-demand (non-spot) 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": "Configured minimum GPU allocation (`min_gpus`). 0 if not configured. Use `on_demand_quota` for the quota applied to on-demand jobs.",
                        "title": "Baseline",
                        "type": "integer"
                    },
                    "limit": {
                        "description": "Configured maximum GPU allocation (`max_gpus`). Use `on_demand_quota` and `spot_quota` for the quotas applied to jobs.",
                        "title": "Limit",
                        "type": "integer"
                    },
                    "on_demand_quota": {
                        "description": "GPU quota for this type for on-demand (non-spot) jobs: the most GPUs they can use at once.",
                        "title": "On Demand Quota",
                        "type": "integer"
                    },
                    "spot_quota": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GPU quota for this type for spot jobs. Spot shares this quota with on-demand jobs: spot can use up to the quota minus on-demand GPUs in use. Null if spot is not enabled for the organization.",
                        "title": "Spot Quota"
                    },
                    "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 on-demand (non-spot) 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": [
                    "gpu_type",
                    "baseline",
                    "limit",
                    "on_demand_quota",
                    "usage_count"
                ],
                "title": "TrainingGpuCapacityItemV1",
                "type": "object"
            },
            "GetTrainingGpuCapacityResponseV1": {
                "description": "Response for the training GPU capacity endpoint.",
                "properties": {
                    "gpu_capacities": {
                        "description": "Organization GPU quotas and current usage per GPU type",
                        "items": {
                            "$ref": "#/components/schemas/TrainingGpuCapacityItemV1"
                        },
                        "title": "Gpu Capacities",
                        "type": "array"
                    },
                    "team_gpu_capacities": {
                        "description": "Per-team GPU quotas and current usage per GPU type",
                        "items": {
                            "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1"
                        },
                        "title": "Team Gpu Capacities",
                        "type": "array"
                    },
                    "spot_enabled": {
                        "default": false,
                        "description": "Whether the organization can submit spot training jobs.",
                        "title": "Spot Enabled",
                        "type": "boolean"
                    }
                },
                "required": [
                    "gpu_capacities"
                ],
                "title": "GetTrainingGpuCapacityResponseV1",
                "type": "object"
            },
            "PatchTeamTrainingGpuCapacityRequestV1": {
                "description": "A request to set the GPU quota for a (team, gpu_type) pair.\n\nCreates the quota 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": "The team's GPU quota for this type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota. On-demand jobs can run past it by borrowing from the organization's shared pool, when one exists.",
                        "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 quota.",
                "properties": {
                    "team_gpu_capacity": {
                        "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1",
                        "description": "The updated per-team GPU quota"
                    }
                },
                "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",
                    "GRID",
                    "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",
                            "GRID",
                            "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"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Expiration time in UTC. Must be in the future. Personal keys must expire within 90 days, or sooner if your organization sets a lower limit. Team and organization keys require an expiration within your organization's limit when one is set; otherwise they may omit it or use null. Organization lifetime limits do not apply to Grid keys.",
                        "examples": [
                            "2027-01-01T00:00:00Z"
                        ],
                        "title": "Expires At"
                    },
                    "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",
                            "GRID",
                            "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"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Expiry time in ISO 8601 format, or null if the key never expires.",
                        "title": "Expires At"
                    },
                    "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": "Team-specific state for an added Model API.",
                "properties": {
                    "added_at": {
                        "description": "When the team 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 team last invoked this Model API. Null if the team has never invoked it.",
                        "title": "Last Used At"
                    }
                },
                "required": [
                    "added_at"
                ],
                "title": "ModelAPIOrgDetailsV1",
                "type": "object"
            },
            "ModelAPIRateLimitV1": {
                "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"
                    },
                    "is_pooled": {
                        "description": "Whether this limit uses the organization-wide pool. The threshold is the effective limit, including any adaptive grant.",
                        "title": "Is Pooled",
                        "type": "boolean"
                    },
                    "service_tier": {
                        "$ref": "#/components/schemas/ModelAPIServiceTierV1",
                        "description": "Service tier the rate limit applies to.",
                        "examples": [
                            "DEFAULT",
                            "FLEX"
                        ]
                    },
                    "baseline_threshold": {
                        "description": "Configured baseline threshold for the rate limit, before any adaptive increase. Equal to `threshold` when no adaptive increase is in effect.",
                        "examples": [
                            1000,
                            50000
                        ],
                        "minimum": 0,
                        "title": "Baseline Threshold",
                        "type": "integer"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold",
                    "is_pooled",
                    "service_tier",
                    "baseline_threshold"
                ],
                "title": "ModelAPIRateLimitV1",
                "type": "object"
            },
            "ModelAPIServiceTierV1": {
                "enum": [
                    "DEFAULT",
                    "FLEX",
                    "PRIORITY"
                ],
                "title": "ModelAPIServiceTierV1",
                "type": "string"
            },
            "ModelAPITeamDetailsV1": {
                "properties": {
                    "id": {
                        "description": "Organization Shared Endpoint ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "team_id": {
                        "description": "Team that has added this Model API.",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team that has added this Model API.",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "added_at": {
                        "description": "When the team first added this Model API.",
                        "format": "date-time",
                        "title": "Added At",
                        "type": "string"
                    },
                    "last_used_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "When the team last invoked this Model API. Null if never invoked.",
                        "title": "Last Used At"
                    },
                    "rate_limits": {
                        "description": "Effective rate limits for this team's Model API, at most one per type, unit, and service tier.",
                        "items": {
                            "$ref": "#/components/schemas/ModelAPIRateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "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 if unavailable.",
                        "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 if unavailable.",
                        "title": "Cost Per Million Output Tokens"
                    }
                },
                "required": [
                    "id",
                    "team_id",
                    "team_name",
                    "added_at",
                    "last_used_at",
                    "rate_limits",
                    "cost_per_million_input_tokens",
                    "cost_per_million_output_tokens"
                ],
                "title": "ModelAPITeamDetailsV1",
                "type": "object"
            },
            "ModelAPIV1": {
                "description": "Model metadata and authorized team details, with retained legacy fields.",
                "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"
                            }
                        ],
                        "deprecated": true,
                        "description": "Deprecated and will be removed in a future version. Legacy effective input-token price. Use team_details pricing instead. Retained during migration; null when pricing is unavailable.",
                        "examples": [
                            "0.13"
                        ],
                        "title": "Cost Per Million Input Tokens"
                    },
                    "cost_per_million_cached_input_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Effective cost per million cached input tokens, in dollars. Null when pricing is unavailable or the Model API has no cached input price.",
                        "examples": [
                            "0.03"
                        ],
                        "title": "Cost Per Million Cached Input Tokens"
                    },
                    "cost_per_million_output_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "deprecated": true,
                        "description": "Deprecated and will be removed in a future version. Legacy effective output-token price. Use team_details pricing instead. Retained during migration; null when pricing is unavailable.",
                        "examples": [
                            "0.50"
                        ],
                        "title": "Cost Per Million Output Tokens"
                    },
                    "rate_limits": {
                        "deprecated": true,
                        "description": "Deprecated and will be removed in a future version. Legacy Default Team effective limits, independent of team_ids, or catalog defaults when not added or unauthorized. Use team_details for team limits; this field is not the org-pool limit view.",
                        "items": {
                            "$ref": "#/components/schemas/ModelAPIRateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "org_details": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ModelAPIOrgDetailsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "deprecated": true,
                        "description": "Deprecated and will be removed in a future version. Legacy Default Team state, independent of team_ids. Use team_details instead. Null when not added or unauthorized."
                    },
                    "team_details": {
                        "description": "Added Model API details for authorized teams, ordered by team ID. Empty when no team in the selected scope has added this Model API.",
                        "items": {
                            "$ref": "#/components/schemas/ModelAPITeamDetailsV1"
                        },
                        "title": "Team Details",
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "display_name",
                    "description",
                    "release_date",
                    "invoke_url",
                    "context_length",
                    "cost_per_million_input_tokens",
                    "cost_per_million_cached_input_tokens",
                    "cost_per_million_output_tokens",
                    "rate_limits"
                ],
                "title": "ModelAPIV1",
                "type": "object"
            },
            "RateLimitUnitV1": {
                "enum": [
                    "SECOND",
                    "MINUTE"
                ],
                "title": "RateLimitUnitV1",
                "type": "string"
            },
            "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"
                    },
                    "team_ids": {
                        "description": "Select teams for added-model details, filtering, and ordering, repeated once per team. Defaults to all teams where you can invoke Model APIs. Any unauthorized team causes a 403.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Team Ids",
                        "type": "array"
                    },
                    "added_only": {
                        "default": false,
                        "description": "When true, restrict the result to Model APIs added by any team where you can invoke Model APIs. Explicit team_ids narrow this to the selected teams. 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"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team the usage is attributed to. Null when not grouping by team or when team attribution is unavailable.",
                        "title": "Team Id"
                    },
                    "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",
                    "team"
                ],
                "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, or team. 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"
                    },
                    "team_ids": {
                        "description": "Return only usage for these teams, repeated once per team. Defaults to all teams you can manage.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Team Ids",
                        "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"
            },
            "GetModelAPIMetricsRequestV1": {
                "description": "Query params for ``GET /v1/model_apis/.../metrics``.",
                "properties": {
                    "mode": {
                        "$ref": "#/components/schemas/MetricModeV1",
                        "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_model_api_inference_requests_total, baseten_model_api_incoming_inference_requests_total, and baseten_model_api_tokens_total. Unknown names are rejected; valid names that are not enabled for your organization are omitted from the response.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Metrics",
                        "type": "array"
                    },
                    "team_ids": {
                        "description": "Return only metrics for these teams, repeated once per team. Defaults to all teams you can manage. Any unauthorized team causes a 403.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Team Ids",
                        "type": "array"
                    }
                },
                "title": "GetModelAPIMetricsRequestV1",
                "type": "object"
            },
            "ModelAPIRequestV1": {
                "description": "Query-string filters for ``GET /v1/model_apis/{model_api_name}``.",
                "properties": {
                    "team_ids": {
                        "description": "Select teams for added-model details, repeated once per team. Defaults to all teams where you can invoke Model APIs. Any unauthorized team causes a 403.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Team Ids",
                        "type": "array"
                    }
                },
                "title": "ModelAPIRequestV1",
                "type": "object"
            },
            "EgressRestrictionsV1": {
                "properties": {
                    "fqdn_allow_list": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Allowed outbound FQDNs; '*' wildcards are supported.",
                        "examples": [
                            [
                                "*.example.com"
                            ]
                        ],
                        "title": "Fqdn Allow List"
                    },
                    "ip_allow_list": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Allowed outbound IPv4 addresses or CIDR ranges.",
                        "examples": [
                            [
                                "1.1.1.1/32"
                            ]
                        ],
                        "title": "Ip Allow List"
                    }
                },
                "title": "EgressRestrictionsV1",
                "type": "object"
            },
            "LLMRuntimeV1": {
                "properties": {
                    "oidc": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RuntimeOidcV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Runtime OIDC token mounting configuration"
                    }
                },
                "title": "LLMRuntimeV1",
                "type": "object"
            },
            "RuntimeOidcV1": {
                "properties": {
                    "enabled": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "If true, mounts an OIDC bearer token for the deployment to access at runtime. If unset, the platform default applies.",
                        "title": "Enabled"
                    },
                    "byok": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "BYOK configuration for envelope-encrypted BDN weights in BIS-LLM deployments. Requires runtime.oidc.enabled to be true.",
                        "title": "Byok"
                    }
                },
                "title": "RuntimeOidcV1",
                "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"
                    },
                    "deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the deployment, unique within the model. Use only A-Z, a-z, 0-9, '-', '_', and '.'. The name 'development' is reserved. If omitted or empty, a name is generated automatically.",
                        "title": "Deployment Name"
                    },
                    "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"
                    },
                    "bdn": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "BDN configuration for read-only sealed volume mounts; supports mounts only",
                        "title": "Bdn"
                    },
                    "egress_restrictions": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/EgressRestrictionsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Restricts this deployment's egress to the specified FQDNs and IP addresses; an empty block allows none. Requires the organization to have egress restrictions enabled."
                    },
                    "runtime": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LLMRuntimeV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Runtime configuration for the deployment"
                    },
                    "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"
                    },
                    "deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the deployment, unique within the model. Use only A-Z, a-z, 0-9, '-', '_', and '.'. The name 'development' is reserved. If omitted or empty, a name is generated automatically.",
                        "title": "Deployment Name"
                    },
                    "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"
                    },
                    "bdn": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "BDN configuration for read-only sealed volume mounts; supports mounts only",
                        "title": "Bdn"
                    },
                    "egress_restrictions": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/EgressRestrictionsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Restricts this deployment's egress to the specified FQDNs and IP addresses; an empty block allows none. Requires the organization to have egress restrictions enabled."
                    },
                    "runtime": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LLMRuntimeV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Runtime configuration for the deployment"
                    }
                },
                "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"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Base Model"
                    },
                    "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"
                    },
                    "model_family": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "title": "Model Family"
                    }
                },
                "required": [
                    "license"
                ],
                "title": "LibraryListingMetadataV1",
                "type": "object"
            },
            "LibraryListingModality": {
                "enum": [
                    "text",
                    "image",
                    "audio",
                    "video",
                    "embedding",
                    "rerank",
                    "decision"
                ],
                "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"
                    },
                    "is_listed": {
                        "description": "Whether the listing appears in catalogs; unlisted listings still deploy from a direct link",
                        "title": "Is Listed",
                        "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",
                    "is_listed",
                    "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"
                    },
                    "is_listed": {
                        "default": true,
                        "description": "Whether the listing appears in catalogs; unlisted listings still deploy from a direct link",
                        "title": "Is Listed",
                        "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"
                    },
                    "is_listed": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether the listing appears in catalogs; unlisted listings still deploy from a direct link",
                        "title": "Is Listed"
                    },
                    "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"
                    },
                    "is_listed": {
                        "default": true,
                        "description": "Whether the listing appears in catalogs; unlisted listings still deploy from a direct link. Only used when creating a new listing.",
                        "title": "Is Listed",
                        "type": "boolean"
                    },
                    "replace_model": {
                        "default": false,
                        "description": "Allow publishing from a different model than the listing's current one. The listing then points at the new model; earlier versions and existing deployments are unaffected. Fails if the new model already backs another listing.",
                        "title": "Replace Model",
                        "type": "boolean"
                    }
                },
                "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"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team the cost is attributed to. Null when not grouping by team or when team attribution is unavailable.",
                        "title": "Team Id"
                    },
                    "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",
                    "team"
                ],
                "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, service_tier, or team. 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 totals across all teams you can manage.",
                        "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"
                    },
                    "team_ids": {
                        "description": "Return only costs attributed to these teams, repeated once per team. Defaults to all teams you can manage.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Team Ids",
                        "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, LOOPS_SAMPLER, or LOOPS_RUN)"
                    },
                    "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 run, 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"
            },
            "DailyLoopsUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost in dollars across all four meters",
                        "title": "Subtotal"
                    },
                    "uncached_prefill": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Prompt tokens that missed the prefix cache"
                    },
                    "cached_prefill": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Prompt tokens served from the prefix cache"
                    },
                    "sample": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Tokens generated by sampling"
                    },
                    "train": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Tokens processed by forward and forward-backward training calls"
                    },
                    "date": {
                        "description": "Date of the usage",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    }
                },
                "required": [
                    "subtotal",
                    "uncached_prefill",
                    "cached_prefill",
                    "sample",
                    "train",
                    "date"
                ],
                "title": "DailyLoopsUsageV1",
                "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": "Usage charges in dollars before applying credits",
                        "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"
            },
            "LoopsBaseModelItemV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost in dollars across all four meters",
                        "title": "Subtotal"
                    },
                    "uncached_prefill": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Prompt tokens that missed the prefix cache"
                    },
                    "cached_prefill": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Prompt tokens served from the prefix cache"
                    },
                    "sample": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Tokens generated by sampling"
                    },
                    "train": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Tokens processed by forward and forward-backward training calls"
                    },
                    "base_model": {
                        "description": "Base model the usage is priced by",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyLoopsUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    },
                    "breakdown": {
                        "description": "Usage per run and standalone sampler on this base model",
                        "items": {
                            "$ref": "#/components/schemas/LoopsResourceItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "uncached_prefill",
                    "cached_prefill",
                    "sample",
                    "train",
                    "base_model"
                ],
                "title": "LoopsBaseModelItemV1",
                "type": "object"
            },
            "LoopsMeterUsageV1": {
                "properties": {
                    "tokens": {
                        "description": "Tokens billed on this meter",
                        "title": "Tokens",
                        "type": "integer"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost of those tokens in dollars",
                        "title": "Subtotal"
                    }
                },
                "required": [
                    "tokens",
                    "subtotal"
                ],
                "title": "LoopsMeterUsageV1",
                "type": "object"
            },
            "LoopsResourceItemV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost in dollars across all four meters",
                        "title": "Subtotal"
                    },
                    "uncached_prefill": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Prompt tokens that missed the prefix cache"
                    },
                    "cached_prefill": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Prompt tokens served from the prefix cache"
                    },
                    "sample": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Tokens generated by sampling"
                    },
                    "train": {
                        "$ref": "#/components/schemas/LoopsMeterUsageV1",
                        "description": "Tokens processed by forward and forward-backward training calls"
                    },
                    "billable_resource": {
                        "$ref": "#/components/schemas/BillableResourceV1",
                        "description": "The Loops run (LOOPS_RUN) or standalone sampler (LOOPS_SAMPLER). A resource that no longer exists has only its ID and kind set."
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyLoopsUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "uncached_prefill",
                    "cached_prefill",
                    "sample",
                    "train",
                    "billable_resource"
                ],
                "title": "LoopsResourceItemV1",
                "type": "object"
            },
            "LoopsUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost in dollars before credits",
                        "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-base-model usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/LoopsBaseModelItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total"
                ],
                "title": "LoopsUsageV1",
                "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"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team ID for multi-team organizations; otherwise null",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team name, including historical teams; null if unavailable",
                        "title": "Team Name"
                    },
                    "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": "Usage charges in dollars before applying credits",
                        "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": "Usage charges in dollars after applying credits, floored at zero",
                        "title": "Total"
                    },
                    "breakdown": {
                        "description": "Per-model usage breakdown, split by team for multi-team organizations",
                        "items": {
                            "$ref": "#/components/schemas/ModelApiItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total"
                ],
                "title": "ModelApisUsageV1",
                "type": "object"
            },
            "ResourceKind": {
                "enum": [
                    "LOOPS_RUN",
                    "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": "Usage charges in dollars before applying credits",
                        "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"
                    },
                    "loops_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoopsUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Serverless Loops usage, billed per token. Loops usage on dedicated trainers and samplers is billed by the minute and is part of training usage."
                    }
                },
                "title": "UsageSummaryV1",
                "type": "object"
            },
            "UsageSummaryRequestV1": {
                "properties": {
                    "start_date": {
                        "description": "Inclusive start date (ISO 8601, normalized to midnight UTC). Earliest queryable: 2026-01-01.",
                        "format": "date-time",
                        "title": "Start Date",
                        "type": "string"
                    },
                    "end_date": {
                        "description": "Exclusive end date (ISO 8601, normalized to midnight 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"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team attributed to the usage. Null when not grouping by team or when historical team attribution is unavailable.",
                        "title": "Team Id"
                    }
                },
                "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"
            },
            "ToolCallUsageDimensionV1": {
                "enum": [
                    "TEAM"
                ],
                "title": "ToolCallUsageDimensionV1",
                "type": "string"
            },
            "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"
                    },
                    "team_ids": {
                        "description": "Return only usage for these teams, repeated once per team. Defaults to all teams you can manage. An unauthorized team ID causes a 403 response.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Team Ids",
                        "type": "array"
                    },
                    "group_by": {
                        "description": "Pass TEAM to split daily rows by team. Defaults to aggregating across teams.",
                        "items": {
                            "$ref": "#/components/schemas/ToolCallUsageDimensionV1"
                        },
                        "title": "Group By",
                        "type": "array"
                    }
                },
                "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"
            },
            "AccessAssignmentV1": {
                "description": "A role held by a user, service account, or directory group, for the organization or in a\nteam.",
                "properties": {
                    "id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Unique identifier of the role assignment. Null for a built-in role held through organization or team membership.",
                        "title": "Id"
                    },
                    "granted_via": {
                        "$ref": "#/components/schemas/AccessGrantedViaV1",
                        "description": "`ASSIGNMENT` for a role assignment, or `MEMBERSHIP` for a built-in role held as an organization or team member"
                    },
                    "role_id": {
                        "description": "ID of the role",
                        "title": "Role Id",
                        "type": "string"
                    },
                    "role_name": {
                        "description": "Name of the role",
                        "title": "Role Name",
                        "type": "string"
                    },
                    "subject_type": {
                        "$ref": "#/components/schemas/AccessSubjectTypeV1",
                        "description": "Type of the subject that holds the role"
                    },
                    "subject_id": {
                        "description": "ID of the user, service account, or directory group that holds the role",
                        "title": "Subject Id",
                        "type": "string"
                    },
                    "subject_name": {
                        "description": "Name of the user, service account, or directory group that holds the role",
                        "title": "Subject Name",
                        "type": "string"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "ID of the team the role applies in. Null for the organization.",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Name of the team the role applies in. Null for the organization.",
                        "title": "Team Name"
                    },
                    "resources": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/AccessResourceV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Resources the role applies to. Null for every resource where it applies.",
                        "title": "Resources"
                    },
                    "environments": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Names of the environments the role applies in, such as `production`. Null for every environment.",
                        "title": "Environments"
                    },
                    "created_by": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "ID of the user who assigned the role. Null for a role held through membership, or one no user assigned.",
                        "title": "Created By"
                    },
                    "created_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Time the role was assigned. Null for a role held through membership.",
                        "title": "Created At"
                    }
                },
                "required": [
                    "id",
                    "granted_via",
                    "role_id",
                    "role_name",
                    "subject_type",
                    "subject_id",
                    "subject_name",
                    "team_id",
                    "team_name",
                    "resources",
                    "environments",
                    "created_by",
                    "created_at"
                ],
                "title": "AccessAssignmentV1",
                "type": "object"
            },
            "AccessGrantedViaV1": {
                "description": "How a role is held.",
                "enum": [
                    "ASSIGNMENT",
                    "MEMBERSHIP"
                ],
                "title": "AccessGrantedViaV1",
                "type": "string"
            },
            "AccessResourceTypeV1": {
                "description": "Type of a resource a role assignment can select.",
                "enum": [
                    "CHAIN",
                    "GATEWAY_ENDPOINT",
                    "GATEWAY_GROUP",
                    "GATEWAY_KEY",
                    "GRID_CONNECTION",
                    "GRID_ROUTE",
                    "LIBRARY_LISTING",
                    "MODEL",
                    "MODEL_API",
                    "SANDBOX",
                    "SECRET",
                    "SERVICE_ACCOUNT",
                    "TRAINING_JOB",
                    "TRAINING_LOOP",
                    "TRAINING_PROJECT",
                    "VOLUME",
                    "WEBHOOK_SECRET"
                ],
                "title": "AccessResourceTypeV1",
                "type": "string"
            },
            "AccessResourceV1": {
                "description": "A resource a role assignment selects.",
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/AccessResourceTypeV1",
                        "description": "Type of the resource"
                    },
                    "identifier": {
                        "description": "Unique identifier of the resource, such as a model's ID",
                        "title": "Identifier",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "identifier"
                ],
                "title": "AccessResourceV1",
                "type": "object"
            },
            "AccessSubjectTypeV1": {
                "description": "Who holds a role.",
                "enum": [
                    "USER",
                    "SERVICE_ACCOUNT",
                    "DIRECTORY_GROUP"
                ],
                "title": "AccessSubjectTypeV1",
                "type": "string"
            },
            "EffectiveAccessGrantV1": {
                "description": "A place a permission is held: the organization, a team, a resource, or an environment.",
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "ID of the team. Null for the organization.",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Name of the team. Null for the organization.",
                        "title": "Team Name"
                    },
                    "resource": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AccessResourceV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The resource. Null when the grant isn't limited to one resource."
                    },
                    "environment": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Name of the environment, such as `production`. Null for every environment. Permission checks don't take an environment yet, so these grants aren't confirmed.",
                        "title": "Environment"
                    }
                },
                "required": [
                    "team_id",
                    "team_name",
                    "resource",
                    "environment"
                ],
                "title": "EffectiveAccessGrantV1",
                "type": "object"
            },
            "EffectiveAccessPermissionV1": {
                "description": "A permission a user or service account holds, and where.",
                "properties": {
                    "name": {
                        "description": "Name of the permission, such as `model.deployment.write`",
                        "title": "Name",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Short human-readable name",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "category": {
                        "description": "Name of the permission's category, such as `model.deployment`",
                        "title": "Category",
                        "type": "string"
                    },
                    "grants": {
                        "description": "Where it's held, one entry for each place a role grants it",
                        "items": {
                            "$ref": "#/components/schemas/EffectiveAccessGrantV1"
                        },
                        "title": "Grants",
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "display_name",
                    "category",
                    "grants"
                ],
                "title": "EffectiveAccessPermissionV1",
                "type": "object"
            },
            "EffectiveAccessV1": {
                "description": "The roles a user or service account holds, and the permissions they grant it.",
                "properties": {
                    "subject_type": {
                        "$ref": "#/components/schemas/AccessSubjectTypeV1",
                        "description": "`USER` or `SERVICE_ACCOUNT`"
                    },
                    "subject_id": {
                        "description": "ID of the user or service account",
                        "title": "Subject Id",
                        "type": "string"
                    },
                    "subject_name": {
                        "description": "Name of the user or service account",
                        "title": "Subject Name",
                        "type": "string"
                    },
                    "assignments": {
                        "description": "Every role held: assigned to the user or service account, or to a directory group it is in, or held through organization or team membership",
                        "items": {
                            "$ref": "#/components/schemas/AccessAssignmentV1"
                        },
                        "title": "Assignments",
                        "type": "array"
                    },
                    "permissions": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/EffectiveAccessPermissionV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Every permission held, and where. Null until fine-grained authorization decides your organization's requests.",
                        "title": "Permissions"
                    }
                },
                "required": [
                    "subject_type",
                    "subject_id",
                    "subject_name",
                    "assignments",
                    "permissions"
                ],
                "title": "EffectiveAccessV1",
                "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"
                    },
                    "allow_personal_api_keys": {
                        "description": "Whether members can create new personal API keys. Existing keys keep working.",
                        "title": "Allow Personal Api Keys",
                        "type": "boolean"
                    },
                    "allow_service_account_api_keys": {
                        "description": "Whether new team and organization API keys can be created. Existing keys keep working.",
                        "title": "Allow Service Account Api Keys",
                        "type": "boolean"
                    },
                    "allow_team_admins_to_manage_roles": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether team admins create, change, and delete their team's custom roles. When false, only organization admins do, and team admins still assign roles in their team. Null when custom roles aren't available to your organization, or you can't read its roles.",
                        "title": "Allow Team Admins To Manage Roles"
                    }
                },
                "required": [
                    "org_id",
                    "created_at",
                    "allow_personal_api_keys",
                    "allow_service_account_api_keys"
                ],
                "title": "OrganizationInfoV1",
                "type": "object"
            },
            "UpdateOrganizationRequestV1": {
                "additionalProperties": false,
                "description": "Partial update of the caller's organization settings. Omitted fields are unchanged.",
                "properties": {
                    "allow_personal_api_keys": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether members can create new personal API keys. Null is not accepted.",
                        "title": "Allow Personal Api Keys"
                    },
                    "allow_service_account_api_keys": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether new team and organization API keys can be created. Null is not accepted.",
                        "title": "Allow Service Account Api Keys"
                    },
                    "allow_team_admins_to_manage_roles": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether team admins create, change, and delete their team's custom roles. Needs `access.role.write` for the organization. Null is not accepted.",
                        "title": "Allow Team Admins To Manage Roles"
                    }
                },
                "title": "UpdateOrganizationRequestV1",
                "type": "object"
            },
            "ServiceAccountPresetPermissionsV1": {
                "description": "A service account's access: one of the access types API keys have.\n\nTemporary: mirrors API key access until fine-grained access control is available, and may be removed.",
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/ServiceAccountPresetTypeV1",
                        "description": "What the service account may do. WORKSPACE_MANAGE_API_KEYS is for organization-level accounts only; every other type needs a team.",
                        "examples": [
                            "WORKSPACE_MANAGE_ALL"
                        ]
                    },
                    "model_ids": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "WORKSPACE_INVOKE and WORKSPACE_EXPORT_METRICS only. Models the account covers. Omit for every model in the team, including models added later.",
                        "examples": [
                            [
                                "abcd1234"
                            ]
                        ],
                        "title": "Model Ids"
                    },
                    "environment_names": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "WORKSPACE_INVOKE: environments the account may call; omit for all. With model_ids, each model must have each environment. WORKSPACE_MANAGE_ALL: restricted environments the account may also manage.",
                        "examples": [
                            [
                                "production"
                            ]
                        ],
                        "title": "Environment Names"
                    },
                    "model_api_slugs": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "WORKSPACE_INVOKE_MODEL_APIS only. Model APIs the account may call; omit for all.",
                        "examples": [
                            [
                                "my-model-api"
                            ]
                        ],
                        "title": "Model Api Slugs"
                    }
                },
                "required": [
                    "type"
                ],
                "title": "ServiceAccountPresetPermissionsV1",
                "type": "object"
            },
            "ServiceAccountPresetTypeV1": {
                "description": "What a service account may do: the workspace API key categories, plus Model APIs.\n\nTemporary: mirrors API key access until fine-grained access control is available, and may be removed.",
                "enum": [
                    "WORKSPACE_MANAGE_ALL",
                    "WORKSPACE_INVOKE",
                    "WORKSPACE_EXPORT_METRICS",
                    "WORKSPACE_MANAGE_API_KEYS",
                    "WORKSPACE_INVOKE_MODEL_APIS"
                ],
                "title": "ServiceAccountPresetTypeV1",
                "type": "string"
            },
            "ServiceAccountV1": {
                "description": "A named service account that workload identity federation tokens act as.",
                "properties": {
                    "id": {
                        "description": "Service account ID",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name, unique in the organization",
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Description",
                        "title": "Description"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The team that owns the account. Null for an organization account.",
                        "title": "Team Id"
                    },
                    "preset_permissions": {
                        "$ref": "#/components/schemas/ServiceAccountPresetPermissionsV1",
                        "description": "What the service account may do. Temporary; may be removed once fine-grained access control is available."
                    },
                    "disabled": {
                        "description": "Whether the account is disabled. A disabled account can't be used.",
                        "title": "Disabled",
                        "type": "boolean"
                    },
                    "last_used_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Last time a request authenticated as this account, to within an hour. Null until the first.",
                        "title": "Last Used At"
                    },
                    "created_at": {
                        "description": "Time the account was created",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Time the account was last updated",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "preset_permissions",
                    "disabled",
                    "created_at",
                    "updated_at"
                ],
                "title": "ServiceAccountV1",
                "type": "object"
            },
            "ServiceAccountsV1": {
                "description": "A page of service accounts.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/ServiceAccountV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ServiceAccountsV1",
                "type": "object"
            },
            "ServiceAccountsRequestV1": {
                "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"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only the account with this name, ignoring case",
                        "title": "Name"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only this team's accounts",
                        "title": "Team Id"
                    },
                    "disabled": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only disabled or enabled accounts",
                        "title": "Disabled"
                    }
                },
                "title": "ServiceAccountsRequestV1",
                "type": "object"
            },
            "ServiceAccountPresetPermissionsRequestV1": {
                "additionalProperties": false,
                "description": "A service account's access, as sent. Omit a list for no restriction; never send it empty.",
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/ServiceAccountPresetTypeV1",
                        "description": "What the service account may do. WORKSPACE_MANAGE_API_KEYS is for organization-level accounts only; every other type needs a team.",
                        "examples": [
                            "WORKSPACE_MANAGE_ALL"
                        ]
                    },
                    "model_ids": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "WORKSPACE_INVOKE and WORKSPACE_EXPORT_METRICS only. Models the account covers. Omit for every model in the team, including models added later.",
                        "examples": [
                            [
                                "abcd1234"
                            ]
                        ],
                        "title": "Model Ids"
                    },
                    "environment_names": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "WORKSPACE_INVOKE: environments the account may call; omit for all. With model_ids, each model must have each environment. WORKSPACE_MANAGE_ALL: restricted environments the account may also manage.",
                        "examples": [
                            [
                                "production"
                            ]
                        ],
                        "title": "Environment Names"
                    },
                    "model_api_slugs": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "WORKSPACE_INVOKE_MODEL_APIS only. Model APIs the account may call; omit for all.",
                        "examples": [
                            [
                                "my-model-api"
                            ]
                        ],
                        "title": "Model Api Slugs"
                    }
                },
                "required": [
                    "type"
                ],
                "title": "ServiceAccountPresetPermissionsRequestV1",
                "type": "object"
            },
            "CreateServiceAccountRequestV1": {
                "additionalProperties": false,
                "description": "Request to create a service account.",
                "properties": {
                    "name": {
                        "description": "Name, unique in the organization. Can be changed later.",
                        "examples": [
                            "ci-deployer"
                        ],
                        "maxLength": 255,
                        "minLength": 1,
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "maxLength": 1024,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional description, up to 1,024 characters",
                        "title": "Description"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The team that owns the account. Omit for an organization account. Can't be changed.",
                        "title": "Team Id"
                    },
                    "preset_permissions": {
                        "$ref": "#/components/schemas/ServiceAccountPresetPermissionsRequestV1",
                        "description": "What the service account may do. Can be changed later. Temporary; may be removed once fine-grained access control is available."
                    }
                },
                "required": [
                    "name",
                    "preset_permissions"
                ],
                "title": "CreateServiceAccountRequestV1",
                "type": "object"
            },
            "DeletedServiceAccountV1": {
                "properties": {
                    "id": {
                        "description": "ID of the deleted service account",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Always true",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "DeletedServiceAccountV1",
                "type": "object"
            },
            "UpdateServiceAccountRequestV1": {
                "additionalProperties": false,
                "description": "Request to update a service account. Only the fields sent change.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name, unique in the organization",
                        "title": "Name"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "maxLength": 1024,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Description, up to 1,024 characters; null clears it",
                        "title": "Description",
                        "x-null-distinct": true
                    },
                    "disabled": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Disable the account to stop it being used, or enable it again",
                        "title": "Disabled"
                    },
                    "preset_permissions": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ServiceAccountPresetPermissionsRequestV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Replaces the account's access as a whole. Temporary; may be removed once fine-grained access control is available."
                    }
                },
                "title": "UpdateServiceAccountRequestV1",
                "type": "object"
            },
            "PredefinedIdentityProviderKindV1": {
                "description": "An identity provider Baseten supports.",
                "enum": [
                    "GITHUB_ACTIONS",
                    "GCP",
                    "BASETEN",
                    "AWS_IAM",
                    "AWS_EKS",
                    "AZURE_MANAGED_IDENTITY_V1",
                    "AZURE_MANAGED_IDENTITY_V2",
                    "AZURE_AKS"
                ],
                "title": "PredefinedIdentityProviderKindV1",
                "type": "string"
            },
            "PredefinedIdentityProviderV1": {
                "properties": {
                    "kind": {
                        "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1",
                        "description": "Pass as `kind` when adding the provider"
                    },
                    "name": {
                        "description": "Display name",
                        "title": "Name",
                        "type": "string"
                    },
                    "issuer_url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The `iss` claim its tokens carry. Null when each account, tenant, or cluster has its own issuer, which you pass as `issuer_url` when adding the provider.",
                        "title": "Issuer Url"
                    },
                    "issuer_url_example": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "An example of the `issuer_url` to pass. Null when the issuer is fixed.",
                        "title": "Issuer Url Example"
                    }
                },
                "required": [
                    "kind",
                    "name"
                ],
                "title": "PredefinedIdentityProviderV1",
                "type": "object"
            },
            "PredefinedIdentityProvidersV1": {
                "properties": {
                    "items": {
                        "description": "Identity providers Baseten supports",
                        "items": {
                            "$ref": "#/components/schemas/PredefinedIdentityProviderV1"
                        },
                        "title": "Items",
                        "type": "array"
                    }
                },
                "required": [
                    "items"
                ],
                "title": "PredefinedIdentityProvidersV1",
                "type": "object"
            },
            "IdentityProviderV1": {
                "description": "An OIDC issuer whose tokens the organization accepts for workload identity federation.",
                "properties": {
                    "id": {
                        "description": "Identity provider ID",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name, unique in the organization",
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Description",
                        "title": "Description"
                    },
                    "predefined": {
                        "$ref": "#/components/schemas/PredefinedIdentityProviderConfigV1",
                        "description": "Settings of the predefined provider"
                    },
                    "created_by": {
                        "description": "ID of the user who added the provider",
                        "title": "Created By",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the provider was added",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Time the provider was last updated",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "predefined",
                    "created_by",
                    "created_at",
                    "updated_at"
                ],
                "title": "IdentityProviderV1",
                "type": "object"
            },
            "PredefinedIdentityProviderConfigV1": {
                "description": "Settings of an identity provider that Baseten defines.",
                "properties": {
                    "kind": {
                        "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1",
                        "description": "Which predefined provider. Can't be changed."
                    },
                    "issuer_url": {
                        "anyOf": [
                            {
                                "maxLength": 1024,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.",
                        "title": "Issuer Url"
                    }
                },
                "required": [
                    "kind"
                ],
                "title": "PredefinedIdentityProviderConfigV1",
                "type": "object"
            },
            "IdentityProvidersV1": {
                "description": "A page of identity providers.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/IdentityProviderV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "IdentityProvidersV1",
                "type": "object"
            },
            "IdentityProvidersRequestV1": {
                "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"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only the provider with this name, ignoring case",
                        "title": "Name"
                    },
                    "predefined_kind": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only this predefined provider's issuers"
                    }
                },
                "title": "IdentityProvidersRequestV1",
                "type": "object"
            },
            "CreatePredefinedIdentityProviderConfigV1": {
                "additionalProperties": false,
                "description": "Settings of the predefined identity provider to add.",
                "properties": {
                    "kind": {
                        "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1",
                        "description": "Which predefined provider. Can't be changed."
                    },
                    "issuer_url": {
                        "anyOf": [
                            {
                                "maxLength": 1024,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.",
                        "title": "Issuer Url"
                    }
                },
                "required": [
                    "kind"
                ],
                "title": "CreatePredefinedIdentityProviderConfigV1",
                "type": "object"
            },
            "CreateIdentityProviderRequestV1": {
                "additionalProperties": false,
                "description": "Request to add an identity provider.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name, unique in the organization. Defaults to the provider's display name, so pass one when adding a second issuer of the same provider.",
                        "title": "Name"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "maxLength": 1024,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional description",
                        "title": "Description"
                    },
                    "predefined": {
                        "$ref": "#/components/schemas/CreatePredefinedIdentityProviderConfigV1",
                        "description": "The predefined provider to add"
                    }
                },
                "required": [
                    "predefined"
                ],
                "title": "CreateIdentityProviderRequestV1",
                "type": "object"
            },
            "VerifyPredefinedIdentityProviderConfigV1": {
                "additionalProperties": false,
                "description": "Settings of the predefined identity provider to check.",
                "properties": {
                    "kind": {
                        "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1",
                        "description": "Which predefined provider"
                    },
                    "issuer_url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The issuer to check, for AWS IAM, Amazon EKS, Azure managed identity, and Azure Kubernetes Service, in the format the predefined identity providers endpoint shows",
                        "title": "Issuer Url"
                    }
                },
                "required": [
                    "kind"
                ],
                "title": "VerifyPredefinedIdentityProviderConfigV1",
                "type": "object"
            },
            "VerifyIdentityProviderRequestV1": {
                "additionalProperties": false,
                "description": "Request to check an identity provider before adding it.",
                "properties": {
                    "predefined": {
                        "$ref": "#/components/schemas/VerifyPredefinedIdentityProviderConfigV1",
                        "description": "The predefined provider to check, as you'd pass it when adding it"
                    }
                },
                "required": [
                    "predefined"
                ],
                "title": "VerifyIdentityProviderRequestV1",
                "type": "object"
            },
            "VerificationV1": {
                "description": "Whether a create request would pass the checks the server runs on it.",
                "properties": {
                    "valid": {
                        "description": "Whether the input passes every check",
                        "title": "Valid",
                        "type": "boolean"
                    },
                    "error": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Why the input fails, as creating it would report. Null when it's valid.",
                        "title": "Error"
                    }
                },
                "required": [
                    "valid"
                ],
                "title": "VerificationV1",
                "type": "object"
            },
            "DeletedIdentityProviderV1": {
                "properties": {
                    "id": {
                        "description": "ID of the deleted identity provider",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Always true",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "DeletedIdentityProviderV1",
                "type": "object"
            },
            "UpdateIdentityProviderRequestV1": {
                "additionalProperties": false,
                "description": "Request to update an identity provider. Only the fields sent change.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name, unique in the organization",
                        "title": "Name"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "maxLength": 1024,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Description; null clears it",
                        "title": "Description",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateIdentityProviderRequestV1",
                "type": "object"
            },
            "AccessTrustRuleV1": {
                "description": "Which tokens from an identity provider may act as a service account.",
                "properties": {
                    "id": {
                        "description": "Trust rule ID. Workloads pass it when they exchange a token.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name, unique in the organization",
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Description",
                        "title": "Description"
                    },
                    "identity_provider_id": {
                        "description": "The identity provider whose tokens it accepts",
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "identity_provider_name": {
                        "description": "Name of the identity provider",
                        "title": "Identity Provider Name",
                        "type": "string"
                    },
                    "service_account_id": {
                        "description": "The service account its tokens act as",
                        "title": "Service Account Id",
                        "type": "string"
                    },
                    "service_account_name": {
                        "description": "Name of the service account",
                        "title": "Service Account Name",
                        "type": "string"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The service account's team. Null for an organization service account.",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the service account's team. Null for an organization service account.",
                        "title": "Team Name"
                    },
                    "condition": {
                        "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.",
                        "examples": [
                            "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'"
                        ],
                        "title": "Condition",
                        "type": "string"
                    },
                    "audience": {
                        "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.",
                        "title": "Audience",
                        "type": "string"
                    },
                    "max_access_token_lifetime_seconds": {
                        "description": "Longest lifetime of a token the rule issues, in seconds",
                        "title": "Max Access Token Lifetime Seconds",
                        "type": "integer"
                    },
                    "last_used_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Last time a request authenticated with a token the rule issued, to within an hour. Null until the first.",
                        "title": "Last Used At"
                    },
                    "created_by": {
                        "description": "ID of the user who created the rule",
                        "title": "Created By",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the rule was created",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Time the rule was last updated",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "identity_provider_id",
                    "identity_provider_name",
                    "service_account_id",
                    "service_account_name",
                    "condition",
                    "audience",
                    "max_access_token_lifetime_seconds",
                    "created_by",
                    "created_at",
                    "updated_at"
                ],
                "title": "AccessTrustRuleV1",
                "type": "object"
            },
            "AccessTrustRulesV1": {
                "description": "A page of trust rules.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/AccessTrustRuleV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "AccessTrustRulesV1",
                "type": "object"
            },
            "AccessTrustRulesRequestV1": {
                "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"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only the rule with this name, ignoring case",
                        "title": "Name"
                    },
                    "identity_provider_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only this provider's rules",
                        "title": "Identity Provider Id"
                    },
                    "service_account_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only rules for this service account",
                        "title": "Service Account Id"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Only rules for this team's service accounts",
                        "title": "Team Id"
                    }
                },
                "title": "AccessTrustRulesRequestV1",
                "type": "object"
            },
            "CreateAccessTrustRuleRequestV1": {
                "additionalProperties": false,
                "description": "Request to create a trust rule.",
                "properties": {
                    "name": {
                        "description": "Name, unique in the organization. Can be changed later.",
                        "maxLength": 255,
                        "minLength": 1,
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional description",
                        "title": "Description"
                    },
                    "identity_provider_id": {
                        "description": "Whose tokens the rule accepts. Can't be changed.",
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "service_account_id": {
                        "description": "The service account its tokens act as. Can be changed later.",
                        "title": "Service Account Id",
                        "type": "string"
                    },
                    "condition": {
                        "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters. Can be changed later.",
                        "examples": [
                            "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'"
                        ],
                        "title": "Condition",
                        "type": "string"
                    },
                    "audience": {
                        "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters. Can be changed later.",
                        "title": "Audience",
                        "type": "string"
                    },
                    "max_access_token_lifetime_seconds": {
                        "default": 3600,
                        "description": "Longest lifetime of a token the rule issues, 60 to 3600 seconds. Can be changed later.",
                        "maximum": 3600,
                        "minimum": 60,
                        "title": "Max Access Token Lifetime Seconds",
                        "type": "integer"
                    }
                },
                "required": [
                    "name",
                    "identity_provider_id",
                    "service_account_id",
                    "condition",
                    "audience"
                ],
                "title": "CreateAccessTrustRuleRequestV1",
                "type": "object"
            },
            "VerifyAccessTrustRuleRequestV1": {
                "additionalProperties": false,
                "description": "Request to check a trust rule's condition and audience before saving them.",
                "properties": {
                    "identity_provider_id": {
                        "description": "The identity provider the rule is for, which decides the claims it must pin",
                        "title": "Identity Provider Id",
                        "type": "string"
                    },
                    "condition": {
                        "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.",
                        "examples": [
                            "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'"
                        ],
                        "title": "Condition",
                        "type": "string"
                    },
                    "audience": {
                        "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.",
                        "title": "Audience",
                        "type": "string"
                    }
                },
                "required": [
                    "identity_provider_id",
                    "condition",
                    "audience"
                ],
                "title": "VerifyAccessTrustRuleRequestV1",
                "type": "object"
            },
            "DeletedAccessTrustRuleV1": {
                "properties": {
                    "id": {
                        "description": "ID of the deleted trust rule",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Always true",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "DeletedAccessTrustRuleV1",
                "type": "object"
            },
            "UpdateAccessTrustRuleRequestV1": {
                "additionalProperties": false,
                "description": "Request to update a trust rule. Only the fields sent change.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name, unique in the organization",
                        "title": "Name"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Description; null clears it",
                        "title": "Description",
                        "x-null-distinct": true
                    },
                    "condition": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.",
                        "title": "Condition"
                    },
                    "audience": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.",
                        "title": "Audience"
                    },
                    "max_access_token_lifetime_seconds": {
                        "anyOf": [
                            {
                                "maximum": 3600,
                                "minimum": 60,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Longest lifetime of a token the rule issues, 60 to 3600 seconds. Tokens already issued keep their lifetime.",
                        "title": "Max Access Token Lifetime Seconds"
                    },
                    "service_account_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Moves the rule to another service account. Tokens already issued keep the old account until they expire.",
                        "title": "Service Account Id"
                    }
                },
                "title": "UpdateAccessTrustRuleRequestV1",
                "type": "object"
            },
            "AccessPermissionCategoryV1": {
                "description": "A group of related permissions, such as the permissions on model deployments.",
                "properties": {
                    "name": {
                        "description": "Name of the category, such as `model.deployment`. The names of its permissions start with it.",
                        "title": "Name",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Short human-readable name",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "description": {
                        "description": "What the category covers",
                        "title": "Description",
                        "type": "string"
                    },
                    "resource_types": {
                        "description": "Types of resource a role assignment can select for these permissions, such as `MODEL`. Empty when assignments can't select resources for them.",
                        "items": {
                            "$ref": "#/components/schemas/AccessResourceTypeV1"
                        },
                        "title": "Resource Types",
                        "type": "array"
                    },
                    "supports_environments": {
                        "description": "Whether a role assignment can limit these permissions to environments",
                        "title": "Supports Environments",
                        "type": "boolean"
                    }
                },
                "required": [
                    "name",
                    "display_name",
                    "description",
                    "resource_types",
                    "supports_environments"
                ],
                "title": "AccessPermissionCategoryV1",
                "type": "object"
            },
            "AccessPermissionV1": {
                "description": "A permission roles can grant.",
                "properties": {
                    "name": {
                        "description": "Name of the permission, such as `model.deployment.write`. It starts with its category's name.",
                        "title": "Name",
                        "type": "string"
                    },
                    "category": {
                        "description": "Name of the permission's category, such as `model.deployment`",
                        "title": "Category",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Short human-readable name",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "description": {
                        "description": "What the permission allows",
                        "title": "Description",
                        "type": "string"
                    },
                    "role_kinds": {
                        "description": "Kinds of custom role that can hold it: `ORGANIZATION`, `TEAM`, or both",
                        "items": {
                            "$ref": "#/components/schemas/AccessRoleKindV1"
                        },
                        "title": "Role Kinds",
                        "type": "array"
                    },
                    "reserved": {
                        "description": "Whether the permission is reserved for built-in admin roles. Custom roles can't hold it.",
                        "title": "Reserved",
                        "type": "boolean"
                    },
                    "available": {
                        "description": "Whether your organization has the features the permission needs. Custom roles can hold a permission only when it's available and not reserved.",
                        "title": "Available",
                        "type": "boolean"
                    }
                },
                "required": [
                    "name",
                    "category",
                    "display_name",
                    "description",
                    "role_kinds",
                    "reserved",
                    "available"
                ],
                "title": "AccessPermissionV1",
                "type": "object"
            },
            "AccessRoleKindV1": {
                "description": "Where a role is assigned.",
                "enum": [
                    "ORGANIZATION",
                    "TEAM",
                    "MEMBERSHIP"
                ],
                "title": "AccessRoleKindV1",
                "type": "string"
            },
            "AccessPermissionsV1": {
                "description": "Every permission and permission category.",
                "properties": {
                    "categories": {
                        "description": "Every permission category",
                        "items": {
                            "$ref": "#/components/schemas/AccessPermissionCategoryV1"
                        },
                        "title": "Categories",
                        "type": "array"
                    },
                    "permissions": {
                        "description": "Every permission, including those for features your organization doesn't have. Only `available` differs between organizations.",
                        "items": {
                            "$ref": "#/components/schemas/AccessPermissionV1"
                        },
                        "title": "Permissions",
                        "type": "array"
                    }
                },
                "required": [
                    "categories",
                    "permissions"
                ],
                "title": "AccessPermissionsV1",
                "type": "object"
            },
            "AccessRoleV1": {
                "description": "A set of permissions you assign to users, service accounts, and directory groups. Baseten\ndefines the built-in roles, and your organization defines its custom roles.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the role. Built-in role IDs start with `baseten:`, such as `baseten:reader`.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the role",
                        "title": "Name",
                        "type": "string"
                    },
                    "description": {
                        "description": "Description of the role",
                        "title": "Description",
                        "type": "string"
                    },
                    "built_in": {
                        "description": "Whether Baseten defines the role. Built-in roles are read-only.",
                        "title": "Built In",
                        "type": "boolean"
                    },
                    "kind": {
                        "$ref": "#/components/schemas/AccessRoleKindV1",
                        "description": "Where the role is assigned: `ORGANIZATION` roles for the whole organization, and `TEAM` roles in a team. `MEMBERSHIP` roles are built-in roles held only through organization membership, such as Admin and Creator, and can't be assigned."
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "ID of the only team a team role can be assigned in. Null when any team can use it, and for other kinds of role.",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Name of the only team a team role can be assigned in",
                        "title": "Team Name"
                    },
                    "permissions": {
                        "description": "Names of the role's own permissions",
                        "items": {
                            "type": "string"
                        },
                        "title": "Permissions",
                        "type": "array"
                    },
                    "include_role_ids": {
                        "description": "IDs of the built-in roles whose permissions this role also grants, including permissions Baseten adds to them later",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include Role Ids",
                        "type": "array"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "description",
                    "built_in",
                    "kind",
                    "team_id",
                    "team_name",
                    "permissions",
                    "include_role_ids"
                ],
                "title": "AccessRoleV1",
                "type": "object"
            },
            "AccessRolesV1": {
                "description": "A page of roles.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/AccessRoleV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "AccessRolesV1",
                "type": "object"
            },
            "AccessRolesRequestV1": {
                "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": "ID of a team. Lists only the roles available there: built-in roles and the team roles it can use.",
                        "title": "Team Id"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Lists only the roles with this name",
                        "title": "Name"
                    }
                },
                "title": "AccessRolesRequestV1",
                "type": "object"
            },
            "CreateAccessRoleRequestV1": {
                "description": "A custom role to create.",
                "properties": {
                    "name": {
                        "description": "Name of the role, unique in your organization",
                        "maxLength": 255,
                        "minLength": 1,
                        "title": "Name",
                        "type": "string"
                    },
                    "kind": {
                        "$ref": "#/components/schemas/AccessRoleKindV1",
                        "description": "`ORGANIZATION` to assign the role for the whole organization, or `TEAM` to assign it in teams"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "For a team role, ID of the only team it can be assigned in. Omit to let any team use it.",
                        "title": "Team Id"
                    },
                    "description": {
                        "default": "",
                        "description": "Description of the role",
                        "title": "Description",
                        "type": "string"
                    },
                    "permissions": {
                        "description": "Names of the permissions the role grants",
                        "items": {
                            "type": "string"
                        },
                        "title": "Permissions",
                        "type": "array"
                    },
                    "include_role_ids": {
                        "description": "IDs of built-in roles whose permissions the role also grants, such as `baseten:reader`",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include Role Ids",
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "kind"
                ],
                "title": "CreateAccessRoleRequestV1",
                "type": "object"
            },
            "AccessRoleTombstoneV1": {
                "description": "A deleted custom role.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the deleted role",
                        "title": "Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id"
                ],
                "title": "AccessRoleTombstoneV1",
                "type": "object"
            },
            "AccessRoleRequestV1": {
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of a team. Gets the role only if `GET /v1/access/roles` lists it for that team, and checks your access in that team.",
                        "title": "Team Id"
                    }
                },
                "title": "AccessRoleRequestV1",
                "type": "object"
            },
            "UpdateAccessRoleRequestV1": {
                "description": "Changes to a custom role. Omitted fields are unchanged.",
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New name of the role",
                        "title": "Name"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New description of the role",
                        "title": "Description"
                    },
                    "permissions": {
                        "description": "Names of permissions to add to the role",
                        "items": {
                            "type": "string"
                        },
                        "title": "Permissions",
                        "type": "array"
                    },
                    "permissions_to_delete": {
                        "description": "Names of permissions to remove from the role",
                        "items": {
                            "type": "string"
                        },
                        "title": "Permissions To Delete",
                        "type": "array"
                    },
                    "include_role_ids": {
                        "description": "IDs of built-in roles for the role to include",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include Role Ids",
                        "type": "array"
                    },
                    "include_role_ids_to_delete": {
                        "description": "IDs of built-in roles for the role to stop including",
                        "items": {
                            "type": "string"
                        },
                        "title": "Include Role Ids To Delete",
                        "type": "array"
                    }
                },
                "title": "UpdateAccessRoleRequestV1",
                "type": "object"
            },
            "AccessAssignmentsV1": {
                "description": "A page of role assignments.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/AccessAssignmentV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "AccessAssignmentsV1",
                "type": "object"
            },
            "AccessAssignmentsRequestV1": {
                "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": "ID of a team. Lists only the assignments in it.",
                        "title": "Team Id"
                    },
                    "role_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of a role. Lists only its assignments.",
                        "title": "Role Id"
                    },
                    "subject_type": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AccessSubjectTypeV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Lists only the assignments to this type of subject"
                    },
                    "subject_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of a user, service account, or directory group. Lists only its assignments.",
                        "title": "Subject Id"
                    }
                },
                "title": "AccessAssignmentsRequestV1",
                "type": "object"
            },
            "AccessResourceUpdateV1": {
                "description": "A resource for a role assignment to select, or a permission check to ask about.",
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/AccessResourceTypeV1",
                        "description": "Type of the resource"
                    },
                    "identifier": {
                        "description": "Unique identifier of the resource, such as a model's ID",
                        "title": "Identifier",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "identifier"
                ],
                "title": "AccessResourceUpdateV1",
                "type": "object"
            },
            "CreateAccessAssignmentRequestV1": {
                "description": "A role to give a user, service account, or directory group.",
                "properties": {
                    "role_id": {
                        "description": "ID of the role to assign",
                        "title": "Role Id",
                        "type": "string"
                    },
                    "subject_type": {
                        "$ref": "#/components/schemas/AccessSubjectTypeV1",
                        "description": "Type of the subject to give the role to"
                    },
                    "subject_id": {
                        "description": "ID of the user, service account, or directory group to give the role to",
                        "title": "Subject Id",
                        "type": "string"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the team to assign a team role in. Omit for an organization role.",
                        "title": "Team Id"
                    },
                    "resources": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/AccessResourceUpdateV1"
                                },
                                "minItems": 1,
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Resources the role applies to. Omit for every resource where it applies.",
                        "title": "Resources"
                    },
                    "environments": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "minItems": 1,
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Names of the environments the role applies in, such as `production`, for the team's models and chains. An environment needs no environment group, and a name no deployment uses yet applies once one does. Omit for every environment.",
                        "title": "Environments"
                    }
                },
                "required": [
                    "role_id",
                    "subject_type",
                    "subject_id"
                ],
                "title": "CreateAccessAssignmentRequestV1",
                "type": "object"
            },
            "AccessAssignmentTombstoneV1": {
                "description": "A removed role assignment.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the removed role assignment",
                        "title": "Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id"
                ],
                "title": "AccessAssignmentTombstoneV1",
                "type": "object"
            },
            "AccessCheckV1": {
                "description": "A permission to check: for the organization, in a team, or on a resource.",
                "properties": {
                    "permission": {
                        "description": "Name of the permission, such as `model.deployment.write`",
                        "title": "Permission",
                        "type": "string"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of a team to check the permission in. To check whether you can create a resource, check its write permission in the team you create it in.",
                        "title": "Team Id"
                    },
                    "resource": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AccessResourceUpdateV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "A resource to check the permission on. Omit `team_id` and `resource` to check the permission for the organization."
                    }
                },
                "required": [
                    "permission"
                ],
                "title": "AccessCheckV1",
                "type": "object"
            },
            "CheckAccessRequestV1": {
                "description": "Permissions to check.",
                "properties": {
                    "checks": {
                        "description": "Permissions to check, at most 100",
                        "items": {
                            "$ref": "#/components/schemas/AccessCheckV1"
                        },
                        "maxItems": 100,
                        "minItems": 1,
                        "title": "Checks",
                        "type": "array"
                    }
                },
                "required": [
                    "checks"
                ],
                "title": "CheckAccessRequestV1",
                "type": "object"
            },
            "AccessCheckResultV1": {
                "description": "Whether you hold a permission where a check asked about it.",
                "properties": {
                    "permission": {
                        "description": "Name of the permission",
                        "title": "Permission",
                        "type": "string"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "ID of the team it was checked in, if any",
                        "title": "Team Id"
                    },
                    "resource": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AccessResourceV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The resource it was checked on, if any"
                    },
                    "allowed": {
                        "description": "Whether you hold the permission there",
                        "title": "Allowed",
                        "type": "boolean"
                    }
                },
                "required": [
                    "permission",
                    "team_id",
                    "resource",
                    "allowed"
                ],
                "title": "AccessCheckResultV1",
                "type": "object"
            },
            "CheckAccessResponseV1": {
                "description": "Answers to permission checks.",
                "properties": {
                    "results": {
                        "description": "One result per check, in the order you sent them",
                        "items": {
                            "$ref": "#/components/schemas/AccessCheckResultV1"
                        },
                        "title": "Results",
                        "type": "array"
                    }
                },
                "required": [
                    "results"
                ],
                "title": "CheckAccessResponseV1",
                "type": "object"
            },
            "TokenExchangeRequestV1": {
                "description": "An RFC 8693 token exchange request naming the trust rule to check as its audience.",
                "properties": {
                    "grant_type": {
                        "description": "Always `urn:ietf:params:oauth:grant-type:token-exchange`",
                        "examples": [
                            "urn:ietf:params:oauth:grant-type:token-exchange"
                        ],
                        "title": "Grant Type",
                        "type": "string"
                    },
                    "subject_token": {
                        "description": "The identity provider's JWT",
                        "examples": [
                            "<identity provider JWT>"
                        ],
                        "maxLength": 16384,
                        "title": "Subject Token",
                        "type": "string"
                    },
                    "subject_token_type": {
                        "description": "`urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`",
                        "examples": [
                            "urn:ietf:params:oauth:token-type:jwt"
                        ],
                        "title": "Subject Token Type",
                        "type": "string"
                    },
                    "audience": {
                        "description": "ID of the trust rule to check the JWT against",
                        "examples": [
                            "abcd1234"
                        ],
                        "maxLength": 64,
                        "title": "Audience",
                        "type": "string"
                    },
                    "requested_token_type": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional; only `urn:ietf:params:oauth:token-type:access_token` is issued",
                        "title": "Requested Token Type"
                    },
                    "access_token_lifetime_seconds": {
                        "anyOf": [
                            {
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Lifetime of the access token, in seconds. At most the rule's maximum.",
                        "title": "Access Token Lifetime Seconds"
                    }
                },
                "required": [
                    "grant_type",
                    "subject_token",
                    "subject_token_type",
                    "audience"
                ],
                "title": "TokenExchangeRequestV1",
                "type": "object"
            },
            "TokenExchangeResponseV1": {
                "properties": {
                    "access_token": {
                        "description": "Send as `Authorization: Bearer`",
                        "title": "Access Token",
                        "type": "string"
                    },
                    "issued_token_type": {
                        "description": "Always `urn:ietf:params:oauth:token-type:access_token`",
                        "title": "Issued Token Type",
                        "type": "string"
                    },
                    "token_type": {
                        "description": "Always `Bearer`",
                        "title": "Token Type",
                        "type": "string"
                    },
                    "expires_in": {
                        "description": "Seconds until the access token expires",
                        "title": "Expires In",
                        "type": "integer"
                    }
                },
                "required": [
                    "access_token",
                    "issued_token_type",
                    "token_type",
                    "expires_in"
                ],
                "title": "TokenExchangeResponseV1",
                "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"
                    },
                    "gemini": {
                        "default": false,
                        "description": "Gemini API `generateContent` support.",
                        "title": "Gemini",
                        "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"
            },
            "CreateGridTokenRequestV1": {
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    }
                },
                "title": "CreateGridTokenRequestV1",
                "type": "object"
            },
            "GridTokenV1": {
                "properties": {
                    "token": {
                        "description": "Short-lived bearer token for the Grid gateway, scoped to you and the team. 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"
                    },
                    "team_id": {
                        "description": "ID of the team the token invokes Grid routes in.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of that team.",
                        "examples": [
                            "Engineering"
                        ],
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "token",
                    "expires_at",
                    "team_id",
                    "team_name"
                ],
                "title": "GridTokenV1",
                "type": "object"
            },
            "GridRouteAliasKindV1": {
                "enum": [
                    "CLAUDE_DESKTOP",
                    "ALIAS"
                ],
                "title": "GridRouteAliasKindV1",
                "type": "string"
            },
            "GridRouteAliasV1": {
                "properties": {
                    "name": {
                        "description": "Name to send in the inference request's `model` field instead of the route's `name`.",
                        "title": "Name",
                        "type": "string"
                    },
                    "kind": {
                        "$ref": "#/components/schemas/GridRouteAliasKindV1",
                        "description": "Purpose of the alias. CLAUDE_DESKTOP is for Claude Code desktop, which rejects model names without a `claude` substring. ALIAS is any other name the team's clients send for the route."
                    }
                },
                "required": [
                    "name",
                    "kind"
                ],
                "title": "GridRouteAliasV1",
                "type": "object"
            },
            "GridRouteClassifierV1": {
                "properties": {
                    "id": {
                        "description": "Stable route classifier identifier.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Id",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Display name of the route classifier.",
                        "examples": [
                            "General"
                        ],
                        "title": "Display Name",
                        "type": "string"
                    },
                    "supported_tradeoffs": {
                        "description": "Tradeoffs the route classifier supports. Empty when it supports all of them.",
                        "items": {
                            "enum": [
                                "cost",
                                "balanced",
                                "intelligence"
                            ],
                            "title": "GridRouteTradeoffV1",
                            "type": "string"
                        },
                        "title": "Supported Tradeoffs",
                        "type": "array"
                    },
                    "decidable_canonical_model_ids": {
                        "description": "Canonical model ids the route classifier picks from.",
                        "examples": [
                            [
                                "zai-org/GLM-5.3",
                                "anthropic/claude-opus-5-5"
                            ]
                        ],
                        "items": {
                            "type": "string"
                        },
                        "title": "Decidable Canonical Model Ids",
                        "type": "array"
                    }
                },
                "required": [
                    "id",
                    "display_name",
                    "supported_tradeoffs",
                    "decidable_canonical_model_ids"
                ],
                "title": "GridRouteClassifierV1",
                "type": "object"
            },
            "GridRouteMetadataV1": {
                "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."
                    },
                    "api_formats": {
                        "description": "API formats the route supports, most preferred first: `chat_completions`, `messages`, `responses` for a BASETEN_MODEL_API target and `messages`, `responses`, `chat_completions`, `gemini` for any other target, keeping only the formats the route supports. Never empty.",
                        "items": {
                            "enum": [
                                "messages",
                                "responses",
                                "chat_completions",
                                "gemini"
                            ],
                            "title": "GridRouteAPIFormatV1",
                            "type": "string"
                        },
                        "minItems": 1,
                        "title": "Api Formats",
                        "type": "array"
                    }
                },
                "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",
                    "api_formats"
                ],
                "title": "GridRouteMetadataV1",
                "type": "object"
            },
            "GridRouteTargetBasetenModelAPIV1": {
                "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": "GridRouteTargetBasetenModelAPIV1",
                "type": "object"
            },
            "GridRouteTargetConnectionV1": {
                "properties": {
                    "type": {
                        "const": "CONNECTION",
                        "description": "Target kind for a provider reached through a team connection.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "connection_id": {
                        "description": "Identifier of the team connection authenticating with the provider.",
                        "title": "Connection Id",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "connection_id"
                ],
                "title": "GridRouteTargetConnectionV1",
                "type": "object"
            },
            "GridRouteTargetIntelligentV1": {
                "properties": {
                    "type": {
                        "const": "INTELLIGENT",
                        "description": "Target kind for an intelligent route: Baseten picks the model per request.",
                        "title": "Type",
                        "type": "string"
                    },
                    "route_classifier": {
                        "$ref": "#/components/schemas/GridRouteClassifierV1",
                        "description": "Route classifier that picks the model."
                    },
                    "tradeoff": {
                        "description": "How the classifier weighs cost against quality.",
                        "enum": [
                            "cost",
                            "balanced",
                            "intelligence"
                        ],
                        "title": "GridRouteTradeoffV1",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "route_classifier",
                    "tradeoff"
                ],
                "title": "GridRouteTargetIntelligentV1",
                "type": "object"
            },
            "GridRouteV1": {
                "properties": {
                    "id": {
                        "description": "Stable route identifier.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name to send in the inference request's `model` field. Unique within the team; immutable.",
                        "title": "Name",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Display label, defaulting to the route's name.",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "aliases": {
                        "description": "The route's other names, one per purpose. Empty for routes created before aliases existed.",
                        "items": {
                            "$ref": "#/components/schemas/GridRouteAliasV1"
                        },
                        "title": "Aliases",
                        "type": "array"
                    },
                    "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"
                    },
                    "description": {
                        "description": "Short description of the route, empty when unset.",
                        "title": "Description",
                        "type": "string"
                    },
                    "target": {
                        "description": "Configured upstream target.",
                        "discriminator": {
                            "mapping": {
                                "BASETEN_MODEL_API": "#/components/schemas/GridRouteTargetBasetenModelAPIV1",
                                "CONNECTION": "#/components/schemas/GridRouteTargetConnectionV1",
                                "INTELLIGENT": "#/components/schemas/GridRouteTargetIntelligentV1"
                            },
                            "propertyName": "type"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/GridRouteTargetBasetenModelAPIV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridRouteTargetConnectionV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridRouteTargetIntelligentV1"
                            }
                        ],
                        "title": "Target"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GridRouteMetadataV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Resolved model metadata; for an intelligent route, the envelope of its servable models' metadata. Null when nothing is linked or the metadata has no supported API formats."
                    },
                    "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",
                    "display_name",
                    "team_id",
                    "team_name",
                    "description",
                    "target",
                    "metadata",
                    "invoke_url",
                    "created_at"
                ],
                "title": "GridRouteV1",
                "type": "object"
            },
            "GridRoutesResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GridRouteV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GridRoutesResponseV1",
                "type": "object"
            },
            "GridRoutesRequestV1": {
                "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": "Limit routes to this team. Without it, routes from every team where you can invoke routes.",
                        "title": "Team Id"
                    },
                    "for_harnesses": {
                        "default": false,
                        "description": "Set by harness setup and sync. Returns routes from exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.",
                        "title": "For Harnesses",
                        "type": "boolean"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by exact route name, the value to send in the inference request's `model` field. Matches a route's name or any of its aliases. Preserved by the cursor; if repeated, must match the original filter.",
                        "title": "Name"
                    }
                },
                "title": "GridRoutesRequestV1",
                "type": "object"
            },
            "UpsertGridRouteTargetBasetenModelAPIV1": {
                "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": "UpsertGridRouteTargetBasetenModelAPIV1",
                "type": "object"
            },
            "UpsertGridRouteTargetConnectionV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "CONNECTION",
                        "description": "Target kind for a provider reached through a team connection.",
                        "title": "Type",
                        "type": "string"
                    },
                    "model": {
                        "description": "Model name sent to the provider.",
                        "minLength": 1,
                        "title": "Model",
                        "type": "string"
                    },
                    "connection_id": {
                        "description": "Identifier of a connection owned by the route's team. Its provider serves the route.",
                        "examples": [
                            "abc1234"
                        ],
                        "minLength": 1,
                        "title": "Connection Id",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "model",
                    "connection_id"
                ],
                "title": "UpsertGridRouteTargetConnectionV1",
                "type": "object"
            },
            "UpsertGridRouteTargetIntelligentV1": {
                "additionalProperties": false,
                "properties": {
                    "type": {
                        "const": "INTELLIGENT",
                        "description": "Target kind for an intelligent route: Baseten picks the model per request.",
                        "title": "Type",
                        "type": "string"
                    },
                    "route_classifier_id": {
                        "description": "Identifier of the route classifier that picks the model. List them with GET /v1/grid/route_classifiers.",
                        "examples": [
                            "abc1234"
                        ],
                        "minLength": 1,
                        "title": "Route Classifier Id",
                        "type": "string"
                    },
                    "tradeoff": {
                        "description": "How the classifier weighs cost against quality. Must be one of the classifier's supported tradeoffs.",
                        "enum": [
                            "cost",
                            "balanced",
                            "intelligence"
                        ],
                        "title": "GridRouteTradeoffV1",
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "route_classifier_id",
                    "tradeoff"
                ],
                "title": "UpsertGridRouteTargetIntelligentV1",
                "type": "object"
            },
            "CreateGridRouteRequestV1": {
                "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's name; required for INTELLIGENT targets. Null is not accepted.",
                        "examples": [
                            "Assistant"
                        ],
                        "title": "Display Name"
                    },
                    "target": {
                        "description": "Upstream target for the route. CONNECTION targets use the provider and credentials of a connection owned by the route's team. INTELLIGENT targets need at least one of the route classifier's models, and one of its fallback models, servable by the team.",
                        "discriminator": {
                            "mapping": {
                                "BASETEN_MODEL_API": "#/components/schemas/UpsertGridRouteTargetBasetenModelAPIV1",
                                "CONNECTION": "#/components/schemas/UpsertGridRouteTargetConnectionV1",
                                "INTELLIGENT": "#/components/schemas/UpsertGridRouteTargetIntelligentV1"
                            },
                            "propertyName": "type"
                        },
                        "examples": [
                            {
                                "model": "zai-org/GLM-5.3",
                                "type": "BASETEN_MODEL_API"
                            }
                        ],
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/UpsertGridRouteTargetBasetenModelAPIV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridRouteTargetConnectionV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridRouteTargetIntelligentV1"
                            }
                        ],
                        "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": "CreateGridRouteRequestV1",
                "type": "object"
            },
            "GridProviderV1": {
                "description": "Upstream provider of a route target, named like the route target types.",
                "enum": [
                    "BASETEN_MODEL_API",
                    "OPENAI",
                    "ANTHROPIC",
                    "XAI",
                    "VERTEX",
                    "OPENAI_COMPATIBLE",
                    "BEDROCK",
                    "AZURE"
                ],
                "title": "GridProviderV1",
                "type": "string"
            },
            "GridRouteUsageBucketV1": {
                "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/GridRouteUsageResultV1"
                        },
                        "title": "Results",
                        "type": "array"
                    }
                },
                "required": [
                    "date",
                    "results"
                ],
                "title": "GridRouteUsageBucketV1",
                "type": "object"
            },
            "GridRouteUsageHarnessV1": {
                "enum": [
                    "CLAUDE_CODE",
                    "OPENCODE",
                    "CODEX",
                    "PI"
                ],
                "title": "GridRouteUsageHarnessV1",
                "type": "string"
            },
            "GridRouteUsageResultV1": {
                "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"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the team the usage was metered in. Null when not grouping by TEAM, and for usage metered before it was attributed to teams.",
                        "title": "Team Id"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the team the usage was metered in. Null when `team_id` is null.",
                        "title": "Team Name"
                    },
                    "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/GridProviderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Provider that served the requests. Null when not grouping by PROVIDER."
                    },
                    "intelligent_route_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the intelligent route, as `id` in GET /v1/grid/routes. Null when not grouping by INTELLIGENT_ROUTE.",
                        "title": "Intelligent Route Id"
                    },
                    "intelligent_route_display_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the intelligent route. Null when `intelligent_route_id` is null or the route cannot be resolved.",
                        "title": "Intelligent Route Display Name"
                    },
                    "harness": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GridRouteUsageHarnessV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Coding harness. Null when not grouping by HARNESS, when no harness was recorded (including usage from before harness tracking), or when the recorded harness is not recognized by this API version."
                    },
                    "api_key_prefix": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Prefix of the API key that made the requests, matching `GET /v1/api_keys`. Null when not grouping by API_KEY, for usage without an API key, and for usage recorded before API key tracking.",
                        "title": "Api Key Prefix"
                    },
                    "api_key_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the API key. Null when `api_key_prefix` is null or the key has no name.",
                        "title": "Api Key Name"
                    },
                    "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"
                    },
                    "requests": {
                        "description": "Number of requests; with INTELLIGENT_ROUTE, the requests sent through that route. Usage recorded before requests were counted adds zero.",
                        "title": "Requests",
                        "type": "integer"
                    }
                },
                "required": [
                    "cost_usd",
                    "input_tokens",
                    "cached_input_tokens",
                    "uncached_input_tokens",
                    "output_tokens",
                    "requests"
                ],
                "title": "GridRouteUsageResultV1",
                "type": "object"
            },
            "GridRouteUsageResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GridRouteUsageBucketV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GridRouteUsageResponseV1",
                "type": "object"
            },
            "GridRouteUsageDimensionV1": {
                "enum": [
                    "USER",
                    "TEAM",
                    "MODEL",
                    "PROVIDER",
                    "INTELLIGENT_ROUTE",
                    "HARNESS",
                    "API_KEY"
                ],
                "title": "GridRouteUsageDimensionV1",
                "type": "string"
            },
            "GridRouteUsageRequestV1": {
                "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"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Limit usage to a team you can access. Organization admins can view all usage in the team, team admins can view usage in teams they manage, and other members can view only their own usage. Without a team, organization admins see all organization usage, team admins see their managed teams, and other members see their own usage.",
                        "title": "Team Id"
                    },
                    "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, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, HARNESS, or API_KEY. 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. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. API_KEY includes usage without an API key, such as requests authenticated by a signed-in session, as a null group. Defaults to MODEL.",
                        "items": {
                            "$ref": "#/components/schemas/GridRouteUsageDimensionV1"
                        },
                        "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/GridProviderV1"
                        },
                        "title": "Providers",
                        "type": "array"
                    },
                    "harnesses": {
                        "description": "Return only usage for these harnesses, repeated once per harness. Omit to include all usage, including usage with no recorded harness.",
                        "items": {
                            "$ref": "#/components/schemas/GridRouteUsageHarnessV1"
                        },
                        "title": "Harnesses",
                        "type": "array"
                    },
                    "api_key_prefixes": {
                        "description": "Return only usage made with these API keys, repeated once per key prefix. Omit to include all usage, including usage without an API key.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Api Key Prefixes",
                        "type": "array"
                    }
                },
                "title": "GridRouteUsageRequestV1",
                "type": "object"
            },
            "GridRouteTombstoneV1": {
                "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": "GridRouteTombstoneV1",
                "type": "object"
            },
            "UpdateGridRouteRequestV1": {
                "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"
                    }
                },
                "title": "UpdateGridRouteRequestV1",
                "type": "object"
            },
            "GridHarnessDefaultsV1": {
                "properties": {
                    "claude_code": {
                        "$ref": "#/components/schemas/GridHarnessModelsV1",
                        "description": "Default models for Claude Code."
                    },
                    "opencode": {
                        "$ref": "#/components/schemas/GridHarnessModelsV1",
                        "description": "Default models for OpenCode."
                    },
                    "codex": {
                        "$ref": "#/components/schemas/GridHarnessModelsV1",
                        "description": "Default models for Codex."
                    },
                    "pi": {
                        "$ref": "#/components/schemas/GridHarnessModelsV1",
                        "description": "Default models for Pi."
                    }
                },
                "required": [
                    "claude_code",
                    "opencode",
                    "codex",
                    "pi"
                ],
                "title": "GridHarnessDefaultsV1",
                "type": "object"
            },
            "GridHarnessModelV1": {
                "properties": {
                    "source": {
                        "$ref": "#/components/schemas/GridSettingSourceV1",
                        "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/GridRouteV1",
                        "description": "Route to use for this role."
                    }
                },
                "required": [
                    "source",
                    "route"
                ],
                "title": "GridHarnessModelV1",
                "type": "object"
            },
            "GridHarnessModelsV1": {
                "properties": {
                    "primary": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GridHarnessModelV1"
                            },
                            {
                                "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/GridHarnessModelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Route for background tasks, such as session titles. Null when the team has no route to use."
                    }
                },
                "required": [
                    "primary",
                    "background"
                ],
                "title": "GridHarnessModelsV1",
                "type": "object"
            },
            "GridSettingSourceV1": {
                "enum": [
                    "user",
                    "team"
                ],
                "title": "GridSettingSourceV1",
                "type": "string"
            },
            "GridTeamSpendLimitSettingV1": {
                "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's Grid spend in 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"
                    },
                    "team_wide_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Spend limit in USD for each UTC calendar month on the Grid spend of all members in this team together. Once it is reached, every member's requests in the team are rejected. Returned as an exact decimal string. Null when the team has no team-wide limit.",
                        "examples": [
                            "5000"
                        ],
                        "title": "Team Wide Monthly Limit Usd"
                    }
                },
                "required": [
                    "per_member_monthly_limit_usd",
                    "team_wide_monthly_limit_usd"
                ],
                "title": "GridTeamSpendLimitSettingV1",
                "type": "object"
            },
            "GridTeamSettingsV1": {
                "properties": {
                    "team_id": {
                        "description": "ID of the team.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team.",
                        "examples": [
                            "Engineering"
                        ],
                        "title": "Team Name",
                        "type": "string"
                    },
                    "harness_defaults": {
                        "$ref": "#/components/schemas/GridHarnessDefaultsV1",
                        "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/GridTeamSpendLimitSettingV1",
                        "description": "Spend limits for Baseten Grid for members' spend in this team."
                    }
                },
                "required": [
                    "team_id",
                    "team_name",
                    "harness_defaults",
                    "spend_limit"
                ],
                "title": "GridTeamSettingsV1",
                "type": "object"
            },
            "GridTeamSettingsRequestV1": {
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    }
                },
                "title": "GridTeamSettingsRequestV1",
                "type": "object"
            },
            "UpdateGridHarnessDefaultsV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "claude_code": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateGridHarnessModelsV1"
                            },
                            {
                                "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/UpdateGridHarnessModelsV1"
                            },
                            {
                                "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/UpdateGridHarnessModelsV1"
                            },
                            {
                                "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/UpdateGridHarnessModelsV1"
                            },
                            {
                                "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": "UpdateGridHarnessDefaultsV1",
                "type": "object"
            },
            "UpdateGridHarnessModelsV1": {
                "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": "UpdateGridHarnessModelsV1",
                "type": "object"
            },
            "UpdateGridTeamSpendLimitSettingV1": {
                "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's Grid spend in 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
                    },
                    "team_wide_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Spend limit in USD for each UTC calendar month on the Grid spend of all members in this team together. Send null to remove it; omit to leave it unchanged.",
                        "examples": [
                            "5000"
                        ],
                        "title": "Team Wide Monthly Limit Usd",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateGridTeamSpendLimitSettingV1",
                "type": "object"
            },
            "UpdateGridTeamSettingsRequestV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "harness_defaults": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateGridHarnessDefaultsV1"
                            },
                            {
                                "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/UpdateGridTeamSpendLimitSettingV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Spend limit fields to change. Pass null to remove the team's limits; omit to leave them unchanged.",
                        "x-null-distinct": true
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    }
                },
                "title": "UpdateGridTeamSettingsRequestV1",
                "type": "object"
            },
            "GridEffectiveSpendLimitV1": {
                "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/GridSettingSourceV1"
                            },
                            {
                                "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": "GridEffectiveSpendLimitV1",
                "type": "object"
            },
            "GridSpendBlockedByV1": {
                "enum": [
                    "member",
                    "team"
                ],
                "title": "GridSpendBlockedByV1",
                "type": "string"
            },
            "GridSpendLimitSettingV1": {
                "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 in the team. Null when the user has no limit of their own there.",
                        "examples": [
                            "200"
                        ],
                        "title": "User Monthly Limit Usd"
                    },
                    "month_override_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Spend limit in USD for the current UTC calendar month set on the user in the team, which supersedes their standing limit. Null when there is none.",
                        "examples": [
                            "300"
                        ],
                        "title": "Month Override Usd"
                    },
                    "team_default": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GridSpendLimitTeamDefaultV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Per-member limit of the team. This limit applies when the user has no limit of their own. Null when there is none."
                    },
                    "effective": {
                        "$ref": "#/components/schemas/GridEffectiveSpendLimitV1",
                        "description": "The effective limit enforced for the current month."
                    },
                    "team_wide_monthly_limit_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Team-wide limit of the team in USD for each UTC calendar month. Once all members' spend in the team reaches it, the user's requests in the team are rejected whatever their own limit. Null when there is none.",
                        "examples": [
                            "5000"
                        ],
                        "title": "Team Wide Monthly Limit Usd"
                    }
                },
                "required": [
                    "user_monthly_limit_usd",
                    "month_override_usd",
                    "team_default",
                    "effective",
                    "team_wide_monthly_limit_usd"
                ],
                "title": "GridSpendLimitSettingV1",
                "type": "object"
            },
            "GridSpendLimitTeamDefaultV1": {
                "properties": {
                    "team_id": {
                        "description": "ID of the team whose per-member limit this is.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team.",
                        "examples": [
                            "Engineering"
                        ],
                        "title": "Team Name",
                        "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",
                    "team_name",
                    "per_member_monthly_limit_usd"
                ],
                "title": "GridSpendLimitTeamDefaultV1",
                "type": "object"
            },
            "GridTeamUserSettingsV1": {
                "properties": {
                    "team_id": {
                        "description": "ID of the team.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team.",
                        "examples": [
                            "Engineering"
                        ],
                        "title": "Team Name",
                        "type": "string"
                    },
                    "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/GridSpendLimitSettingV1",
                        "description": "Spend limit for Baseten Grid in the team. Applies to requests with Routes keys the user created in the team; personal API keys are not limited."
                    },
                    "month_spend_usd": {
                        "description": "The user's metered Grid spend in USD in the team this UTC calendar month, returned as an exact decimal string.",
                        "examples": [
                            "12.5"
                        ],
                        "title": "Month Spend Usd",
                        "type": "string"
                    },
                    "is_blocked": {
                        "description": "Whether the user's spend this month reached their limit, or the team's spend reached its team-wide limit, so requests with Routes keys they created in the team are rejected.",
                        "title": "Is Blocked",
                        "type": "boolean"
                    },
                    "blocked_by": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/GridSpendBlockedByV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "`member` when the user's spend this month reached their limit, `team` when the team's spend reached its team-wide limit. Null when the user is not blocked."
                    }
                },
                "required": [
                    "team_id",
                    "team_name",
                    "user_id",
                    "email",
                    "spend_limit",
                    "month_spend_usd",
                    "is_blocked",
                    "blocked_by"
                ],
                "title": "GridTeamUserSettingsV1",
                "type": "object"
            },
            "GridTeamUserSettingsListV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GridTeamUserSettingsV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GridTeamUserSettingsListV1",
                "type": "object"
            },
            "GridTeamUserSettingsListRequestV1": {
                "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": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Limit the list to this team. Without it, the members of every team you administer, one row per team.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    }
                },
                "title": "GridTeamUserSettingsListRequestV1",
                "type": "object"
            },
            "UpdateGridSpendLimitSettingV1": {
                "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
                    },
                    "month_override_usd": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Spend limit in USD for the current UTC calendar month, which supersedes the standing limit. Send null to remove it; omit to leave it unchanged.",
                        "examples": [
                            "300"
                        ],
                        "title": "Month Override Usd",
                        "x-null-distinct": true
                    }
                },
                "title": "UpdateGridSpendLimitSettingV1",
                "type": "object"
            },
            "UpdateGridUserSettingsRequestV1": {
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                    "spend_limit": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateGridSpendLimitSettingV1"
                            },
                            {
                                "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
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    }
                },
                "title": "UpdateGridUserSettingsRequestV1",
                "type": "object"
            },
            "GridConnectionBedrockAccessKeysAuthV1": {
                "properties": {
                    "method": {
                        "const": "access_keys",
                        "description": "The secret holds the access keys of an IAM user, as the base64-encoded JSON object `{\"AccessKeyId\": \"...\", \"SecretAccessKey\": \"...\"}`",
                        "title": "Method",
                        "type": "string"
                    }
                },
                "required": [
                    "method"
                ],
                "title": "GridConnectionBedrockAccessKeysAuthV1",
                "type": "object"
            },
            "GridConnectionBedrockApiKeyAuthV1": {
                "properties": {
                    "method": {
                        "const": "api_key",
                        "description": "The secret holds a long-term Amazon Bedrock API key.",
                        "title": "Method",
                        "type": "string"
                    }
                },
                "required": [
                    "method"
                ],
                "title": "GridConnectionBedrockApiKeyAuthV1",
                "type": "object"
            },
            "GridConnectionConfigAnthropicV1": {
                "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": "GridConnectionConfigAnthropicV1",
                "type": "object"
            },
            "GridConnectionConfigAzureV1": {
                "properties": {
                    "provider": {
                        "const": "AZURE",
                        "description": "Provider kind for Microsoft Azure.",
                        "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"
                    },
                    "resource_name": {
                        "description": "Name of the Azure AI Foundry or Azure OpenAI resource.",
                        "title": "Resource Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id",
                    "secret_name",
                    "resource_name"
                ],
                "title": "GridConnectionConfigAzureV1",
                "type": "object"
            },
            "GridConnectionConfigBedrockV1": {
                "properties": {
                    "provider": {
                        "const": "BEDROCK",
                        "description": "Provider kind for Amazon Bedrock.",
                        "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"
                    },
                    "region": {
                        "description": "AWS Region of the Amazon Bedrock endpoint.",
                        "title": "Region",
                        "type": "string"
                    },
                    "auth": {
                        "description": "How the connection's secret authenticates with Amazon Bedrock.",
                        "discriminator": {
                            "mapping": {
                                "access_keys": "#/components/schemas/GridConnectionBedrockAccessKeysAuthV1",
                                "api_key": "#/components/schemas/GridConnectionBedrockApiKeyAuthV1"
                            },
                            "propertyName": "method"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/GridConnectionBedrockApiKeyAuthV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridConnectionBedrockAccessKeysAuthV1"
                            }
                        ],
                        "title": "Auth"
                    }
                },
                "required": [
                    "provider",
                    "secret_id",
                    "secret_name",
                    "region",
                    "auth"
                ],
                "title": "GridConnectionConfigBedrockV1",
                "type": "object"
            },
            "GridConnectionConfigOpenAIV1": {
                "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": "GridConnectionConfigOpenAIV1",
                "type": "object"
            },
            "GridConnectionConfigVertexV1": {
                "properties": {
                    "provider": {
                        "const": "VERTEX",
                        "description": "Provider kind for Google Vertex.",
                        "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"
                    },
                    "project_id": {
                        "description": "Google Cloud project ID or number of a project with Vertex AI enabled.",
                        "title": "Project Id",
                        "type": "string"
                    },
                    "location": {
                        "description": "Google Cloud region that serves the Vertex AI models, for example `us-central1`.",
                        "title": "Location",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_id",
                    "secret_name",
                    "project_id",
                    "location"
                ],
                "title": "GridConnectionConfigVertexV1",
                "type": "object"
            },
            "GridConnectionConfigXAIV1": {
                "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": "GridConnectionConfigXAIV1",
                "type": "object"
            },
            "GridConnectionV1": {
                "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"
                    },
                    "team_name": {
                        "description": "Name of the team that owns the connection.",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "config": {
                        "description": "Provider the connection authenticates with, and the team secret holding its API key.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/GridConnectionConfigAnthropicV1",
                                "AZURE": "#/components/schemas/GridConnectionConfigAzureV1",
                                "BEDROCK": "#/components/schemas/GridConnectionConfigBedrockV1",
                                "OPENAI": "#/components/schemas/GridConnectionConfigOpenAIV1",
                                "VERTEX": "#/components/schemas/GridConnectionConfigVertexV1",
                                "XAI": "#/components/schemas/GridConnectionConfigXAIV1"
                            },
                            "propertyName": "provider"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/GridConnectionConfigAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridConnectionConfigOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridConnectionConfigXAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridConnectionConfigVertexV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridConnectionConfigBedrockV1"
                            },
                            {
                                "$ref": "#/components/schemas/GridConnectionConfigAzureV1"
                            }
                        ],
                        "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",
                    "team_name",
                    "config",
                    "created_at",
                    "updated_at"
                ],
                "title": "GridConnectionV1",
                "type": "object"
            },
            "GridConnectionsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GridConnectionV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GridConnectionsResponseV1",
                "type": "object"
            },
            "GridConnectionsRequestV1": {
                "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": "Limit connections to this team. Without it, connections from every team where you can invoke routes.",
                        "title": "Team Id"
                    }
                },
                "title": "GridConnectionsRequestV1",
                "type": "object"
            },
            "UpsertGridConnectionBedrockAccessKeysAuthV1": {
                "additionalProperties": false,
                "properties": {
                    "method": {
                        "const": "access_keys",
                        "description": "The secret holds the access keys of an IAM user, as the base64-encoded JSON object `{\"AccessKeyId\": \"...\", \"SecretAccessKey\": \"...\"}`",
                        "title": "Method",
                        "type": "string"
                    }
                },
                "required": [
                    "method"
                ],
                "title": "UpsertGridConnectionBedrockAccessKeysAuthV1",
                "type": "object"
            },
            "UpsertGridConnectionBedrockApiKeyAuthV1": {
                "additionalProperties": false,
                "properties": {
                    "method": {
                        "const": "api_key",
                        "description": "The secret holds a long-term Amazon Bedrock API key.",
                        "title": "Method",
                        "type": "string"
                    }
                },
                "required": [
                    "method"
                ],
                "title": "UpsertGridConnectionBedrockApiKeyAuthV1",
                "type": "object"
            },
            "UpsertGridConnectionConfigAnthropicV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "ANTHROPIC",
                        "description": "Provider kind for Anthropic.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of an existing secret, owned by the same team, that holds the provider API key.",
                        "examples": [
                            "anthropic-key"
                        ],
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_name"
                ],
                "title": "UpsertGridConnectionConfigAnthropicV1",
                "type": "object"
            },
            "UpsertGridConnectionConfigAzureV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "AZURE",
                        "description": "Provider kind for Microsoft Azure. Route targets name a deployment, which must be named after its Azure model. Claude models (`claude-*`) use the Anthropic Messages API, and other models use the OpenAI-compatible APIs.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of an existing secret, owned by the same team, that holds the provider API key.",
                        "examples": [
                            "anthropic-key"
                        ],
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    },
                    "resource_name": {
                        "description": "Name of the Azure AI Foundry or Azure OpenAI resource, the subdomain of `<resource_name>.openai.azure.com`.",
                        "examples": [
                            "my-foundry-resource"
                        ],
                        "minLength": 1,
                        "title": "Resource Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_name",
                    "resource_name"
                ],
                "title": "UpsertGridConnectionConfigAzureV1",
                "type": "object"
            },
            "UpsertGridConnectionConfigBedrockV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "BEDROCK",
                        "description": "Provider kind for Amazon Bedrock. Claude models (`anthropic.*`) use the Anthropic Messages API, and other models use the OpenAI-compatible APIs.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of an existing secret, owned by the same team, that holds the provider API key.",
                        "examples": [
                            "anthropic-key"
                        ],
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    },
                    "region": {
                        "description": "AWS Region of the Amazon Bedrock endpoint, for example `us-east-1`.",
                        "examples": [
                            "us-east-1"
                        ],
                        "minLength": 1,
                        "title": "Region",
                        "type": "string"
                    },
                    "auth": {
                        "description": "How the connection's secret authenticates with Amazon Bedrock.",
                        "discriminator": {
                            "mapping": {
                                "access_keys": "#/components/schemas/UpsertGridConnectionBedrockAccessKeysAuthV1",
                                "api_key": "#/components/schemas/UpsertGridConnectionBedrockApiKeyAuthV1"
                            },
                            "propertyName": "method"
                        },
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionBedrockApiKeyAuthV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionBedrockAccessKeysAuthV1"
                            }
                        ],
                        "title": "Auth"
                    }
                },
                "required": [
                    "provider",
                    "secret_name",
                    "region",
                    "auth"
                ],
                "title": "UpsertGridConnectionConfigBedrockV1",
                "type": "object"
            },
            "UpsertGridConnectionConfigOpenAIV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "OPENAI",
                        "description": "Provider kind for OpenAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of an existing secret, owned by the same team, that holds the provider API key.",
                        "examples": [
                            "anthropic-key"
                        ],
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_name"
                ],
                "title": "UpsertGridConnectionConfigOpenAIV1",
                "type": "object"
            },
            "UpsertGridConnectionConfigVertexV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "VERTEX",
                        "description": "Provider kind for Google Vertex.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of an existing secret, owned by the same team, that holds the provider API key.",
                        "examples": [
                            "anthropic-key"
                        ],
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    },
                    "project_id": {
                        "description": "Google Cloud project ID or number of a project with Vertex AI enabled.",
                        "examples": [
                            "my-gcp-project"
                        ],
                        "minLength": 1,
                        "title": "Project Id",
                        "type": "string"
                    },
                    "location": {
                        "description": "Google Cloud region that serves the Vertex AI models, for example `us-central1`.",
                        "examples": [
                            "us-central1"
                        ],
                        "minLength": 1,
                        "title": "Location",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_name",
                    "project_id",
                    "location"
                ],
                "title": "UpsertGridConnectionConfigVertexV1",
                "type": "object"
            },
            "UpsertGridConnectionConfigXAIV1": {
                "additionalProperties": false,
                "properties": {
                    "provider": {
                        "const": "XAI",
                        "description": "Provider kind for xAI.",
                        "title": "Provider",
                        "type": "string"
                    },
                    "secret_name": {
                        "description": "Name of an existing secret, owned by the same team, that holds the provider API key.",
                        "examples": [
                            "anthropic-key"
                        ],
                        "minLength": 1,
                        "title": "Secret Name",
                        "type": "string"
                    }
                },
                "required": [
                    "provider",
                    "secret_name"
                ],
                "title": "UpsertGridConnectionConfigXAIV1",
                "type": "object"
            },
            "CreateGridConnectionRequestV1": {
                "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/UpsertGridConnectionConfigAnthropicV1",
                                "AZURE": "#/components/schemas/UpsertGridConnectionConfigAzureV1",
                                "BEDROCK": "#/components/schemas/UpsertGridConnectionConfigBedrockV1",
                                "OPENAI": "#/components/schemas/UpsertGridConnectionConfigOpenAIV1",
                                "VERTEX": "#/components/schemas/UpsertGridConnectionConfigVertexV1",
                                "XAI": "#/components/schemas/UpsertGridConnectionConfigXAIV1"
                            },
                            "propertyName": "provider"
                        },
                        "examples": [
                            {
                                "provider": "ANTHROPIC",
                                "secret_name": "anthropic-key"
                            }
                        ],
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigXAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigVertexV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigBedrockV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigAzureV1"
                            }
                        ],
                        "title": "Config"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "CreateGridConnectionRequestV1",
                "type": "object"
            },
            "GridConnectionTombstoneV1": {
                "properties": {
                    "id": {
                        "description": "Stable identifier of the deleted connection.",
                        "title": "Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id"
                ],
                "title": "GridConnectionTombstoneV1",
                "type": "object"
            },
            "UpdateGridConnectionRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "config": {
                        "description": "Complete new connection configuration, replacing the current one. The provider must match the connection and is immutable.",
                        "discriminator": {
                            "mapping": {
                                "ANTHROPIC": "#/components/schemas/UpsertGridConnectionConfigAnthropicV1",
                                "AZURE": "#/components/schemas/UpsertGridConnectionConfigAzureV1",
                                "BEDROCK": "#/components/schemas/UpsertGridConnectionConfigBedrockV1",
                                "OPENAI": "#/components/schemas/UpsertGridConnectionConfigOpenAIV1",
                                "VERTEX": "#/components/schemas/UpsertGridConnectionConfigVertexV1",
                                "XAI": "#/components/schemas/UpsertGridConnectionConfigXAIV1"
                            },
                            "propertyName": "provider"
                        },
                        "examples": [
                            {
                                "provider": "ANTHROPIC",
                                "secret_name": "anthropic-key"
                            }
                        ],
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigAnthropicV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigOpenAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigXAIV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigVertexV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigBedrockV1"
                            },
                            {
                                "$ref": "#/components/schemas/UpsertGridConnectionConfigAzureV1"
                            }
                        ],
                        "title": "Config"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "UpdateGridConnectionRequestV1",
                "type": "object"
            },
            "GridRouteClassifiersResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GridRouteClassifierV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GridRouteClassifiersResponseV1",
                "type": "object"
            },
            "GridRouteClassifiersRequestV1": {
                "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"
                    }
                },
                "title": "GridRouteClassifiersRequestV1",
                "type": "object"
            },
            "GridMachineUserV1": {
                "properties": {
                    "id": {
                        "description": "Stable machine user identifier. Grid usage and settings identify the machine user by this ID as its `user_id`.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the machine user, unique within its team.",
                        "title": "Name",
                        "type": "string"
                    },
                    "team_id": {
                        "description": "Identifier of the team that owns the machine user.",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team that owns the machine user.",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "created_by": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the user who created the machine user. Null when unknown.",
                        "title": "Created By"
                    },
                    "created_at": {
                        "description": "Creation time, ISO 8601.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "team_id",
                    "team_name",
                    "created_at"
                ],
                "title": "GridMachineUserV1",
                "type": "object"
            },
            "GridMachineUsersResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GridMachineUserV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GridMachineUsersResponseV1",
                "type": "object"
            },
            "GridMachineUsersRequestV1": {
                "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": "Limit machine users to this team. Without it, every team you administer.",
                        "title": "Team Id"
                    }
                },
                "title": "GridMachineUsersRequestV1",
                "type": "object"
            },
            "CreateGridMachineUserAPIKeyRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the API key: lowercase letters, numbers, and hyphens, at most 255 characters, and unique among the machine user's active keys. Defaults to a name derived from the machine user's.",
                        "examples": [
                            "production"
                        ],
                        "title": "Name"
                    }
                },
                "title": "CreateGridMachineUserAPIKeyRequestV1",
                "type": "object"
            },
            "CreateGridMachineUserRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "team_id": {
                        "anyOf": [
                            {
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Identifier of the team that owns the machine user. Defaults to your only team, if you belong to exactly one.",
                        "examples": [
                            "abc1234"
                        ],
                        "title": "Team Id"
                    },
                    "name": {
                        "description": "Name of the machine user, unique within the team. At most 255 characters.",
                        "examples": [
                            "night-shift"
                        ],
                        "maxLength": 255,
                        "minLength": 1,
                        "title": "Name",
                        "type": "string"
                    },
                    "api_key": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CreateGridMachineUserAPIKeyRequestV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When set, also creates the machine user's first API key."
                    }
                },
                "required": [
                    "name"
                ],
                "title": "CreateGridMachineUserRequestV1",
                "type": "object"
            },
            "CreatedGridMachineUserV1": {
                "properties": {
                    "id": {
                        "description": "Stable machine user identifier. Grid usage and settings identify the machine user by this ID as its `user_id`.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the machine user, unique within its team.",
                        "title": "Name",
                        "type": "string"
                    },
                    "team_id": {
                        "description": "Identifier of the team that owns the machine user.",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Name of the team that owns the machine user.",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "created_by": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "ID of the user who created the machine user. Null when unknown.",
                        "title": "Created By"
                    },
                    "created_at": {
                        "description": "Creation time, ISO 8601.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "api_key": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The first API key, returned only once. Null unless the request set `api_key`.",
                        "title": "Api Key"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "team_id",
                    "team_name",
                    "created_at"
                ],
                "title": "CreatedGridMachineUserV1",
                "type": "object"
            },
            "GridMachineUserTombstoneV1": {
                "properties": {
                    "id": {
                        "description": "Stable identifier of the deleted machine user.",
                        "title": "Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id"
                ],
                "title": "GridMachineUserTombstoneV1",
                "type": "object"
            },
            "UpdateGridMachineUserRequestV1": {
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "minLength": 1,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the machine user, unique within its team. At most 255 characters. Omit to keep it.",
                        "title": "Name"
                    }
                },
                "title": "UpdateGridMachineUserRequestV1",
                "type": "object"
            },
            "EndpointTargetV1": {
                "description": "One configured upstream target of an endpoint.",
                "properties": {
                    "provider": {
                        "$ref": "#/components/schemas/GatewayEndpointProviderV1",
                        "description": "Upstream provider.",
                        "examples": [
                            "ANTHROPIC",
                            "OPENAI_COMPATIBLE"
                        ]
                    },
                    "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"
            },
            "GatewayEndpointProviderV1": {
                "enum": [
                    "ANTHROPIC",
                    "OPENAI",
                    "XAI",
                    "BASETEN",
                    "BASETEN_MODEL_API",
                    "VERTEX",
                    "OPENAI_COMPATIBLE"
                ],
                "title": "GatewayEndpointProviderV1",
                "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/GatewayEndpointProviderV1",
                        "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"
            },
            "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"
            },
            "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"
            },
            "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."
                    }
                }
            },
            "SandboxMetricModeV1": {
                "type": "string",
                "enum": [
                    "CURRENT",
                    "SUMMARY",
                    "SERIES"
                ]
            },
            "SandboxMetricNameV1": {
                "type": "string",
                "enum": [
                    "baseten_sandbox_requests_total",
                    "baseten_sandbox_cpu_usage_cores",
                    "baseten_sandbox_memory_bytes"
                ]
            },
            "SandboxMetricsV1": {
                "type": "object",
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis",
                    "mode",
                    "step_seconds",
                    "metric_descriptors",
                    "metric_values"
                ],
                "properties": {
                    "start_epoch_millis": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Returned window start, snapped outward in SERIES. Equal to end for CURRENT."
                    },
                    "end_epoch_millis": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Returned exclusive window end, snapped outward in SERIES. Snapshot timestamp for CURRENT."
                    },
                    "mode": {
                        "$ref": "#/components/schemas/SandboxMetricModeV1"
                    },
                    "step_seconds": {
                        "description": "Seconds per SERIES interval; null in CURRENT and SUMMARY.",
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "metric_descriptors": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 3,
                        "items": {
                            "$ref": "#/components/schemas/SandboxMetricDescriptorV1"
                        }
                    },
                    "metric_values": {
                        "type": "array",
                        "maxItems": 10000,
                        "items": {
                            "$ref": "#/components/schemas/SandboxMetricValueSetV1"
                        }
                    }
                }
            },
            "SandboxMetricDescriptorV1": {
                "type": "object",
                "required": [
                    "name",
                    "unit_hint",
                    "kind",
                    "label_sets"
                ],
                "properties": {
                    "name": {
                        "$ref": "#/components/schemas/SandboxMetricNameV1"
                    },
                    "unit_hint": {
                        "type": "string",
                        "enum": [
                            "COUNT",
                            "CORES",
                            "BYTES"
                        ],
                        "description": "Requests use COUNT, CPU uses CORES (1 means one fully used core), and memory uses BYTES."
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "GAUGE",
                            "COUNTER"
                        ]
                    },
                    "label_sets": {
                        "type": "array",
                        "maxItems": 3,
                        "description": "Requests use status=2xx,4xx,5xx; CPU and memory use stat=avg,max.\n",
                        "items": {
                            "type": "object",
                            "additionalProperties": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "SandboxMetricValueSetV1": {
                "type": "object",
                "required": [
                    "start_epoch_millis",
                    "values"
                ],
                "properties": {
                    "start_epoch_millis": {
                        "type": "integer",
                        "format": "int64",
                        "description": "Start of the SERIES interval or SUMMARY window; snapshot timestamp in CURRENT."
                    },
                    "values": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 3,
                        "description": "Values indexed first by metric_descriptors, then by that descriptor's label_sets. Null means no sample.",
                        "items": {
                            "type": "array",
                            "maxItems": 3,
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "number",
                                        "format": "double"
                                    },
                                    {
                                        "type": "null"
                                    }
                                ]
                            }
                        }
                    }
                }
            },
            "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"
                        ]
                    }
                }
            },
            "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"
                    }
                }
            },
            "SandboxEnvV1": {
                "type": "object",
                "description": "Environment variable with name and value",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Name of the environment variable. Must start with a letter or underscore and contain only letters, digits and underscores (^[A-Za-z_][A-Za-z0-9_]*$); create and update reject other names.",
                        "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"
                }
            },
            "SandboxFilesystemV1": {
                "type": "object",
                "description": "Filesystem configuration of a sandbox. The sandbox filesystem is held in memory, so files written count against the sandbox memory.",
                "properties": {
                    "max_memory_usage": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer"
                            }
                        ],
                        "x-go-type": "SandboxMemoryUsage",
                        "description": "Maximum memory the filesystem can use, as a percentage of the sandbox memory (e.g. \"80%\"), a size (e.g. \"2Gi\") or a number of Mi (e.g. 2048). Defaults to 50%.",
                        "example": "80%"
                    }
                }
            },
            "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"
                        }
                    },
                    "region": {
                        "type": "string",
                        "description": "Region where the sandbox runs (for example us-pdx-1 or eu-lon-1). When omitted at creation, the default sandbox region is used.",
                        "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. Must be between 1024 and 262144. When cpu is not set at creation, memory also determines the CPU allocation (by default 2048 MB = 1 vCPU, 4096 MB = 2, 8192 MB = 4, 16384 MB = 6, 32768 MB = 8, 65536 MB = 16, 131072 MB or more = 32).",
                        "example": 4096,
                        "minimum": 512,
                        "maximum": 262144
                    },
                    "cpu": {
                        "type": "integer",
                        "description": "Number of vCPUs the sandbox runs with. Always returned, including for sandboxes created without cpu, whose CPU allocation was derived from memory. Set at creation only.",
                        "example": 2,
                        "minimum": 1,
                        "maximum": 32
                    },
                    "filesystem": {
                        "description": "Filesystem configuration. Set at creation only.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxFilesystemV1"
                            }
                        ],
                        "example": {
                            "max_memory_usage": "80%"
                        }
                    },
                    "volumes": {
                        "type": "array",
                        "description": "Volumes mounted in the sandbox. Set at creation only.",
                        "maxItems": 1,
                        "items": {
                            "$ref": "#/components/schemas/SandboxVolumeAttachmentV1"
                        }
                    },
                    "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"
                    },
                    "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,
                    "cpu": 2,
                    "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"
                        }
                    },
                    "region": {
                        "type": "string",
                        "description": "Region where the sandbox runs (for example us-pdx-1 or eu-lon-1). When omitted at creation, the default sandbox region is used.",
                        "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. Must be between 1024 and 262144. Defaults to 4096, or to 8192 MB per vCPU (a 1:8 ratio) when only cpu is set, capped at the account's memory quota. When cpu is omitted, memory also determines the CPU allocation (by default 2048 MB = 1 vCPU, 4096 MB = 2, 8192 MB = 4, 16384 MB = 6, 32768 MB = 8, 65536 MB = 16, 131072 MB or more = 32).",
                        "example": 4096,
                        "minimum": 512,
                        "maximum": 262144
                    },
                    "cpu": {
                        "type": "integer",
                        "description": "Optional number of vCPUs, a whole number between 1 and 32. When omitted, the CPU allocation is derived from memory. When set, memory must be between 1024 and 8192 megabytes per vCPU (a ratio from 1:1 to 1:8), and cpu must not exceed the account's per-sandbox cpu quota. A value equal to the allocation memory alone would give is always accepted. When memory is omitted, it defaults to 8192 MB per vCPU, capped at the account's memory quota. Immutable after creation.",
                        "example": 2,
                        "minimum": 1,
                        "maximum": 32
                    },
                    "filesystem": {
                        "description": "Filesystem configuration. Set at creation only.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxFilesystemV1"
                            }
                        ],
                        "example": {
                            "max_memory_usage": "80%"
                        }
                    },
                    "volumes": {
                        "type": "array",
                        "description": "Volumes mounted in the sandbox. Set at creation only.",
                        "maxItems": 1,
                        "items": {
                            "$ref": "#/components/schemas/SandboxVolumeAttachmentV1"
                        }
                    },
                    "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"
                    },
                    "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,
                    "cpu": 2,
                    "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, cpu, region, image, ports, filesystem, and volumes 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"
                    },
                    "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,
                    "cpu": 2,
                    "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"
                                },
                                "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,
                                "cpu": 2,
                                "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"
                            },
                            "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,
                            "cpu": 2,
                            "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/SandboxImageV1"
                        }
                    },
                    "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
                }
            },
            "SandboxImageV1": {
                "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
                }
            },
            "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\"}}}"
                    },
                    "memory": {
                        "type": "integer",
                        "description": "Memory in megabytes of the temporary environment that builds the source archive or imports the registry image. Omit it to use the default size. Does not change the memory of sandboxes created from the image.",
                        "minimum": 1,
                        "maximum": 32768,
                        "example": 16384
                    },
                    "volume": {
                        "type": "integer",
                        "description": "Scratch disk in megabytes attached to the temporary build environment for intermediate layers. Set it for large images that run out of space while building or importing. 0 builds in memory, which is the default. Teams with HIPAA compliance enabled accept only 0.",
                        "minimum": 0,
                        "maximum": 131072,
                        "example": 32768
                    }
                },
                "required": [
                    "name"
                ],
                "example": {
                    "name": "base-image",
                    "image": "docker.io/b10/base-image:latest",
                    "docker_config": "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"YjEwLXJldmlldzpkZW1vLW5vdC1hLXZhbGlkLXJlZ2lzdHJ5LXRva2Vu\"}}}",
                    "memory": 16384,
                    "volume": 32768
                }
            },
            "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"
                    },
                    "upload_headers": {
                        "type": "object",
                        "description": "Headers the source archive upload must send, in addition to Content-Type, with exactly these names and values. Present only with upload_url, when memory or volume was set. upload_url is signed for these headers, so storage rejects an upload that omits or changes them. Treat names and values as opaque.",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "image": {
                        "type": "string",
                        "description": "Registered image reference including its tag, when available. Tags are assigned by the service; GET /sandboxes/images/{image_name}/tags 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, used in volume_name path parameters and sandbox volumes.",
                        "example": "datasets"
                    },
                    "mount_path": {
                        "type": "string",
                        "description": "Absolute filesystem path where the volume is mounted.",
                        "example": "/mnt/data"
                    },
                    "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."
                    },
                    "remaining": {
                        "type": "integer",
                        "description": "Number of unused image versions left for a next call.",
                        "minimum": 0,
                        "example": 0
                    },
                    "has_more": {
                        "type": "boolean",
                        "description": "True when the cleanup stopped on its time limit before every unused version was removed. Call it again to continue.",
                        "example": false
                    }
                },
                "required": [
                    "deleted",
                    "message"
                ],
                "example": {
                    "deleted": 3,
                    "message": "Removed 3 unused image versions. Image versions used by active sandboxes were retained."
                }
            },
            "SandboxPreviewStatusV1": {
                "type": "string",
                "description": "Preview status, always uppercase.",
                "enum": [
                    "DEPLOYING",
                    "DEPLOYED",
                    "FAILED",
                    "DELETING",
                    "TERMINATED"
                ],
                "readOnly": true,
                "example": "DEPLOYED"
            },
            "SandboxPreviewTtlV1": {
                "type": "string",
                "description": "Lifetime counted from the request, using seconds, minutes, hours or composite durations such as 1h30m. Whole days are also supported, for example 7d; days cannot be combined with other units. The preview is deleted when it elapses.",
                "pattern": "^([0-9]+d|(([0-9]+(\\.[0-9]*)?|\\.[0-9]+)(ns|us|\u00b5s|\u03bcs|ms|s|m|h))+)$",
                "example": "24h"
            },
            "SandboxPreviewHeadersV1": {
                "type": "object",
                "description": "HTTP headers as name-value pairs. At most 20 headers and 8 KiB of names and values in total unless your quota allows more.",
                "additionalProperties": {
                    "type": "string"
                },
                "example": {
                    "Access-Control-Allow-Origin": "*"
                }
            },
            "SandboxPreviewConfigurationV1": {
                "type": "object",
                "description": "Mutable preview configuration.",
                "properties": {
                    "public": {
                        "type": "boolean",
                        "description": "Whether the URL is reachable without a preview token. Defaults to false on creation; a PATCH without it keeps the current value.",
                        "example": true
                    },
                    "response_headers": {
                        "description": "Headers added to every response served by the preview, for example CORS headers.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxPreviewHeadersV1"
                            }
                        ]
                    },
                    "request_headers": {
                        "description": "Headers added to every request forwarded to the sandbox, for example an Authorization header expected by the application. Responses return each name with the value \"****\", except a GET with show_secrets=true by a workspace administrator. Sending \"****\" back as a value returns 400. A PATCH replaces the whole set. Some header names are reserved by the platform.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxPreviewHeadersV1"
                            }
                        ],
                        "example": {
                            "Authorization": "Bearer app-internal-token"
                        }
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Time at which the preview is deleted. Must be in the future.",
                        "example": "2026-10-19T12:00:00Z"
                    }
                }
            },
            "CreateSandboxPreviewRequestV1": {
                "description": "Preview to create. Only port is required. ttl and expires_at are mutually exclusive; supplying both returns 400.",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SandboxPreviewConfigurationV1"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "ttl": {
                                "$ref": "#/components/schemas/SandboxPreviewTtlV1"
                            },
                            "create_if_not_exists": {
                                "type": "boolean",
                                "description": "When true, return the existing preview with this name instead of failing with a conflict. Without name, the name is public-<port> or private-<port>, so the same port and visibility return the same preview. Existing configuration is preserved. Defaults to false when omitted."
                            },
                            "name": {
                                "type": "string",
                                "description": "Preview name, unique within the sandbox. When omitted, generated from the sandbox name and port, or public-<port> or private-<port> when create_if_not_exists is true.",
                                "minLength": 1,
                                "maxLength": 49,
                                "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
                                "example": "web"
                            },
                            "port": {
                                "type": "integer",
                                "description": "Sandbox port to expose.",
                                "minimum": 1,
                                "maximum": 65535,
                                "example": 3000
                            }
                        },
                        "required": [
                            "port"
                        ]
                    }
                ]
            },
            "UpdateSandboxPreviewRequestV1": {
                "description": "Preview fields to change. name and port cannot be changed. ttl and expires_at are mutually exclusive; supplying both returns 400.",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SandboxPreviewConfigurationV1"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "ttl": {
                                "$ref": "#/components/schemas/SandboxPreviewTtlV1"
                            }
                        }
                    }
                ]
            },
            "SandboxPreviewV1": {
                "description": "Sandbox preview with configuration and server-managed fields at the root.",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SandboxPreviewConfigurationV1"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "Preview name, used in preview_name path parameters.",
                                "readOnly": true,
                                "example": "web"
                            },
                            "port": {
                                "type": "integer",
                                "description": "Exposed sandbox port.",
                                "readOnly": true,
                                "example": 3000
                            },
                            "url": {
                                "type": "string",
                                "format": "uri",
                                "description": "HTTPS URL serving the port, including the region label. Use this exact URL. Requests to a private preview need a token.",
                                "readOnly": true,
                                "example": "https://a1b2c3d4e5f6g7h8.us-pdx-1.preview.b10.co"
                            },
                            "status": {
                                "$ref": "#/components/schemas/SandboxPreviewStatusV1"
                            },
                            "region": {
                                "type": "string",
                                "description": "Region serving the preview, the sandbox's region.",
                                "readOnly": true,
                                "example": "us-pdx-1"
                            },
                            "created_at": {
                                "type": "string",
                                "format": "date-time",
                                "readOnly": true,
                                "example": "2026-10-12T12:00:00Z"
                            },
                            "updated_at": {
                                "type": "string",
                                "format": "date-time",
                                "readOnly": true,
                                "example": "2026-10-12T12:00:00Z"
                            },
                            "created_by": {
                                "type": "string",
                                "readOnly": true,
                                "example": "sandbox-automation"
                            },
                            "updated_by": {
                                "type": "string",
                                "readOnly": true,
                                "example": "sandbox-automation"
                            }
                        },
                        "required": [
                            "name",
                            "port",
                            "url",
                            "status",
                            "public"
                        ]
                    }
                ]
            },
            "ListSandboxPreviewsResponseV1": {
                "type": "object",
                "description": "One page of previews of a sandbox.",
                "properties": {
                    "items": {
                        "type": "array",
                        "description": "Resources on this page.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxPreviewV1"
                        }
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/SandboxApiPaginationV1"
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ]
            },
            "CreateSandboxPreviewTokenRequestV1": {
                "type": "object",
                "properties": {
                    "create_if_not_exists": {
                        "type": "boolean",
                        "description": "When true, may return an existing unexpired token of this preview that stays valid at least until expires_at instead of creating a new one. A token created a moment earlier may not be found yet, in which case a new token is created. Defaults to false when omitted."
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Time at which the token stops working. Must be in the future.",
                        "example": "2026-10-13T12:00:00Z"
                    }
                },
                "required": [
                    "expires_at"
                ]
            },
            "SandboxPreviewTokenV1": {
                "type": "object",
                "description": "Access token for a private preview.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Token name, used in token_name path parameters.",
                        "example": "7f3k2m9q1x8c4v6b0n5z"
                    },
                    "token": {
                        "type": "string",
                        "description": "Value to send as the preview_token query parameter.",
                        "example": "7f3k2m9q1x8c4v6b0n5z"
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "example": "2026-10-13T12:00:00Z"
                    },
                    "expired": {
                        "type": "boolean",
                        "description": "Whether expires_at has passed.",
                        "example": false
                    }
                },
                "required": [
                    "name",
                    "token",
                    "expires_at",
                    "expired"
                ]
            },
            "ListSandboxPreviewTokensResponseV1": {
                "type": "object",
                "description": "One page of tokens of a preview.",
                "properties": {
                    "items": {
                        "type": "array",
                        "description": "Resources on this page.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxPreviewTokenV1"
                        }
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/SandboxApiPaginationV1"
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ]
            },
            "SandboxVolumeStatusV1": {
                "type": "string",
                "description": "Volume status, always uppercase.",
                "enum": [
                    "DEPLOYING",
                    "DEPLOYED",
                    "FAILED",
                    "DELETING"
                ],
                "example": "DEPLOYED"
            },
            "SandboxVolumeAttachmentV1": {
                "type": "object",
                "description": "A persistent volume mounted in the sandbox. The volume must exist, be in the sandbox's region and not be mounted elsewhere. A sandbox mounts at most one persistent volume.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Name of the volume to mount.",
                        "minLength": 1,
                        "example": "datasets"
                    },
                    "mount_path": {
                        "type": "string",
                        "description": "Absolute path where the volume is mounted in the sandbox.",
                        "pattern": "^/",
                        "example": "/data"
                    },
                    "read_only": {
                        "type": "boolean",
                        "description": "Mount the volume read-only. Defaults to false.",
                        "default": false,
                        "example": false
                    }
                },
                "required": [
                    "name",
                    "mount_path"
                ],
                "example": {
                    "name": "datasets",
                    "mount_path": "/data",
                    "read_only": false
                }
            },
            "CreateSandboxVolumeRequestV1": {
                "type": "object",
                "description": "Volume to create. Only size is required.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Volume name, unique in the team. Generated when omitted.",
                        "minLength": 1,
                        "maxLength": 49,
                        "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$",
                        "example": "datasets"
                    },
                    "size": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer"
                            }
                        ],
                        "x-go-type": "VolumeSize",
                        "description": "Capacity, as a size (e.g. \"10Gi\", \"512Mi\") or a number of Mi (e.g. 1024). Can grow later, never shrink.",
                        "example": "10Gi"
                    },
                    "region": {
                        "type": "string",
                        "description": "Region of the volume. Defaults to the default sandbox region. Sandboxes mounting it must be in the same region.",
                        "example": "us-pdx-1"
                    },
                    "labels": {
                        "$ref": "#/components/schemas/SandboxMetadataLabelsV1"
                    }
                },
                "required": [
                    "size"
                ]
            },
            "UpdateSandboxVolumeRequestV1": {
                "type": "object",
                "description": "Volume fields to change. name and region cannot be changed.",
                "properties": {
                    "size": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer"
                            }
                        ],
                        "x-go-type": "VolumeSize",
                        "description": "New capacity, as a size (e.g. \"20Gi\") or a number of Mi, greater than or equal to the current size.",
                        "example": "20Gi"
                    },
                    "labels": {
                        "description": "Labels replacing all current labels, not merged with them. Omit to keep them.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxMetadataLabelsV1"
                            }
                        ]
                    }
                },
                "minProperties": 1
            },
            "SandboxVolumeV1": {
                "type": "object",
                "description": "Persistent volume.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Volume name, used in volume_name path parameters and sandbox volumes.",
                        "readOnly": true,
                        "example": "datasets"
                    },
                    "size": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer"
                            }
                        ],
                        "x-go-type": "VolumeSize",
                        "description": "Capacity, as a size (e.g. \"10Gi\", \"512Mi\") or a number of Mi (e.g. 1024).",
                        "example": "10Gi"
                    },
                    "region": {
                        "type": "string",
                        "description": "Region of the volume.",
                        "example": "us-pdx-1"
                    },
                    "status": {
                        "$ref": "#/components/schemas/SandboxVolumeStatusV1"
                    },
                    "attached_to": {
                        "type": "string",
                        "description": "Name of the sandbox the volume is mounted in. Absent when not mounted.",
                        "readOnly": true,
                        "example": "baseten-api-review-0916"
                    },
                    "labels": {
                        "description": "Labels. Omitted from list responses.",
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/SandboxMetadataLabelsV1"
                            }
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-10-12T12:00:00Z"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "readOnly": true,
                        "example": "2026-10-12T12:00:00Z"
                    },
                    "created_by": {
                        "type": "string",
                        "description": "User or service account that created the volume.",
                        "readOnly": true,
                        "example": "sandbox-automation"
                    },
                    "updated_by": {
                        "type": "string",
                        "description": "User or service account that last updated the volume.",
                        "readOnly": true,
                        "example": "sandbox-automation"
                    }
                },
                "required": [
                    "name",
                    "size",
                    "region",
                    "status"
                ]
            },
            "ListSandboxVolumesResponseV1": {
                "type": "object",
                "description": "One page of volumes.",
                "properties": {
                    "items": {
                        "type": "array",
                        "description": "Resources on this page.",
                        "items": {
                            "$ref": "#/components/schemas/SandboxVolumeV1"
                        }
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/SandboxApiPaginationV1"
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ]
            }
        },
        "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
            },
            "volume_tag": {
                "schema": {
                    "type": "string"
                },
                "name": "volume_tag",
                "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
            },
            "checkpoint_id": {
                "schema": {
                    "type": "string"
                },
                "name": "checkpoint_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
            },
            "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
            },
            "service_account_id": {
                "schema": {
                    "type": "string"
                },
                "name": "service_account_id",
                "in": "path",
                "required": true
            },
            "identity_provider_id": {
                "schema": {
                    "type": "string"
                },
                "name": "identity_provider_id",
                "in": "path",
                "required": true
            },
            "trust_rule_id": {
                "schema": {
                    "type": "string"
                },
                "name": "trust_rule_id",
                "in": "path",
                "required": true
            },
            "role_id": {
                "schema": {
                    "type": "string"
                },
                "name": "role_id",
                "in": "path",
                "required": true
            },
            "assignment_id": {
                "schema": {
                    "type": "string"
                },
                "name": "assignment_id",
                "in": "path",
                "required": true
            },
            "route_id": {
                "schema": {
                    "type": "string"
                },
                "name": "route_id",
                "in": "path",
                "required": true
            },
            "connection_id": {
                "schema": {
                    "type": "string"
                },
                "name": "connection_id",
                "in": "path",
                "required": true
            },
            "route_classifier_id": {
                "schema": {
                    "type": "string"
                },
                "name": "route_classifier_id",
                "in": "path",
                "required": true
            },
            "machine_user_id": {
                "schema": {
                    "type": "string"
                },
                "name": "machine_user_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
            },
            "SandboxMetricMode": {
                "name": "mode",
                "in": "query",
                "schema": {
                    "$ref": "#/components/schemas/SandboxMetricModeV1"
                },
                "description": "Defaults to CURRENT, which rejects start_epoch_millis and end_epoch_millis. SERIES uses a server-selected step of 30 seconds up to 2 hours, 60 seconds up to 1 day, 600 seconds up to 3 days, and 3600 seconds beyond 3 days."
            },
            "SandboxMetricStart": {
                "name": "start_epoch_millis",
                "in": "query",
                "schema": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0
                },
                "description": "Unix milliseconds. Defaults to one hour before end; SERIES snaps outward."
            },
            "SandboxMetricEnd": {
                "name": "end_epoch_millis",
                "in": "query",
                "schema": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0
                },
                "description": "Exclusive end in Unix milliseconds, default now. Maximum aligned window is 7 days."
            },
            "SandboxMetricNames": {
                "name": "metrics",
                "in": "query",
                "style": "form",
                "explode": true,
                "schema": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "uniqueItems": true,
                    "items": {
                        "$ref": "#/components/schemas/SandboxMetricNameV1"
                    }
                },
                "description": "Metric names in response order. Omit to request all three signals."
            },
            "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"
                }
            },
            "PreviewName": {
                "name": "preview_name",
                "in": "path",
                "required": true,
                "description": "Preview name returned by creation.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "example": "web"
                }
            },
            "PreviewTokenName": {
                "name": "token_name",
                "in": "path",
                "required": true,
                "description": "Token name returned by creation.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "example": "7f3k2m9q1x8c4v6b0n5z"
                }
            },
            "VolumeName": {
                "name": "volume_name",
                "in": "path",
                "required": true,
                "description": "Volume name returned by creation.",
                "schema": {
                    "type": "string",
                    "minLength": 1,
                    "example": "datasets"
                }
            },
            "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"
                    },
                    "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,
                    "cpu": 2,
                    "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 configuration is 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"
                    },
                    "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,
                    "cpu": 2,
                    "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. 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"
                    },
                    "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,
                    "cpu": 2,
                    "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"
                    },
                    "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,
                    "cpu": 2,
                    "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"
                            },
                            "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,
                            "cpu": 2,
                            "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"
                            },
                            "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,
                            "cpu": 2,
                            "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 repository summary",
                "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
                },
                "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
                }
            },
            "ImageSummary": {
                "summary": "Image repository summary",
                "value": {
                    "name": "base-image",
                    "status": "BUILT",
                    "created_at": "2026-09-15T21:20:00Z",
                    "size": 260046848,
                    "tag_count": 2
                }
            },
            "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\"}}}",
                    "memory": 16384,
                    "volume": 32768
                },
                "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."
                }
            },
            "CreateSandboxPreviewPublic": {
                "summary": "Public preview of a web server",
                "value": {
                    "name": "web",
                    "port": 3000,
                    "public": true,
                    "response_headers": {
                        "Access-Control-Allow-Origin": "*"
                    }
                }
            },
            "CreateSandboxPreviewPrivate": {
                "summary": "Private preview deleted after one day",
                "value": {
                    "port": 8080,
                    "ttl": "24h"
                }
            },
            "UpdateSandboxPreview": {
                "summary": "Make a preview private and extend it",
                "value": {
                    "public": false,
                    "ttl": "7d"
                }
            },
            "SandboxPreviewReady": {
                "summary": "Public preview",
                "value": {
                    "name": "web",
                    "port": 3000,
                    "public": true,
                    "url": "https://a1b2c3d4e5f6g7h8.us-pdx-1.preview.b10.co",
                    "status": "DEPLOYED",
                    "region": "us-pdx-1",
                    "response_headers": {
                        "Access-Control-Allow-Origin": "*"
                    },
                    "created_at": "2026-10-12T12:00:00Z",
                    "updated_at": "2026-10-12T12:00:00Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation"
                }
            },
            "SandboxPreviewDeleted": {
                "summary": "Deleted preview",
                "value": {
                    "name": "web",
                    "port": 3000,
                    "public": true,
                    "url": "https://a1b2c3d4e5f6g7h8.us-pdx-1.preview.b10.co",
                    "status": "TERMINATED",
                    "region": "us-pdx-1",
                    "created_at": "2026-10-12T12:00:00Z",
                    "updated_at": "2026-10-12T12:00:00Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation"
                }
            },
            "SandboxPreviewsList": {
                "summary": "Previews of a sandbox",
                "value": {
                    "items": [
                        {
                            "name": "web",
                            "port": 3000,
                            "public": true,
                            "url": "https://a1b2c3d4e5f6g7h8.us-pdx-1.preview.b10.co",
                            "status": "DEPLOYED",
                            "region": "us-pdx-1",
                            "created_at": "2026-10-12T12:00:00Z",
                            "updated_at": "2026-10-12T12:00:00Z"
                        }
                    ],
                    "pagination": {
                        "has_more": false
                    }
                }
            },
            "CreateSandboxPreviewToken": {
                "summary": "Token valid for one day",
                "value": {
                    "expires_at": "2026-10-13T12:00:00Z"
                }
            },
            "SandboxPreviewToken": {
                "summary": "Created token",
                "value": {
                    "name": "7f3k2m9q1x8c4v6b0n5z",
                    "token": "7f3k2m9q1x8c4v6b0n5z",
                    "expires_at": "2026-10-13T12:00:00Z",
                    "expired": false
                }
            },
            "SandboxPreviewTokensList": {
                "summary": "Tokens of a preview",
                "value": {
                    "items": [
                        {
                            "name": "7f3k2m9q1x8c4v6b0n5z",
                            "token": "7f3k2m9q1x8c4v6b0n5z",
                            "expires_at": "2026-10-13T12:00:00Z",
                            "expired": false
                        }
                    ],
                    "pagination": {
                        "has_more": false
                    }
                }
            },
            "CreateSandboxVolume": {
                "summary": "One gigabyte volume",
                "value": {
                    "name": "datasets",
                    "size": "10Gi",
                    "region": "us-pdx-1",
                    "labels": {
                        "project": "api-review"
                    }
                }
            },
            "UpdateSandboxVolume": {
                "summary": "Grow a volume",
                "value": {
                    "size": "20Gi"
                }
            },
            "SandboxVolumeReady": {
                "summary": "Volume mounted in a sandbox",
                "value": {
                    "name": "datasets",
                    "size": "10Gi",
                    "region": "us-pdx-1",
                    "status": "DEPLOYED",
                    "attached_to": "baseten-api-review-0916",
                    "labels": {
                        "project": "api-review"
                    },
                    "created_at": "2026-10-12T12:00:00Z",
                    "updated_at": "2026-10-12T12:00:00Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation"
                }
            },
            "SandboxVolumeDeleting": {
                "summary": "Volume being deleted",
                "value": {
                    "name": "datasets",
                    "size": "10Gi",
                    "region": "us-pdx-1",
                    "status": "DELETING",
                    "created_at": "2026-10-12T12:00:00Z",
                    "updated_at": "2026-10-12T12:30:00Z",
                    "created_by": "sandbox-automation",
                    "updated_by": "sandbox-automation"
                }
            },
            "SandboxVolumesPage": {
                "summary": "Last page of volumes",
                "value": {
                    "items": [
                        {
                            "name": "datasets",
                            "size": "10Gi",
                            "region": "us-pdx-1",
                            "status": "DEPLOYED",
                            "attached_to": "baseten-api-review-0916",
                            "created_at": "2026-10-12T12:00:00Z",
                            "updated_at": "2026-10-12T12:00:00Z",
                            "created_by": "sandbox-automation",
                            "updated_by": "sandbox-automation"
                        }
                    ],
                    "pagination": {
                        "has_more": false
                    }
                }
            }
        }
    }
}