{
    "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/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 \u2014 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 the environment groups for the team specified in the path, or for the caller's organization default team when no team is specified.",
                "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 on the team specified in the path, or on the caller's organization default team when no team is specified.",
                "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. Targets the team specified in the path, or the caller's organization default team when no team is specified.",
                "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 the environment groups for the team specified in the path, or for the caller's organization default team when no team is specified.",
                "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 on the team specified in the path, or on the caller's organization default team when no team is specified.",
                "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. Targets the team specified in the path, or the caller's organization default team when no team is specified.",
                "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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a list of all teams the authenticated user has access to.",
                "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/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": "Get 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": "Patch 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    \"deploy_timeout_minutes\": null,\n    \"deployment_name\": null,\n    \"labels\": null\n  },\n  \"name\": null,\n  \"team_id\": null,\n  \"model_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/prepare_model_upload\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'deployment': {'config': None, 'raw_config': None, 'user_env': None, 'environment_name': None, 'deploy_timeout_minutes': None, 'deployment_name': None, 'labels': None}, 'name': None, 'team_id': None, 'model_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PrepareModelUploadRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PrepareModelUploadResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "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` \u2014 fork an accessible listing from `GET /v1/library_models`). The deployment isn't instantly ready \u2014 poll 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "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` \u2014 fork an accessible listing from `GET /v1/library_models`). The deployment isn't instantly ready \u2014 poll 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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "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"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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/development/promote": {
            "post": {
                "summary": "Promotes a development deployment to production",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_production\": true,\n  \"preserve_env_instance_type\": true\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_production': True, 'preserve_env_instance_type': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new production deployment from the development deployment, the currently building deployment is returned.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/promote": {
            "post": {
                "summary": "Promotes a deployment to production",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_production\": true,\n  \"preserve_env_instance_type\": true\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_production': True, 'preserve_env_instance_type': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Promotes an existing deployment to production and returns the same deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/development/activate": {
            "post": {
                "summary": "Activates a development deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/development/activate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/development/activate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Activates an inactive development deployment and returns the activation status.",
                "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 an inactive production deployment and returns the activation status.",
                "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 an inactive deployment and returns the activation status.",
                "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 and returns the deactivation status.",
                "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 and returns the deactivation status.",
                "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 and returns the deactivation status.",
                "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    json={}\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 \u2014 not available for deployments created before 2026-04-30. 'parsed': dict with server-side defaults applied \u2014 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    json={}\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": "Stage 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": "Get 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": "Sync 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    json={}\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/DeploymentMetricModeV1",
                            "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 to the deployment are omitted from the response.",
                        "schema": {
                            "items": {
                                "type": "string"
                            },
                            "title": "Metrics",
                            "type": "array"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetDeploymentMetricsResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}": {
            "delete": {
                "summary": "Terminates a replica in a deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Terminates a deployment replica and returns the termination status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TerminateReplicaResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/deployment_id"
                },
                {
                    "$ref": "#/components/parameters/replica_id"
                }
            ]
        },
        "/v1/models/{model_id}/deployments/{deployment_id}/ssh/sign": {
            "post": {
                "summary": "Sign 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": "Get 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": "Create an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"name\": \"staging\",\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 800,\n    \"concurrency_target\": 3,\n    \"max_replica\": 2,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 60,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"promotion_settings\": {\n    \"promotion_cleanup_strategy\": null,\n    \"ramp_up_duration_seconds\": 600,\n    \"ramp_up_while_promoting\": true,\n    \"redeploy_on_promotion\": true,\n    \"rolling_deploy\": true,\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/models/{model_id}/environments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'name': 'staging', 'autoscaling_settings': {'autoscaling_window': 800, 'concurrency_target': 3, 'max_replica': 2, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 60, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'promotion_settings': {'promotion_cleanup_strategy': None, 'ramp_up_duration_seconds': 600, 'ramp_up_while_promoting': True, 'redeploy_on_promotion': True, 'rolling_deploy': True, 'rolling_deploy_config': 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}": {
            "get": {
                "summary": "Get 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"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ],
            "patch": {
                "summary": "Update an environment's settings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 800,\n    \"concurrency_target\": 3,\n    \"max_replica\": 2,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 60,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"promotion_settings\": {\n    \"promotion_cleanup_strategy\": null,\n    \"ramp_up_duration_seconds\": 600,\n    \"ramp_up_while_promoting\": true,\n    \"redeploy_on_promotion\": true,\n    \"rolling_deploy\": null,\n    \"rolling_deploy_config\": null\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'autoscaling_settings': {'autoscaling_window': 800, 'concurrency_target': 3, 'max_replica': 2, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 60, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'promotion_settings': {'promotion_cleanup_strategy': None, 'ramp_up_duration_seconds': 600, 'ramp_up_while_promoting': True, 'redeploy_on_promotion': True, 'rolling_deploy': None, 'rolling_deploy_config': None}}\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/UpdateAutoscalingSettingsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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    json={}\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}/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 an inactive deployment associated with an environment and returns the activation status.",
                "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 and returns the deactivation status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeactivateResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/promote": {
            "post": {
                "summary": "Promotes a deployment to an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/promote \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"scale_down_previous_deployment\": true,\n  \"deployment_id\": null,\n  \"preserve_env_instance_type\": true\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/promote\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'scale_down_previous_deployment': True, 'deployment_id': None, 'preserve_env_instance_type': True}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Promotes an existing deployment to an environment and returns the promoted deployment.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PromoteToEnvironmentRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeploymentV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/cancel_promotion": {
            "post": {
                "summary": "Cancels a promotion to an environment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/cancel_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/cancel_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Cancels an ongoing promotion to an environment and returns the cancellation status.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CancelPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/pause_promotion": {
            "post": {
                "summary": "Pauses a rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/pause_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/pause_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Pauses an in-progress rolling promotion after the current step completes. No further scaling changes are made until resumed.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/resume_promotion": {
            "post": {
                "summary": "Resumes a paused rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/resume_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/resume_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Resumes a paused rolling promotion, continuing from where it was paused.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/force_cancel_promotion": {
            "post": {
                "summary": "Force cancels a rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_cancel_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_cancel_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Immediately cancels an in-progress rolling promotion and triggers rollback to the previous version.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/models/{model_id}/environments/{env_name}/force_roll_forward_promotion": {
            "post": {
                "summary": "Force rolls forward a rolling promotion",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_roll_forward_promotion \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/force_roll_forward_promotion\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Immediately completes the rolling promotion, shifting all traffic to the new version. This works even if the promotion is in the process of rolling back.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignalPromotionResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                },
                {
                    "$ref": "#/components/parameters/env_name"
                }
            ]
        },
        "/v1/chains": {
            "get": {
                "summary": "Gets all chains",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainsV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}": {
            "delete": {
                "summary": "Deletes a chain by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/chains/{chain_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/chain_id"
                }
            ],
            "get": {
                "summary": "Gets a chain by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/chains/{chain_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/chains/{chain_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChainV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/chains/{chain_id}/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    json={}\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": "Get 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": "Create 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": "Create 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": "Get 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": "Update 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": "Update 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": "Update 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": "Update 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": "Upsert a training project in a specific team.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/training_projects \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"training_project\": {\n    \"name\": \"My Training Project\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/training_projects\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'training_project': {'name': 'My Training Project'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Upserts a training project with the specified metadata for a team.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpsertTrainingProjectRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpsertTrainingProjectResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/training_projects": {
            "get": {
                "summary": "List training projects.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List all training projects for the organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListTrainingProjectsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Upsert a training project.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"training_project\": {\n    \"name\": \"My Training Project\"\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'training_project': {'name': 'My Training Project'}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Upserts a training project with the specified metadata.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpsertTrainingProjectRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UpsertTrainingProjectResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_projects/{training_project_id}/jobs": {
            "get": {
                "summary": "List training jobs.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List all training jobs for the training project.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListTrainingJobsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                }
            ],
            "post": {
                "summary": "Create a training job.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"training_job\": {\n    \"image\": {\n      \"base_image\": \"hello-world\",\n      \"docker_auth\": null\n    },\n    \"compute\": {\n      \"node_count\": 1,\n      \"cpu_count\": 1,\n      \"memory\": \"2Gi\",\n      \"accelerator\": {\n        \"accelerator\": \"H100\",\n        \"count\": 2\n      },\n      \"availability_model\": \"spot\"\n    },\n    \"runtime\": {\n      \"start_commands\": [\n        \"python main.py\"\n      ],\n      \"environment_variables\": {\n        \"API_KEY\": \"your_api_key_here\",\n        \"PATH\": \"/usr/bin\"\n      },\n      \"enable_cache\": true,\n      \"cache_config\": {\n        \"enable_legacy_hf_mount\": true,\n        \"enabled\": true,\n        \"mount_base_path\": \"/root/.cache\",\n        \"require_cache_affinity\": true\n      },\n      \"checkpointing_config\": {\n        \"enabled\": true,\n        \"checkpoint_path\": \"/mnt/ckpts\",\n        \"volume_size_gib\": 10\n      },\n      \"load_checkpoint_config\": null\n    },\n    \"name\": \"gpt-oss-job\",\n    \"truss_user_env\": null,\n    \"interactive_session\": null,\n    \"weights\": [\n      {\n        \"allow_patterns\": null,\n        \"auth\": null,\n        \"auth_secret_name\": null,\n        \"ignore_patterns\": null,\n        \"mount_location\": \"/app/models/base\",\n        \"source\": \"hf://meta-llama/Llama-3-8B@main\"\n      }\n    ],\n    \"enable_baseten_workdir\": false,\n    \"priority\": 0\n  }\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'training_job': {'image': {'base_image': 'hello-world', 'docker_auth': None}, 'compute': {'node_count': 1, 'cpu_count': 1, 'memory': '2Gi', 'accelerator': {'accelerator': 'H100', 'count': 2}, 'availability_model': 'spot'}, 'runtime': {'start_commands': ['python main.py'], 'environment_variables': {'API_KEY': 'your_api_key_here', 'PATH': '/usr/bin'}, 'enable_cache': True, 'cache_config': {'enable_legacy_hf_mount': True, 'enabled': True, 'mount_base_path': '/root/.cache', 'require_cache_affinity': True}, 'checkpointing_config': {'enabled': True, 'checkpoint_path': '/mnt/ckpts', 'volume_size_gib': 10}, 'load_checkpoint_config': None}, 'name': 'gpt-oss-job', 'truss_user_env': None, 'interactive_session': None, 'weights': [{'allow_patterns': None, 'auth': None, 'auth_secret_name': None, 'ignore_patterns': None, 'mount_location': '/app/models/base', 'source': 'hf://meta-llama/Llama-3-8B@main'}], 'enable_baseten_workdir': False, 'priority': 0}}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a training job with the specified configuration.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateTrainingJobRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}": {
            "delete": {
                "summary": "Delete 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": "Get 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": "Get the details of an existing training job.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Update 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}'"
                    },
                    {
                        "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}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Update mutable fields on a training job. Currently supports changing the queue priority of a PENDING job; higher priorities are dequeued first.",
                "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": "Get the uploaded training job as a S3 Artifact",
                "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": "Get the uploaded training job as a S3 Artifact",
                "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": "Recreate 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": "Create 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": "Get 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Get 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": "Get 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": "Get 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Get 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": "Get 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": "Stop 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": "Get 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": "Get the checkpoints for a training job.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingJobCheckpointsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/training_project_id"
                },
                {
                    "$ref": "#/components/parameters/training_job_id"
                }
            ]
        },
        "/v1/training_projects/{training_project_id}/jobs/{training_job_id}/checkpoint_files": {
            "get": {
                "summary": "Get 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Get 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": "Get 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": "Get 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": "Patch 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": "Update 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": "Sign 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": "Get 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": "Get 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": "Delete 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": "Get 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": "Get the details of an existing training project.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingProjectResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training_jobs/search": {
            "post": {
                "summary": "Search training jobs.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_jobs/search \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"project_id\": \"n4q95w5\",\n  \"job_id\": \"p7qr9qv\",\n  \"statuses\": [\n    \"TRAINING_JOB_RUNNING\",\n    \"TRAINING_JOB_COMPLETED\"\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training_jobs/search\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'project_id': 'n4q95w5', 'job_id': 'p7qr9qv', 'statuses': ['TRAINING_JOB_RUNNING', 'TRAINING_JOB_COMPLETED']}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Search training jobs for the organization.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SearchTrainingJobsRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SearchTrainingJobsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/capabilities": {
            "get": {
                "summary": "Get 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns the list of models supported by the Loops server, including each model's maximum context length.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsCapabilitiesResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/sessions": {
            "post": {
                "summary": "Create 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": "Get 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": "Fetch 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": "List 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List Loops runs visible to the requesting user, optionally filtered by run id and/or base model.",
                "parameters": [
                    {
                        "name": "run_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by run ID.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "k4q95w5"
                            ],
                            "title": "Run Id"
                        }
                    },
                    {
                        "name": "base_model",
                        "in": "query",
                        "required": false,
                        "description": "Filter runs by base model name.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "examples": [
                                "Qwen/Qwen3-8B"
                            ],
                            "title": "Base Model"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsRunsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Create 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  \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n  \"reuse_from_session_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/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, 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_session_id': 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}": {
            "get": {
                "summary": "Get 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": "Fetch a Loops run by ID.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLoopsRunResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/run_id"
                }
            ]
        },
        "/v1/loops/samplers": {
            "get": {
                "summary": "List 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List Loops samplers visible to the requesting user.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsSamplersResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Create 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  \"session_id\": null,\n  \"base_model\": null,\n  \"max_seq_length\": null,\n  \"model_path\": \"bt://loops:k4q95w5/sampler_weights/step-100\",\n  \"reuse_from_session_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/samplers\"\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, 'max_seq_length': None, 'model_path': 'bt://loops:k4q95w5/sampler_weights/step-100', 'reuse_from_session_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a standalone Loops sampler not linked to a run.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLoopsSamplerRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CreateLoopsSamplerResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/samplers/{sampler_id}": {
            "get": {
                "summary": "Get 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": "Fetch 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": "List 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List 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": "Validate a Loops checkpoint bt:// URI.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/checkpoints/validate \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"checkpoint_path\": \"bt://loops:k4q95w5/sampler_weights/step-100\"\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/validate\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'checkpoint_path': 'bt://loops:k4q95w5/sampler_weights/step-100'}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "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/{checkpoint_id}/files": {
            "get": {
                "summary": "Get 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Get presigned URLs for the files under a Loops checkpoint. Returns a paginated list.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LoopsCheckpointFilesResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/checkpoint_id"
                }
            ]
        },
        "/v1/loops/deployments": {
            "get": {
                "summary": "List 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List 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.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListLoopsDeploymentsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/loops/deployments/{deployment_id}/deactivate": {
            "post": {
                "summary": "Deactivate 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": "Shut down a Loops deployment by ID. Saved checkpoints remain accessible. Resolving base_model -> deployment_id is the caller's responsibility \u2014 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": "Get 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": "Fetch 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}/metrics": {
            "post": {
                "summary": "Get 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": "Get 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetch logs from the trainer pods of a Loops deployment. Visible to any member of the deployment's team.",
                "parameters": [
                    {
                        "name": "start_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Start Epoch Millis"
                        }
                    },
                    {
                        "name": "end_epoch_millis",
                        "in": "query",
                        "required": false,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "End Epoch Millis"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "required": false,
                        "description": "Sort order for logs",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/SortOrderV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Limit of logs to fetch in a single request",
                        "schema": {
                            "anyOf": [
                                {
                                    "maximum": 1000,
                                    "minimum": 1,
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": 500,
                            "title": "Limit"
                        }
                    },
                    {
                        "name": "min_level",
                        "in": "query",
                        "required": false,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level.",
                        "schema": {
                            "anyOf": [
                                {
                                    "$ref": "#/components/schemas/LogLevelV1"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetLogsResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/deployment_id"
                }
            ]
        },
        "/v1/training/capacity": {
            "get": {
                "summary": "Get training GPU capacity.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/training/capacity \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training/capacity\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns GPU capacity limits (baseline and peak) and current usage for the organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetTrainingGpuCapacityResponseV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Set a team's training GPU capacity.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/training/capacity \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"team_id\": null,\n  \"gpu_type\": null,\n  \"max_gpus\": 8\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/training/capacity\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"PATCH\",\n    url,\n    headers=headers,\n    json={'team_id': None, 'gpu_type': None, 'max_gpus': 8}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Sets the max concurrent GPUs of a given type a team may use. Creates the limit if one doesn't exist for this (team, gpu_type) pair, otherwise updates it in place. Org-admin only: this is a ceiling the org imposes on the team, not something the team manages for itself.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PatchTeamTrainingGpuCapacityRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PatchTeamTrainingGpuCapacityResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/training/jobs/{training_job_id}/queue_context": {
            "get": {
                "summary": "Reconstruct 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 \u2014 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": "Get 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": "Get 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 the user's 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "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/snapshots": {
            "get": {
                "summary": "Get the latest model weight snapshot",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis/snapshots \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "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/snapshots\"\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 most recent model weight snapshot for the specified model.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelWeightSnapshotV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Create a model weight snapshot",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/model_apis/snapshots \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"model\": null,\n  \"snapshot_uri\": 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/model_apis/snapshots\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'model': None, 'snapshot_uri': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a model weight snapshot for the specified model and returns the snapshot.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateModelWeightSnapshotRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelWeightSnapshotV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/model_apis/snapshots/{model_id}": {
            "get": {
                "summary": "Get the latest model weight snapshot",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis/snapshots/{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/model_apis/snapshots/{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)"
                    }
                ],
                "description": "Gets the most recent model weight snapshot for the specified model.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelWeightSnapshotV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ],
            "post": {
                "summary": "Create a model weight snapshot",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/model_apis/snapshots/{model_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"model\": null,\n  \"snapshot_uri\": 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/model_apis/snapshots/{model_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'model': None, 'snapshot_uri': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a model weight snapshot for the specified model and returns the snapshot.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateModelWeightSnapshotRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelWeightSnapshotV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/model_apis": {
            "get": {
                "summary": "List 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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "List Model APIs visible to the caller. By default returns the full catalog; pass `added_only=true` to restrict to Model APIs the workspace has added.",
                "parameters": [
                    {
                        "name": "cursor",
                        "in": "query",
                        "required": false,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ],
                            "default": null,
                            "title": "Cursor"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Maximum number of items to return.",
                        "schema": {
                            "default": 100,
                            "maximum": 1000,
                            "minimum": 1,
                            "title": "Limit",
                            "type": "integer"
                        }
                    },
                    {
                        "name": "added_only",
                        "in": "query",
                        "required": false,
                        "description": "When true, restrict the result to Model APIs the workspace has added. Defaults to the full visible catalog.",
                        "schema": {
                            "default": false,
                            "title": "Added Only",
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelAPIsResponseV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/model_apis/{model_api_name}": {
            "get": {
                "summary": "Get a Model API.",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/model_apis/{model_api_name} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/model_apis/{model_api_name}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Fetch a Model API by name, with workspace overlay when added.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelAPIV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_api_name"
                }
            ]
        },
        "/v1/llm_models": {
            "post": {
                "summary": "Creates a new BIS LLM deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/llm_models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"resources\": null,\n  \"llm_version\": null,\n  \"model_metadata\": null,\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 600,\n    \"concurrency_target\": null,\n    \"max_replica\": 5,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 300,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"additional_autoscaling_config\": {\n    \"metrics\": [\n      {\n        \"name\": \"in_flight_tokens\",\n        \"target\": 40000\n      }\n    ]\n  },\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"git_sha\": \"abc123\"\n  },\n  \"weights\": [\n    {\n      \"mount_location\": \"/models/base\",\n      \"source\": \"hf://meta-llama/Llama-3-8B\"\n    }\n  ],\n  \"name\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/llm_models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'resources': None, 'llm_version': None, 'model_metadata': None, 'autoscaling_settings': {'autoscaling_window': 600, 'concurrency_target': None, 'max_replica': 5, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 300, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'additional_autoscaling_config': {'metrics': [{'name': 'in_flight_tokens', 'target': 40000}]}, 'metadata': {'environment': 'production', 'git_sha': 'abc123'}, 'weights': [{'mount_location': '/models/base', 'source': 'hf://meta-llama/Llama-3-8B'}], 'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLLMModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LLMModelHandleV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/teams/{team_id}/llm_models": {
            "post": {
                "summary": "Creates a new BIS LLM deployment",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/llm_models \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"resources\": null,\n  \"llm_version\": null,\n  \"model_metadata\": null,\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 600,\n    \"concurrency_target\": null,\n    \"max_replica\": 5,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 300,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"additional_autoscaling_config\": {\n    \"metrics\": [\n      {\n        \"name\": \"in_flight_tokens\",\n        \"target\": 40000\n      }\n    ]\n  },\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"git_sha\": \"abc123\"\n  },\n  \"weights\": [\n    {\n      \"mount_location\": \"/models/base\",\n      \"source\": \"hf://meta-llama/Llama-3-8B\"\n    }\n  ],\n  \"name\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/llm_models\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'resources': None, 'llm_version': None, 'model_metadata': None, 'autoscaling_settings': {'autoscaling_window': 600, 'concurrency_target': None, 'max_replica': 5, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 300, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'additional_autoscaling_config': {'metrics': [{'name': 'in_flight_tokens', 'target': 40000}]}, 'metadata': {'environment': 'production', 'git_sha': 'abc123'}, 'weights': [{'mount_location': '/models/base', 'source': 'hf://meta-llama/Llama-3-8B'}], 'name': None}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLLMModelRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LLMModelHandleV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/team_id"
                }
            ]
        },
        "/v1/llm_models/{model_id}/deployments": {
            "post": {
                "summary": "Creates a new BIS LLM deployment version",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/llm_models/{model_id}/deployments \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"resources\": null,\n  \"llm_version\": null,\n  \"model_metadata\": null,\n  \"autoscaling_settings\": {\n    \"autoscaling_window\": 600,\n    \"concurrency_target\": null,\n    \"max_replica\": 5,\n    \"max_scale_down_rate\": null,\n    \"min_replica\": 1,\n    \"scale_down_delay\": 300,\n    \"target_in_flight_tokens\": null,\n    \"target_utilization_percentage\": null\n  },\n  \"additional_autoscaling_config\": {\n    \"metrics\": [\n      {\n        \"name\": \"in_flight_tokens\",\n        \"target\": 40000\n      }\n    ]\n  },\n  \"metadata\": {\n    \"environment\": \"production\",\n    \"git_sha\": \"abc123\"\n  },\n  \"weights\": [\n    {\n      \"mount_location\": \"/models/base\",\n      \"source\": \"hf://meta-llama/Llama-3-8B\"\n    }\n  ]\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/llm_models/{model_id}/deployments\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'resources': None, 'llm_version': None, 'model_metadata': None, 'autoscaling_settings': {'autoscaling_window': 600, 'concurrency_target': None, 'max_replica': 5, 'max_scale_down_rate': None, 'min_replica': 1, 'scale_down_delay': 300, 'target_in_flight_tokens': None, 'target_utilization_percentage': None}, 'additional_autoscaling_config': {'metrics': [{'name': 'in_flight_tokens', 'target': 40000}]}, 'metadata': {'environment': 'production', 'git_sha': 'abc123'}, 'weights': [{'mount_location': '/models/base', 'source': 'hf://meta-llama/Llama-3-8B'}]}\n)\n\nprint(response.text)"
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLLMModelVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LLMModelHandleV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/model_id"
                }
            ]
        },
        "/v1/library_listings": {
            "get": {
                "summary": "Gets all library listings",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/library_listings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns all library listings for the authenticated user's organization.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingsV1"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "Creates a new library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request POST \\\n--url https://api.baseten.co/v1/library_listings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"display_name\": null,\n  \"user_defined_id\": null\n}'"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"POST\",\n    url,\n    headers=headers,\n    json={'display_name': None, 'user_defined_id': None}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Creates a new library listing for the authenticated user's organization.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateLibraryListingRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/library_listings/{user_defined_listing_id}": {
            "delete": {
                "summary": "Deletes a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"DELETE\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Deletes a library listing and all of its associated versions. Any versions that are currently live will also be removed.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingTombstoneV1"
                                }
                            }
                        }
                    }
                }
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_defined_listing_id"
                }
            ],
            "get": {
                "summary": "Gets a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/library_listings/{user_defined_listing_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns a specific library listing by its user-defined identifier.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingV1"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "summary": "Updates a library listing",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/library_listings/{user_defined_listing_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n  \"display_name\": null,\n  \"is_public\": null\n}'"
                    },
                    {
                        "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}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates the display name of a library listing.",
                "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 \u2014 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}'"
                    },
                    {
                        "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}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Updates a library listing version. Setting is_live to true will demote the current live version.",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateLibraryListingVersionRequestV1"
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LibraryListingVersionV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/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    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns billing usage data within the specified date range. Includes dedicated model serving, training, and model APIs usage. The date range must not exceed 31 days.",
                "parameters": [
                    {
                        "name": "start_date",
                        "in": "query",
                        "required": true,
                        "description": "Start date (ISO 8601, UTC). Earliest queryable: 2026-01-01.",
                        "schema": {
                            "format": "date-time",
                            "title": "Start Date",
                            "type": "string"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "required": true,
                        "description": "End date in ISO 8601 format (UTC). Date range cannot exceed 31 days.",
                        "schema": {
                            "format": "date-time",
                            "title": "End Date",
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UsageSummaryV1"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/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    json={}\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"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UsersResponseV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/users/me": {
            "get": {
                "summary": "Gets the authenticated user",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users/me \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/users/me\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns info about the user making the request.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserInfoV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            }
        },
        "/v1/users/{user_id}": {
            "get": {
                "summary": "Gets a user by ID",
                "x-codeSamples": [
                    {
                        "lang": "bash",
                        "source": "curl --request GET \\\n--url https://api.baseten.co/v1/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n"
                    },
                    {
                        "lang": "python",
                        "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"<YOUR_API_KEY>\")\nurl = \"https://api.baseten.co/v1/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n    \"GET\",\n    url,\n    headers=headers,\n    json={}\n)\n\nprint(response.text)"
                    }
                ],
                "description": "Returns info about a user in the caller's workspace.",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserInfoV1"
                                }
                            }
                        }
                    }
                },
                "x-stability": "unstable"
            },
            "parameters": [
                {
                    "$ref": "#/components/parameters/user_id"
                }
            ]
        },
        "/v1/gateway/endpoints": {
            "get": {
                "summary": "List 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": "Create 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  \"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', '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": "Delete 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": "Get 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": "Update 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": "List 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": "Create 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\": null,\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': None, '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": "Get 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": "Update 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": "List 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": "Create 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": "Register 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 provided value, 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": "Get 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"
                }
            ]
        }
    },
    "openapi": "3.1.0",
    "components": {
        "schemas": {
            "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"
            },
            "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"
            },
            "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"
            },
            "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"
                    },
                    "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"
                    }
                },
                "title": "PatchLoopsUserConfigRequestV1",
                "type": "object"
            },
            "PatchLoopsUserConfigResponseV1": {
                "description": "Response for ``PATCH /v1/loops/user_config``.",
                "properties": {
                    "user_config": {
                        "$ref": "#/components/schemas/LoopsUserConfigV1",
                        "description": "The updated Loops user config."
                    }
                },
                "required": [
                    "user_config"
                ],
                "title": "PatchLoopsUserConfigResponseV1",
                "type": "object"
            },
            "InstanceTypeWithPriceV1": {
                "properties": {
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type properties."
                    },
                    "price": {
                        "description": "Usage price in USD / minute.",
                        "title": "Price",
                        "type": "number"
                    }
                },
                "required": [
                    "instance_type",
                    "price"
                ],
                "title": "InstanceTypeWithPriceV1",
                "type": "object"
            },
            "InstanceTypePricesV1": {
                "description": "A list of instance types.",
                "properties": {
                    "instance_types": {
                        "items": {
                            "$ref": "#/components/schemas/InstanceTypeWithPriceV1"
                        },
                        "title": "Instance Types",
                        "type": "array"
                    }
                },
                "required": [
                    "instance_types"
                ],
                "title": "InstanceTypePricesV1",
                "type": "object"
            },
            "DeploymentArchivePayloadV1": {
                "description": "Deployment-level fields for a model-archive push.\n\nShared by every endpoint that creates a deployment from an uploaded archive:\n`POST /v1/prepare_model_upload`, the `model_archive` source on `POST\n/v1/models`, and `POST /v1/models/{model_id}/deployments`.",
                "properties": {
                    "config": {
                        "additionalProperties": true,
                        "description": "Parsed model config as a JSON object.",
                        "title": "Config",
                        "type": "object"
                    },
                    "raw_config": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Original config.yaml text, persisted as-is on the deployment. Best-effort: invalid raw configs are logged and dropped without failing the request.",
                        "title": "Raw Config"
                    },
                    "user_env": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Client environment metadata (e.g. client version, Python version). Validated server-side.",
                        "title": "User Env"
                    },
                    "environment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Stable environment to push to (e.g. `production`). If unset, the deployment is created without environment selection. Caller must have push permission for the named environment.",
                        "title": "Environment Name"
                    },
                    "preserve_env_instance_type": {
                        "default": true,
                        "description": "Retain the target environment's current instance type rather than the one in `config`. Only meaningful when `environment_name` is set and that environment already exists.",
                        "title": "Preserve Env Instance Type",
                        "type": "boolean"
                    },
                    "deploy_timeout_minutes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Deploy timeout in minutes; allowed range 10 to 1440. Server default applies if unset.",
                        "title": "Deploy Timeout Minutes"
                    },
                    "deployment_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional human-readable name for the deployment.",
                        "title": "Deployment Name"
                    },
                    "labels": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-provided key-value labels for the deployment.",
                        "title": "Labels"
                    },
                    "is_development": {
                        "default": false,
                        "description": "If true, push as a development deployment: the model's single mutable dev slot, created if absent and overwritten in place otherwise. The following fields must be left at their defaults: `environment_name`, `preserve_env_instance_type`, `deployment_name`.",
                        "title": "Is Development",
                        "type": "boolean"
                    }
                },
                "required": [
                    "config"
                ],
                "title": "DeploymentArchivePayloadV1",
                "type": "object"
            },
            "PrepareModelUploadRequestV1": {
                "description": "Body for `POST /v1/prepare_model_upload`.\n\nValidates the same payload the commit endpoint will validate, and on\n`dry_run=false` issues STS upload credentials. Exactly one of `name` or\n`model_id` is required: `name` validates the new-model path (`POST\n/v1/models`); `model_id` validates the add-deployment path (`POST\n/v1/models/{model_id}/deployments`).",
                "properties": {
                    "deployment": {
                        "$ref": "#/components/schemas/DeploymentArchivePayloadV1",
                        "description": "Deployment-level payload, identical to the payload sent at commit."
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Set to validate a new-model push. Exactly one of `name` or `model_id` is required.",
                        "title": "Name"
                    },
                    "team_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team the new model will belong to. Only valid when `name` is set; defaults to the organization's default team when omitted. Must not be set when `model_id` is set (the existing model already has a team).",
                        "title": "Team Id"
                    },
                    "model_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Set to validate an add-deployment push to an existing model. Exactly one of `name` or `model_id` is required.",
                        "title": "Model Id"
                    },
                    "dry_run": {
                        "default": false,
                        "description": "If true, validate the payload only and do not issue upload credentials. The response sets `creds`, `s3_bucket`, and `s3_key` to `null`.",
                        "title": "Dry Run",
                        "type": "boolean"
                    }
                },
                "required": [
                    "deployment"
                ],
                "title": "PrepareModelUploadRequestV1",
                "type": "object"
            },
            "AWSCredentialsV1": {
                "description": "AWS credentials",
                "properties": {
                    "aws_access_key_id": {
                        "description": "The AWS access key ID",
                        "title": "Aws Access Key Id",
                        "type": "string"
                    },
                    "aws_secret_access_key": {
                        "description": "The AWS secret access key",
                        "title": "Aws Secret Access Key",
                        "type": "string"
                    },
                    "aws_session_token": {
                        "description": "The AWS session token",
                        "title": "Aws Session Token",
                        "type": "string"
                    }
                },
                "required": [
                    "aws_access_key_id",
                    "aws_secret_access_key",
                    "aws_session_token"
                ],
                "title": "AWSCredentialsV1",
                "type": "object"
            },
            "PrepareModelUploadResponseV1": {
                "description": "Response from `POST /v1/prepare_model_upload`.\n\nOn success with `dry_run=false`, returns STS upload credentials. On success\nwith `dry_run=true`, `creds`, `s3_bucket`, and `s3_key` are `null` and only\nvalidation has run.",
                "properties": {
                    "creds": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AWSCredentialsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "STS credentials to upload the model archive."
                    },
                    "s3_bucket": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "S3 bucket the credentials are scoped to.",
                        "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.",
                        "title": "S3 Key"
                    },
                    "s3_region": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "AWS region the S3 bucket resides in.",
                        "title": "S3 Region"
                    }
                },
                "title": "PrepareModelUploadResponseV1",
                "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"
            },
            "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": {
                        "description": "S3 key of the uploaded archive, from the credentials returned by `POST /v1/prepare_model_upload`.",
                        "title": "S3 Key",
                        "type": "string"
                    },
                    "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",
                    "s3_key"
                ],
                "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"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "name",
                    "model_id",
                    "is_production",
                    "is_development",
                    "status",
                    "active_replica_count",
                    "autoscaling_settings",
                    "instance_type_name",
                    "environment"
                ],
                "title": "DeploymentV1",
                "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"
            },
            "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"
            },
            "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": {
                        "description": "S3 key of the uploaded archive, from the credentials returned by `POST /v1/prepare_model_upload`.",
                        "title": "S3 Key",
                        "type": "string"
                    }
                },
                "required": [
                    "deployment",
                    "s3_key"
                ],
                "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"
            },
            "UpdateAutoscalingSettingsV1": {
                "additionalProperties": false,
                "description": "A request to update autoscaling settings for a deployment. All fields are optional, and we only update ones passed in.",
                "properties": {
                    "min_replica": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum number of replicas",
                        "examples": [
                            0
                        ],
                        "title": "Min Replica"
                    },
                    "max_replica": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum number of replicas",
                        "examples": [
                            7
                        ],
                        "title": "Max Replica"
                    },
                    "autoscaling_window": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Timeframe of traffic considered for autoscaling decisions",
                        "examples": [
                            600
                        ],
                        "title": "Autoscaling Window"
                    },
                    "scale_down_delay": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Waiting period before scaling down any active replica",
                        "examples": [
                            120
                        ],
                        "title": "Scale Down Delay"
                    },
                    "concurrency_target": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Number of requests per replica before scaling up",
                        "examples": [
                            2
                        ],
                        "title": "Concurrency Target"
                    },
                    "target_utilization_percentage": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target utilization percentage for scaling up/down.",
                        "examples": [
                            70
                        ],
                        "title": "Target Utilization Percentage"
                    },
                    "target_in_flight_tokens": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target number of in-flight tokens for autoscaling decisions. Early access only.",
                        "examples": [
                            40000
                        ],
                        "title": "Target In Flight Tokens"
                    },
                    "max_scale_down_rate": {
                        "anyOf": [
                            {
                                "maximum": 50,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Maximum percentage of replicas that can be removed per autoscaling window (1\u201350). E.g. 20 means at most 20% of replicas are removed per window.",
                        "examples": [
                            20
                        ],
                        "title": "Max Scale Down Rate"
                    }
                },
                "title": "UpdateAutoscalingSettingsV1",
                "type": "object"
            },
            "UpdateAutoscalingSettingsStatusV1": {
                "description": "The status of a request to update autoscaling settings.",
                "enum": [
                    "ACCEPTED",
                    "QUEUED",
                    "UNCHANGED"
                ],
                "title": "UpdateAutoscalingSettingsStatusV1",
                "type": "string"
            },
            "UpdateAutoscalingSettingsResponseV1": {
                "description": "The response to a request to update autoscaling settings.",
                "properties": {
                    "status": {
                        "$ref": "#/components/schemas/UpdateAutoscalingSettingsStatusV1",
                        "description": "Status of the request to update autoscaling settings"
                    },
                    "message": {
                        "description": "A message describing the status of the request to update autoscaling settings",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "status",
                    "message"
                ],
                "title": "UpdateAutoscalingSettingsResponseV1",
                "type": "object"
            },
            "PromoteRequestV1": {
                "description": "A request to promote a deployment to production.",
                "properties": {
                    "scale_down_previous_production": {
                        "default": true,
                        "description": "Whether to scale down the previous production deployment after promoting",
                        "examples": [
                            true
                        ],
                        "title": "Scale Down Previous Production",
                        "type": "boolean"
                    },
                    "preserve_env_instance_type": {
                        "default": true,
                        "description": "Whether to use the promoting deployment's instance type or preserve target environment's instance type",
                        "examples": [
                            true
                        ],
                        "title": "Preserve Env Instance Type",
                        "type": "boolean"
                    }
                },
                "title": "PromoteRequestV1",
                "type": "object"
            },
            "ActivateResponseV1": {
                "description": "The response to a request to activate a deployment.",
                "properties": {
                    "success": {
                        "default": true,
                        "description": "Whether the deployment was successfully activated",
                        "title": "Success",
                        "type": "boolean"
                    }
                },
                "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"
                    }
                },
                "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 \u2014 not available for deployments created before 2026-04-30. 'parsed': dict with server-side defaults applied \u2014 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.",
                        "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"
            },
            "DeploymentMetricDescriptorV1": {
                "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/DeploymentMetricUnitHintV1",
                        "description": "Advisory unit of the metric's values."
                    },
                    "kind": {
                        "$ref": "#/components/schemas/DeploymentMetricKindV1",
                        "description": "Semantic hint for how the metric behaves (GAUGE, COUNTER, HISTOGRAM)."
                    },
                    "label_sets": {
                        "description": "The metric's series, in order. Each entry is the set of labels identifying one series; the value at the same index in each value set's ``values`` is that series' value. A plain metric has a single entry with no labels (`{}`). A histogram has one entry per quantile plus an average, e.g. {'quantile': '0.5'} \u2026 {'quantile': '0.99'}, {'stat': 'avg'}. A by-status metric has one entry per status, e.g. {'status': '2xx'}.",
                        "items": {
                            "additionalProperties": {
                                "type": "string"
                            },
                            "type": "object"
                        },
                        "title": "Label Sets",
                        "type": "array"
                    }
                },
                "required": [
                    "name",
                    "unit_hint",
                    "kind",
                    "label_sets"
                ],
                "title": "DeploymentMetricDescriptorV1",
                "type": "object"
            },
            "DeploymentMetricKindV1": {
                "description": "Semantic hint for how a metric behaves, to aid client rendering and\naggregation. It does not describe the value's shape \u2014 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": "DeploymentMetricKindV1",
                "type": "string"
            },
            "DeploymentMetricModeV1": {
                "description": "How metric values are aggregated over the request.",
                "enum": [
                    "CURRENT",
                    "SUMMARY",
                    "SERIES"
                ],
                "title": "DeploymentMetricModeV1",
                "type": "string"
            },
            "DeploymentMetricUnitHintV1": {
                "description": "Advisory unit of a metric's values. Values are reported as scraped, so the\nhint describes the raw value (e.g. GPU memory is reported in mebibytes).\n\n- ``PER_SECOND``: a rate per second.\n- ``SECONDS``: a duration in seconds.\n- ``BYTES``: a size in bytes.\n- ``MEBIBYTES``: a size in mebibytes (MiB).\n- ``COUNT``: a dimensionless tally of discrete things.\n- ``RATIO``: a dimensionless ratio. Usually in ``[0, 1]`` but may exceed 1\n  (e.g. CPU usage in cores = cpu-seconds/second).",
                "enum": [
                    "PER_SECOND",
                    "SECONDS",
                    "BYTES",
                    "MEBIBYTES",
                    "COUNT",
                    "RATIO"
                ],
                "title": "DeploymentMetricUnitHintV1",
                "type": "string"
            },
            "DeploymentMetricValueSetV1": {
                "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": "DeploymentMetricValueSetV1",
                "type": "object"
            },
            "GetDeploymentMetricsResponseV1": {
                "description": "Deployment metrics over a time window, index-mapped: metric descriptors\nappear once in ``metric_descriptors``; each value set's ``values`` are aligned\nto 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/DeploymentMetricModeV1",
                        "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/DeploymentMetricDescriptorV1"
                        },
                        "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/DeploymentMetricValueSetV1"
                        },
                        "title": "Metric Values",
                        "type": "array"
                    }
                },
                "required": [
                    "start_epoch_millis",
                    "end_epoch_millis",
                    "mode",
                    "step_seconds",
                    "metric_descriptors",
                    "metric_values"
                ],
                "title": "GetDeploymentMetricsResponseV1",
                "type": "object"
            },
            "GetDeploymentMetricsRequestV1": {
                "description": "Query params for ``GET /v1/models/.../deployments/.../metrics``.",
                "properties": {
                    "mode": {
                        "$ref": "#/components/schemas/DeploymentMetricModeV1",
                        "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 to the deployment are omitted from the response.",
                        "items": {
                            "type": "string"
                        },
                        "title": "Metrics",
                        "type": "array"
                    }
                },
                "title": "GetDeploymentMetricsRequestV1",
                "type": "object"
            },
            "TerminateReplicaResponseV1": {
                "description": "The response to a request to terminate a replica in a deployment.",
                "properties": {
                    "success": {
                        "default": true,
                        "description": "Whether the replica was successfully terminated",
                        "title": "Success",
                        "type": "boolean"
                    }
                },
                "title": "TerminateReplicaResponseV1",
                "type": "object"
            },
            "SignSSHCertificateRequestV1": {
                "description": "Request to sign an SSH certificate for accessing a workload pod.",
                "properties": {
                    "public_key": {
                        "description": "The user's SSH public key (e.g., 'ssh-ed25519 AAAA... user@host').",
                        "title": "Public Key",
                        "type": "string"
                    },
                    "replica_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The replica to connect to. Required for training jobs (e.g. '0'). Optional for inference (server picks a running replica if omitted).",
                        "title": "Replica Id"
                    }
                },
                "required": [
                    "public_key"
                ],
                "title": "SignSSHCertificateRequestV1",
                "type": "object"
            },
            "SignSSHCertificateResponseV1": {
                "description": "Response containing a signed SSH certificate for proxy authentication.",
                "properties": {
                    "ssh_certificate": {
                        "description": "The signed SSH certificate in OpenSSH format.",
                        "title": "Ssh Certificate",
                        "type": "string"
                    },
                    "jwt": {
                        "description": "Signed JWT (ES256) for SSH proxy authorization.",
                        "title": "Jwt",
                        "type": "string"
                    },
                    "proxy_address": {
                        "description": "Address of the SSH proxy to connect to (host:port).",
                        "title": "Proxy Address",
                        "type": "string"
                    },
                    "ssh_cert_expires_at": {
                        "description": "When the certificate expires, in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Ssh Cert Expires At",
                        "type": "string"
                    }
                },
                "required": [
                    "ssh_certificate",
                    "jwt",
                    "proxy_address",
                    "ssh_cert_expires_at"
                ],
                "title": "SignSSHCertificateResponseV1",
                "type": "object"
            },
            "EnvironmentV1": {
                "description": "Environment for oracles.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "title": "Name",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the environment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "current_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Current deployment of the environment"
                    },
                    "candidate_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Candidate deployment being promoted to the environment, if a promotion is in progress"
                    },
                    "in_progress_promotion": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/InProgressPromotionV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Details of the in-progress promotion, if any"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/AutoscalingSettingsV1",
                        "description": "Autoscaling settings for the environment"
                    },
                    "promotion_settings": {
                        "$ref": "#/components/schemas/PromotionSettingsV1",
                        "description": "Promotion settings for the environment"
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type for the environment"
                    }
                },
                "required": [
                    "name",
                    "created_at",
                    "model_id",
                    "current_deployment",
                    "autoscaling_settings",
                    "promotion_settings",
                    "instance_type"
                ],
                "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"
            },
            "PromotionCleanupStrategyV1": {
                "description": "The promotion cleanup strategy.",
                "enum": [
                    "KEEP",
                    "SCALE_TO_ZERO",
                    "DEACTIVATE"
                ],
                "title": "PromotionCleanupStrategyV1",
                "type": "string"
            },
            "PromotionSettingsV1": {
                "description": "Promotion settings for promoting chains and oracles",
                "properties": {
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": false,
                        "description": "Whether to deploy on all promotions. Enabling this flag allows model code to safely handle environment-specific logic. When a deployment is promoted, a new deployment will be created with a copy of the image.",
                        "examples": [
                            true
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": false,
                        "description": "Whether the environment should rely on rolling deploy orchestration.",
                        "examples": [
                            true
                        ],
                        "title": "Rolling Deploy"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PromotionCleanupStrategyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": "SCALE_TO_ZERO",
                        "description": "The cleanup strategy to use after a promotion completes.",
                        "examples": [
                            "SCALE_TO_ZERO"
                        ]
                    },
                    "rolling_deploy_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RollingDeployConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Rolling deploy configuration for promotions"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": false,
                        "description": "Whether to ramp up traffic while promoting",
                        "examples": [
                            true
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 600,
                        "description": "Duration of the ramp up in seconds",
                        "examples": [
                            600
                        ],
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "title": "PromotionSettingsV1",
                "type": "object"
            },
            "RollingDeployConfigV1": {
                "description": "Rolling deploy config for promoting chains and oracles",
                "properties": {
                    "rolling_deploy_strategy": {
                        "$ref": "#/components/schemas/RollingDeployStrategyV1",
                        "default": "REPLICA",
                        "description": "The rolling deploy strategy to use for promotions.",
                        "examples": [
                            "REPLICA"
                        ]
                    },
                    "max_surge_percent": {
                        "default": 10,
                        "description": "The maximum surge percentage for rolling deploys.",
                        "examples": [
                            10
                        ],
                        "title": "Max Surge Percent",
                        "type": "integer"
                    },
                    "max_unavailable_percent": {
                        "default": 0,
                        "description": "The maximum unavailable percentage for rolling deploys.",
                        "examples": [
                            10
                        ],
                        "title": "Max Unavailable Percent",
                        "type": "integer"
                    },
                    "stabilization_time_seconds": {
                        "default": 0,
                        "description": "The stabilization time in seconds for rolling deploys.",
                        "examples": [
                            300
                        ],
                        "title": "Stabilization Time Seconds",
                        "type": "integer"
                    },
                    "replica_overhead_percent": {
                        "default": 0,
                        "description": "The replica overhead percentage for rolling deploys.",
                        "examples": [
                            0
                        ],
                        "title": "Replica Overhead Percent",
                        "type": "integer"
                    }
                },
                "title": "RollingDeployConfigV1",
                "type": "object"
            },
            "RollingDeployStrategyV1": {
                "description": "The rolling deploy strategy.",
                "enum": [
                    "REPLICA"
                ],
                "title": "RollingDeployStrategyV1",
                "type": "string"
            },
            "EnvironmentsV1": {
                "description": "list of environments",
                "properties": {
                    "environments": {
                        "items": {
                            "$ref": "#/components/schemas/EnvironmentV1"
                        },
                        "title": "Environments",
                        "type": "array"
                    }
                },
                "required": [
                    "environments"
                ],
                "title": "EnvironmentsV1",
                "type": "object"
            },
            "UpdatePromotionSettingsV1": {
                "description": "Promotion settings for model promotion",
                "properties": {
                    "redeploy_on_promotion": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether to deploy on all promotions. Enabling this flag allows model code to safely handle environment-specific logic. When a deployment is promoted, a new deployment will be created with a copy of the image.",
                        "examples": [
                            true
                        ],
                        "title": "Redeploy On Promotion"
                    },
                    "rolling_deploy": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether the environment should rely on rolling deploy orchestration.",
                        "examples": [
                            true
                        ],
                        "title": "Rolling Deploy"
                    },
                    "promotion_cleanup_strategy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/PromotionCleanupStrategyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The cleanup strategy to use after a promotion completes.",
                        "examples": [
                            "SCALE_TO_ZERO"
                        ]
                    },
                    "rolling_deploy_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateRollingDeployConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Rolling deploy configuration for promotions"
                    },
                    "ramp_up_while_promoting": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether to ramp up traffic while promoting",
                        "examples": [
                            true
                        ],
                        "title": "Ramp Up While Promoting"
                    },
                    "ramp_up_duration_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Duration of the ramp up in seconds",
                        "examples": [
                            600
                        ],
                        "title": "Ramp Up Duration Seconds"
                    }
                },
                "title": "UpdatePromotionSettingsV1",
                "type": "object"
            },
            "UpdateRollingDeployConfigV1": {
                "description": "Rolling deploy config for promoting chains and oracles",
                "properties": {
                    "rolling_deploy_strategy": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/RollingDeployStrategyV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The rolling deploy strategy to use for promotions.",
                        "examples": [
                            "REPLICA"
                        ]
                    },
                    "max_surge_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 10,
                        "description": "The maximum surge percentage for rolling deploys.",
                        "examples": [
                            10
                        ],
                        "title": "Max Surge Percent"
                    },
                    "max_unavailable_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The maximum unavailable percentage for rolling deploys.",
                        "examples": [
                            10
                        ],
                        "title": "Max Unavailable Percent"
                    },
                    "stabilization_time_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The stabilization time in seconds for rolling deploys.",
                        "examples": [
                            300
                        ],
                        "title": "Stabilization Time Seconds"
                    },
                    "replica_overhead_percent": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The replica overhead percentage for rolling deploys.",
                        "examples": [
                            0
                        ],
                        "title": "Replica Overhead Percent"
                    }
                },
                "title": "UpdateRollingDeployConfigV1",
                "type": "object"
            },
            "CreateEnvironmentRequestV1": {
                "description": "A request to create an environment.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "examples": [
                            "staging"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the environment",
                        "examples": [
                            {
                                "autoscaling_window": 800,
                                "concurrency_target": 3,
                                "max_replica": 2,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 60,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": true,
                                "rolling_deploy_config": null
                            }
                        ]
                    }
                },
                "required": [
                    "name"
                ],
                "title": "CreateEnvironmentRequestV1",
                "type": "object"
            },
            "UpdateEnvironmentRequestV1": {
                "additionalProperties": false,
                "description": "A request to update an environment.",
                "properties": {
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the environment",
                        "examples": [
                            {
                                "autoscaling_window": 800,
                                "concurrency_target": 3,
                                "max_replica": 2,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 60,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": null,
                                "rolling_deploy_config": null
                            }
                        ]
                    }
                },
                "title": "UpdateEnvironmentRequestV1",
                "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"
            },
            "PromoteToEnvironmentRequestV1": {
                "description": "A request to promote a deployment to a environment.",
                "properties": {
                    "scale_down_previous_deployment": {
                        "default": true,
                        "description": "Whether to scale down the previous deployment after promoting",
                        "examples": [
                            true
                        ],
                        "title": "Scale Down Previous Deployment",
                        "type": "boolean"
                    },
                    "deployment_id": {
                        "description": "The id of the deployment to promote",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "preserve_env_instance_type": {
                        "default": true,
                        "description": "Whether to use the promoting deployment's instance type or preserve target environment's instance type",
                        "examples": [
                            true
                        ],
                        "title": "Preserve Env Instance Type",
                        "type": "boolean"
                    }
                },
                "required": [
                    "deployment_id"
                ],
                "title": "PromoteToEnvironmentRequestV1",
                "type": "object"
            },
            "CancelPromotionStatusV1": {
                "description": "The status of a request to cancel a promotion.",
                "enum": [
                    "CANCELED",
                    "RAMPING_DOWN"
                ],
                "title": "CancelPromotionStatusV1",
                "type": "string"
            },
            "CancelPromotionResponseV1": {
                "description": "The response to a request to cancel a promotion.",
                "properties": {
                    "status": {
                        "$ref": "#/components/schemas/CancelPromotionStatusV1",
                        "description": "Status of the request to cancel a promotion. Can be CANCELED or RAMPING_DOWN."
                    },
                    "message": {
                        "description": "A message describing the status of the request to cancel a promotion",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "status",
                    "message"
                ],
                "title": "CancelPromotionResponseV1",
                "type": "object"
            },
            "SignalPromotionResponseV1": {
                "description": "The response to a request to signal a rolling promotion.",
                "properties": {
                    "success": {
                        "description": "Whether the signal was successfully sent",
                        "title": "Success",
                        "type": "boolean"
                    }
                },
                "required": [
                    "success"
                ],
                "title": "SignalPromotionResponseV1",
                "type": "object"
            },
            "ChainV1": {
                "description": "A chain.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the chain was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the chain",
                        "title": "Name",
                        "type": "string"
                    },
                    "deployments_count": {
                        "description": "Number of deployments of the chain",
                        "title": "Deployments Count",
                        "type": "integer"
                    },
                    "team_name": {
                        "description": "Name of the team associated with the chain",
                        "title": "Team Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "name",
                    "deployments_count",
                    "team_name"
                ],
                "title": "ChainV1",
                "type": "object"
            },
            "ChainsV1": {
                "description": "A list of chains.",
                "properties": {
                    "chains": {
                        "items": {
                            "$ref": "#/components/schemas/ChainV1"
                        },
                        "title": "Chains",
                        "type": "array"
                    }
                },
                "required": [
                    "chains"
                ],
                "title": "ChainsV1",
                "type": "object"
            },
            "ChainTombstoneV1": {
                "description": "A chain tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the chain was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "ChainTombstoneV1",
                "type": "object"
            },
            "ChainDeploymentV1": {
                "description": "A deployment of a chain.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain deployment",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the chain deployment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "environment": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Environment the chain deployment is deployed in",
                        "title": "Environment"
                    },
                    "chainlets": {
                        "description": "Chainlets in the chain deployment",
                        "items": {
                            "$ref": "#/components/schemas/ChainletV1"
                        },
                        "title": "Chainlets",
                        "type": "array"
                    },
                    "status": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "Status of the chain deployment"
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "chain_id",
                    "environment",
                    "chainlets",
                    "status"
                ],
                "title": "ChainDeploymentV1",
                "type": "object"
            },
            "ChainletV1": {
                "description": "A chainlet in a chain deployment.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chainlet",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the chainlet",
                        "title": "Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Autoscaling settings for the chainlet. If null, it has not finished deploying"
                    },
                    "instance_type_name": {
                        "description": "Name of the instance type the chainlet is deployed on",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "active_replica_count": {
                        "description": "Number of active replicas",
                        "title": "Active Replica Count",
                        "type": "integer"
                    },
                    "status": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "Status of the chainlet"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "autoscaling_settings",
                    "instance_type_name",
                    "active_replica_count",
                    "status"
                ],
                "title": "ChainletV1",
                "type": "object"
            },
            "ChainDeploymentsV1": {
                "description": "A list of chain deployments.",
                "properties": {
                    "deployments": {
                        "description": "A list of chain deployments",
                        "items": {
                            "$ref": "#/components/schemas/ChainDeploymentV1"
                        },
                        "title": "Deployments",
                        "type": "array"
                    }
                },
                "required": [
                    "deployments"
                ],
                "title": "ChainDeploymentsV1",
                "type": "object"
            },
            "ChainDeploymentTombstoneV1": {
                "description": "A chain deployment tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the chain deployment",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the chain deployment was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    },
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "deleted",
                    "chain_id"
                ],
                "title": "ChainDeploymentTombstoneV1",
                "type": "object"
            },
            "ChainletEnvironmentSettingsRequestV1": {
                "description": "Request to create environment settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "examples": [
                            "HelloWorld"
                        ],
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the chainlet",
                        "examples": [
                            {
                                "autoscaling_window": 60,
                                "concurrency_target": 1,
                                "max_replica": 1,
                                "max_scale_down_rate": null,
                                "min_replica": 0,
                                "scale_down_delay": 900,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": 70
                            }
                        ]
                    },
                    "instance_type_id": {
                        "default": "1x2",
                        "description": "ID of the instance type to use for the chainlet",
                        "examples": [
                            "1x4",
                            "2x8",
                            "A10G:2x24x96",
                            "H100:2x52x468"
                        ],
                        "title": "Instance Type Id",
                        "type": "string"
                    }
                },
                "required": [
                    "chainlet_name"
                ],
                "title": "ChainletEnvironmentSettingsRequestV1",
                "type": "object"
            },
            "CreateChainEnvironmentRequestV1": {
                "description": "A request to create a custom environment for a chain.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "examples": [
                            "staging"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": true,
                                "rolling_deploy": null,
                                "rolling_deploy_config": null
                            }
                        ]
                    },
                    "chainlet_settings": {
                        "anyOf": [
                            {
                                "items": {
                                    "$ref": "#/components/schemas/ChainletEnvironmentSettingsRequestV1"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Mapping of chainlet name to the desired chainlet environment settings",
                        "examples": [
                            [
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": 800,
                                        "concurrency_target": 4,
                                        "max_replica": 3,
                                        "max_scale_down_rate": null,
                                        "min_replica": 2,
                                        "scale_down_delay": 63,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "HelloWorld",
                                    "instance_type_id": "2x8"
                                },
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": null,
                                        "concurrency_target": null,
                                        "max_replica": 3,
                                        "max_scale_down_rate": null,
                                        "min_replica": 3,
                                        "scale_down_delay": null,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "RandInt",
                                    "instance_type_id": "A10Gx8x32"
                                }
                            ]
                        ],
                        "title": "Chainlet Settings"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "CreateChainEnvironmentRequestV1",
                "type": "object"
            },
            "ChainletEnvironmentSettingsV1": {
                "description": "Environment settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/AutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Autoscaling settings for the chainlet. If null, it has not finished deploying"
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type for the chainlet"
                    }
                },
                "required": [
                    "chainlet_name",
                    "autoscaling_settings",
                    "instance_type"
                ],
                "title": "ChainletEnvironmentSettingsV1",
                "type": "object"
            },
            "ChainEnvironmentV1": {
                "description": "Environment for oracles.",
                "properties": {
                    "name": {
                        "description": "Name of the environment",
                        "title": "Name",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the environment was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "chain_id": {
                        "description": "Unique identifier of the chain",
                        "title": "Chain Id",
                        "type": "string"
                    },
                    "promotion_settings": {
                        "$ref": "#/components/schemas/PromotionSettingsV1",
                        "description": "Promotion settings for the environment"
                    },
                    "chainlet_settings": {
                        "description": "Environment settings for the chainlets",
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentSettingsV1"
                        },
                        "title": "Chainlet Settings",
                        "type": "array"
                    },
                    "current_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainDeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Current chain deployment of the environment"
                    },
                    "candidate_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainDeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Candidate chain deployment being promoted to the environment, if a promotion is in progress"
                    }
                },
                "required": [
                    "name",
                    "created_at",
                    "chain_id",
                    "promotion_settings",
                    "chainlet_settings",
                    "current_deployment"
                ],
                "title": "ChainEnvironmentV1",
                "type": "object"
            },
            "UpdateChainEnvironmentRequestV1": {
                "description": "A request to update a chain environment.",
                "properties": {
                    "promotion_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdatePromotionSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Promotion settings for the environment",
                        "examples": [
                            {
                                "promotion_cleanup_strategy": null,
                                "ramp_up_duration_seconds": 600,
                                "ramp_up_while_promoting": true,
                                "redeploy_on_promotion": null,
                                "rolling_deploy": null,
                                "rolling_deploy_config": null
                            }
                        ]
                    }
                },
                "title": "UpdateChainEnvironmentRequestV1",
                "type": "object"
            },
            "UpdateChainEnvironmentResponseV1": {
                "description": "A response to update a chain environment.",
                "properties": {
                    "ok": {
                        "description": "Whether the update was successful",
                        "title": "Ok",
                        "type": "boolean"
                    }
                },
                "required": [
                    "ok"
                ],
                "title": "UpdateChainEnvironmentResponseV1",
                "type": "object"
            },
            "PromoteToChainEnvironmentRequestV1": {
                "description": "A request to promote a deployment to a environment.",
                "properties": {
                    "scale_down_previous_deployment": {
                        "default": true,
                        "description": "Whether to scale down the previous deployment after promoting",
                        "examples": [
                            true
                        ],
                        "title": "Scale Down Previous Deployment",
                        "type": "boolean"
                    },
                    "deployment_id": {
                        "description": "The id of the chain deployment to promote",
                        "title": "Deployment Id",
                        "type": "string"
                    }
                },
                "required": [
                    "deployment_id"
                ],
                "title": "PromoteToChainEnvironmentRequestV1",
                "type": "object"
            },
            "ChainletEnvironmentAutoscalingSettingsUpdateV1": {
                "description": "The request to update the autoscaling settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "examples": [
                            "HelloWorld"
                        ],
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "autoscaling_settings": {
                        "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1",
                        "description": "Autoscaling settings for the chainlet",
                        "examples": [
                            {
                                "autoscaling_window": 800,
                                "concurrency_target": 3,
                                "max_replica": 2,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 60,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    }
                },
                "required": [
                    "chainlet_name",
                    "autoscaling_settings"
                ],
                "title": "ChainletEnvironmentAutoscalingSettingsUpdateV1",
                "type": "object"
            },
            "UpdateChainletEnvironmentAutoscalingSettingsRequestV1": {
                "description": "A request to update the autoscaling settings for a multiple chainlets in an environment.\nIf a chainlet name doesn't exist, an error is returned.",
                "properties": {
                    "updates": {
                        "description": "Mapping of chainlet name to the desired chainlet autoscaling settings. If the chainlet name doesn't exist, an error is returned.",
                        "examples": [
                            [
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": 800,
                                        "concurrency_target": 4,
                                        "max_replica": 3,
                                        "max_scale_down_rate": null,
                                        "min_replica": 2,
                                        "scale_down_delay": 63,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "HelloWorld"
                                }
                            ],
                            [
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": null,
                                        "concurrency_target": null,
                                        "max_replica": null,
                                        "max_scale_down_rate": null,
                                        "min_replica": 0,
                                        "scale_down_delay": null,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "HelloWorld"
                                },
                                {
                                    "autoscaling_settings": {
                                        "autoscaling_window": null,
                                        "concurrency_target": null,
                                        "max_replica": null,
                                        "max_scale_down_rate": null,
                                        "min_replica": 0,
                                        "scale_down_delay": null,
                                        "target_in_flight_tokens": null,
                                        "target_utilization_percentage": null
                                    },
                                    "chainlet_name": "RandInt"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentAutoscalingSettingsUpdateV1"
                        },
                        "title": "Updates",
                        "type": "array"
                    }
                },
                "required": [
                    "updates"
                ],
                "title": "UpdateChainletEnvironmentAutoscalingSettingsRequestV1",
                "type": "object"
            },
            "ChainletEnvironmentInstanceTypeUpdateV1": {
                "description": "A request to update the environment settings for a chainlet.",
                "properties": {
                    "chainlet_name": {
                        "description": "Name of the chainlet",
                        "examples": [
                            "HelloWorld"
                        ],
                        "title": "Chainlet Name",
                        "type": "string"
                    },
                    "instance_type_id": {
                        "description": "Key of the instance type to use for the chainlet",
                        "examples": [
                            "1x4",
                            "2x8",
                            "A10G:2x24x96"
                        ],
                        "title": "Instance Type Id",
                        "type": "string"
                    }
                },
                "required": [
                    "chainlet_name",
                    "instance_type_id"
                ],
                "title": "ChainletEnvironmentInstanceTypeUpdateV1",
                "type": "object"
            },
            "UpdateChainletEnvironmentInstanceTypeRequestV1": {
                "description": "A request to update the instance types for chainlets in an environment. Multiples\nupdates can be made in one request. The updates will be processed in batch and a new deployment\nwill be created, deployed and promoted into the environment.",
                "properties": {
                    "updates": {
                        "description": "Mapping of chainlet name to the desired chainlet instance type. If the chainlet name doesn't exist, an error is returned.",
                        "examples": [
                            [
                                {
                                    "chainlet_name": "HelloWorld",
                                    "instance_type_id": "1x4"
                                },
                                {
                                    "chainlet_name": "RandInt",
                                    "instance_type_id": "A10G:2x24x96"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentInstanceTypeUpdateV1"
                        },
                        "title": "Updates",
                        "type": "array"
                    }
                },
                "required": [
                    "updates"
                ],
                "title": "UpdateChainletEnvironmentInstanceTypeRequestV1",
                "type": "object"
            },
            "UpdateChainletEnvironmentInstanceTypeResponseV1": {
                "description": "A response to update the environment settings for a chainlet. If updating the instance type\nresulted in a re-deployment, `requires_redeployment` will be True and the resulting deployment\nwill be returned in the `chain_deployment` field.",
                "properties": {
                    "requires_redeployment": {
                        "description": "Whether the resource update requires a re-deployment to update the instance type.",
                        "title": "Requires Redeployment",
                        "type": "boolean"
                    },
                    "chain_deployment": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ChainDeploymentV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The chain deployment resulting from the resource update, if any."
                    },
                    "chainlet_environment_settings": {
                        "description": "The updated chainlet environment settings",
                        "items": {
                            "$ref": "#/components/schemas/ChainletEnvironmentSettingsV1"
                        },
                        "title": "Chainlet Environment Settings",
                        "type": "array"
                    }
                },
                "required": [
                    "requires_redeployment",
                    "chain_deployment",
                    "chainlet_environment_settings"
                ],
                "title": "UpdateChainletEnvironmentInstanceTypeResponseV1",
                "type": "object"
            },
            "UpsertTrainingProjectV1": {
                "description": "Fields that can be upserted on a training project.",
                "properties": {
                    "name": {
                        "description": "Name of the training project.",
                        "examples": [
                            "My Training Project"
                        ],
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "UpsertTrainingProjectV1",
                "type": "object"
            },
            "UpsertTrainingProjectRequestV1": {
                "description": "A request to upsert a training project.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/UpsertTrainingProjectV1",
                        "description": "The training project to upsert."
                    }
                },
                "required": [
                    "training_project"
                ],
                "title": "UpsertTrainingProjectRequestV1",
                "type": "object"
            },
            "CheckpointSyncStatus": {
                "description": "Lifecycle state for the checkpoint uploader.",
                "enum": [
                    "SYNCING",
                    "COMPLETED"
                ],
                "title": "CheckpointSyncStatus",
                "type": "string"
            },
            "TrainingJobV1": {
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training job.",
                        "title": "Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the job was created in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "current_status": {
                        "description": "Current status of the training job.",
                        "title": "Current Status",
                        "type": "string"
                    },
                    "error_message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Error message if the training job failed.",
                        "title": "Error Message"
                    },
                    "instance_type": {
                        "$ref": "#/components/schemas/InstanceTypeV1",
                        "description": "Instance type of the training job."
                    },
                    "updated_at": {
                        "description": "Time the job was updated in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    },
                    "training_project_id": {
                        "description": "ID of the training project.",
                        "title": "Training Project Id",
                        "type": "string"
                    },
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectSummaryV1",
                        "description": "Summary of the training project."
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the training job.",
                        "examples": [
                            "gpt-oss-job"
                        ],
                        "title": "Name"
                    },
                    "checkpoint_sync_status": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CheckpointSyncStatus"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Checkpoint sync status of the training job."
                    },
                    "priority": {
                        "default": 0,
                        "description": "Queue priority. Higher values are dequeued first. NULL is treated as 0.",
                        "title": "Priority",
                        "type": "integer"
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity guarantee for the job. 'dedicated' is non-preemptible on-demand capacity; 'spot' is interruptible."
                    },
                    "user": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UserV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The user who created the training job."
                    }
                },
                "required": [
                    "id",
                    "created_at",
                    "current_status",
                    "instance_type",
                    "updated_at",
                    "training_project_id",
                    "training_project"
                ],
                "title": "TrainingJobV1",
                "type": "object"
            },
            "TrainingProjectSummaryV1": {
                "description": "A summary of a training project.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training project.",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the training project.",
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name"
                ],
                "title": "TrainingProjectSummaryV1",
                "type": "object"
            },
            "TrainingProjectV1": {
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training project",
                        "title": "Id",
                        "type": "string"
                    },
                    "name": {
                        "description": "Name of the training project.",
                        "title": "Name",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the training project was created in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "updated_at": {
                        "description": "Time the training project was updated in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Updated At",
                        "type": "string"
                    },
                    "team_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the team associated with the training project.",
                        "title": "Team Name"
                    },
                    "latest_job": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingJobV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "Most recently created training job for the training project."
                    }
                },
                "required": [
                    "id",
                    "name",
                    "created_at",
                    "updated_at",
                    "latest_job"
                ],
                "title": "TrainingProjectV1",
                "type": "object"
            },
            "UserV1": {
                "description": "A user.",
                "properties": {
                    "email": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Email of the user.",
                        "title": "Email"
                    }
                },
                "title": "UserV1",
                "type": "object"
            },
            "V1AvailabilityModel": {
                "description": "Capacity guarantee under which a training job is scheduled.\n\n``DEDICATED`` is on-demand capacity that is not preempted (the default). ``SPOT`` is\ninterruptible capacity that may be preempted; the user is responsible for checkpointing\ntheir own progress. A managed/resumable model where the platform handles\ncheckpoint/resume on its own is intentionally not defined yet; it is planned for a\nfuture milestone.",
                "enum": [
                    "dedicated",
                    "spot"
                ],
                "title": "V1AvailabilityModel",
                "type": "string"
            },
            "UpsertTrainingProjectResponseV1": {
                "description": "A response to upserting a training project.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The upserted training project."
                    }
                },
                "required": [
                    "training_project"
                ],
                "title": "UpsertTrainingProjectResponseV1",
                "type": "object"
            },
            "ListTrainingProjectsResponseV1": {
                "description": "A response to list training projects.",
                "properties": {
                    "training_projects": {
                        "description": "List of training projects.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingProjectV1"
                        },
                        "title": "Training Projects",
                        "type": "array"
                    }
                },
                "required": [
                    "training_projects"
                ],
                "title": "ListTrainingProjectsResponseV1",
                "type": "object"
            },
            "ListTrainingJobsResponseV1": {
                "description": "A response to list training jobs.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The training project."
                    },
                    "training_jobs": {
                        "description": "List of training jobs.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobV1"
                        },
                        "title": "Training Jobs",
                        "type": "array"
                    }
                },
                "required": [
                    "training_project",
                    "training_jobs"
                ],
                "title": "ListTrainingJobsResponseV1",
                "type": "object"
            },
            "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, or R2\nvia MDN's caching and CSI mounting infrastructure. Weights are mirrored once and\ndeduplicated across training jobs.",
                "properties": {
                    "source": {
                        "description": "Weight source URI. Supported formats: hf://, s3://, gs://, r2://",
                        "examples": [
                            "hf://meta-llama/Llama-3-8B@main",
                            "s3://my-bucket/models/llama",
                            "gs://my-bucket/models/llama",
                            "r2://account_id.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": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Authentication configuration for the weight source.",
                        "examples": [
                            {
                                "auth_method": "CUSTOM_SECRET",
                                "auth_secret_name": "hf_token"
                            }
                        ],
                        "title": "Auth"
                    }
                },
                "required": [
                    "source",
                    "mount_location"
                ],
                "title": "CreateJobWeightConfigV1",
                "type": "object"
            },
            "CreateTrainingJobAcceleratorV1": {
                "properties": {
                    "accelerator": {
                        "description": "GPU type for the training job.",
                        "examples": [
                            "H100"
                        ],
                        "title": "Accelerator",
                        "type": "string"
                    },
                    "count": {
                        "description": "GPUs needed for the training job.",
                        "examples": [
                            2
                        ],
                        "title": "Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "accelerator",
                    "count"
                ],
                "title": "CreateTrainingJobAcceleratorV1",
                "type": "object"
            },
            "CreateTrainingJobCacheConfig": {
                "properties": {
                    "enable_legacy_hf_mount": {
                        "default": false,
                        "description": "Whether to enable the legacy Hugging Face cache.",
                        "examples": [
                            true
                        ],
                        "title": "Enable Legacy Hf Mount",
                        "type": "boolean"
                    },
                    "enabled": {
                        "default": false,
                        "description": "Whether to enable the read-write cache.",
                        "examples": [
                            true
                        ],
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "require_cache_affinity": {
                        "default": true,
                        "description": "Whether to require region affinity for the read-write cache. If False, the resulting job is not guaranteed to be deployed alongside the previous cache.",
                        "examples": [
                            true,
                            false
                        ],
                        "title": "Require Cache Affinity",
                        "type": "boolean"
                    },
                    "mount_base_path": {
                        "default": "/root/.cache",
                        "description": "Mount base path for the cache directory. The project cache and team cache will be mounted under this path.",
                        "examples": [
                            "/workspace/.cache",
                            "/root/.cache"
                        ],
                        "title": "Mount Base Path",
                        "type": "string"
                    }
                },
                "title": "CreateTrainingJobCacheConfig",
                "type": "object"
            },
            "CreateTrainingJobCheckpointingConfig": {
                "properties": {
                    "enabled": {
                        "default": false,
                        "description": "Whether checkpointing is enabled.",
                        "examples": [
                            true
                        ],
                        "title": "Enabled",
                        "type": "boolean"
                    },
                    "checkpoint_path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "path where checkpoints will be saved.",
                        "examples": [
                            "/mnt/ckpts"
                        ],
                        "title": "Checkpoint Path"
                    },
                    "volume_size_gib": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Size of the volume in gibibytes. If not provided, the default size will be used",
                        "examples": [
                            10
                        ],
                        "title": "Volume Size Gib"
                    }
                },
                "title": "CreateTrainingJobCheckpointingConfig",
                "type": "object"
            },
            "CreateTrainingJobComputeV1": {
                "description": "Configuration to specify the compute for a training job.",
                "properties": {
                    "node_count": {
                        "default": 1,
                        "description": "Number of nodes for the training job.",
                        "examples": [
                            1
                        ],
                        "title": "Node Count",
                        "type": "integer"
                    },
                    "cpu_count": {
                        "default": 1,
                        "description": "Number of cpus for the training job.",
                        "examples": [
                            1
                        ],
                        "title": "Cpu Count",
                        "type": "integer"
                    },
                    "memory": {
                        "default": "2Gi",
                        "description": "Memory for the training job.",
                        "examples": [
                            "2Gi"
                        ],
                        "title": "Memory",
                        "type": "string"
                    },
                    "accelerator": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CreateTrainingJobAcceleratorV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "GPU specification for the training job",
                        "examples": [
                            {
                                "accelerator": "H100",
                                "count": 2
                            }
                        ]
                    },
                    "availability_model": {
                        "$ref": "#/components/schemas/V1AvailabilityModel",
                        "default": "dedicated",
                        "description": "Capacity guarantee for the job. 'dedicated' (the default) runs on on-demand capacity that is not preempted. 'spot' runs on interruptible capacity that may be preempted; the user is responsible for checkpointing their own progress.",
                        "examples": [
                            "spot"
                        ]
                    }
                },
                "title": "CreateTrainingJobComputeV1",
                "type": "object"
            },
            "CreateTrainingJobImageV1": {
                "description": "Configuration to create a training job image.",
                "properties": {
                    "base_image": {
                        "description": "Base image for the training job.",
                        "examples": [
                            "hello-world"
                        ],
                        "title": "Base Image",
                        "type": "string"
                    },
                    "docker_auth": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DockerAuthV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Docker authentication credentials"
                    }
                },
                "required": [
                    "base_image"
                ],
                "title": "CreateTrainingJobImageV1",
                "type": "object"
            },
            "CreateTrainingJobRuntimeV1": {
                "description": "Configuration to specify the runtime environment for a training job.",
                "properties": {
                    "start_commands": {
                        "description": "Commands to execute when starting the runtime.",
                        "examples": [
                            [
                                "python main.py"
                            ]
                        ],
                        "items": {
                            "type": "string"
                        },
                        "title": "Start Commands",
                        "type": "array"
                    },
                    "environment_variables": {
                        "additionalProperties": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "$ref": "#/components/schemas/SecretReferenceV1"
                                }
                            ]
                        },
                        "description": "Environment variables to set in the runtime.",
                        "examples": [
                            {
                                "API_KEY": "your_api_key_here",
                                "PATH": "/usr/bin"
                            }
                        ],
                        "title": "Environment Variables",
                        "type": "object"
                    },
                    "artifacts": {
                        "description": "Runtime artifacts for the training job.",
                        "items": {
                            "$ref": "#/components/schemas/CreateTrainingJobS3Artifact"
                        },
                        "title": "Artifacts",
                        "type": "array"
                    },
                    "enable_cache": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Deprecated. Use cache_config instead.",
                        "examples": [
                            true
                        ],
                        "title": "Enable Cache"
                    },
                    "cache_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CreateTrainingJobCacheConfig"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Configuration for the read-write cache.",
                        "examples": [
                            {
                                "enable_legacy_hf_mount": true,
                                "enabled": true,
                                "mount_base_path": "/root/.cache",
                                "require_cache_affinity": true
                            }
                        ]
                    },
                    "checkpointing_config": {
                        "$ref": "#/components/schemas/CreateTrainingJobCheckpointingConfig",
                        "description": "Configuration for checkpointing.",
                        "examples": [
                            {
                                "checkpoint_path": "/mnt/ckpts",
                                "enabled": true,
                                "volume_size_gib": null
                            }
                        ]
                    },
                    "load_checkpoint_config": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LoadCheckpointConfig"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Configuration for loading checkpoints"
                    }
                },
                "title": "CreateTrainingJobRuntimeV1",
                "type": "object"
            },
            "CreateTrainingJobS3Artifact": {
                "properties": {
                    "s3_bucket": {
                        "description": "S3 bucket for the uploaded runtime artifact.",
                        "examples": [
                            "my-s3-bucket"
                        ],
                        "title": "S3 Bucket",
                        "type": "string"
                    },
                    "s3_key": {
                        "description": "S3 key for the uploaded runtime artifact.",
                        "examples": [
                            "my-s3-key"
                        ],
                        "title": "S3 Key",
                        "type": "string"
                    }
                },
                "required": [
                    "s3_bucket",
                    "s3_key"
                ],
                "title": "CreateTrainingJobS3Artifact",
                "type": "object"
            },
            "CreateTrainingJobV1": {
                "description": "Configuration for a training job.",
                "properties": {
                    "image": {
                        "$ref": "#/components/schemas/CreateTrainingJobImageV1",
                        "examples": [
                            {
                                "base_image": "hello-world",
                                "docker_auth": null
                            }
                        ]
                    },
                    "compute": {
                        "$ref": "#/components/schemas/CreateTrainingJobComputeV1",
                        "examples": [
                            {
                                "accelerator": {
                                    "accelerator": "H100",
                                    "count": 2
                                },
                                "availability_model": "spot",
                                "cpu_count": 1,
                                "memory": "2Gi",
                                "node_count": 1
                            }
                        ]
                    },
                    "runtime": {
                        "$ref": "#/components/schemas/CreateTrainingJobRuntimeV1",
                        "description": "Configuration for the runtime environment of the training job.",
                        "examples": [
                            {
                                "artifacts": [],
                                "cache_config": null,
                                "checkpointing_config": {
                                    "checkpoint_path": null,
                                    "enabled": false,
                                    "volume_size_gib": null
                                },
                                "enable_cache": null,
                                "environment_variables": {
                                    "API_KEY": "your_api_key_here",
                                    "PATH": "/usr/bin"
                                },
                                "load_checkpoint_config": null,
                                "start_commands": [
                                    "python main.py"
                                ]
                            }
                        ]
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the training job.",
                        "examples": [
                            "gpt-oss-job"
                        ],
                        "title": "Name"
                    },
                    "truss_user_env": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrussUserEnv"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Truss user environment information"
                    },
                    "interactive_session": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/InteractiveSessionConfigV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Configuration for interactive debugging sessions."
                    },
                    "weights": {
                        "description": "MDN weight sources to mount in the training container. Weights are mirrored and cached for fast startup.",
                        "examples": [
                            [
                                {
                                    "allow_patterns": null,
                                    "auth": null,
                                    "auth_secret_name": null,
                                    "ignore_patterns": null,
                                    "mount_location": "/app/models/base",
                                    "source": "hf://meta-llama/Llama-3-8B@main"
                                }
                            ]
                        ],
                        "items": {
                            "$ref": "#/components/schemas/CreateJobWeightConfigV1"
                        },
                        "title": "Weights",
                        "type": "array"
                    },
                    "enable_baseten_workdir": {
                        "default": false,
                        "description": "When enabled, uses /b10/workspace as the working directory instead of the image WORKDIR.",
                        "examples": [
                            false,
                            true
                        ],
                        "title": "Enable Baseten Workdir",
                        "type": "boolean"
                    },
                    "priority": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Queue priority. Higher values are dequeued first. Defaults to 0.",
                        "examples": [
                            0,
                            10,
                            100
                        ],
                        "title": "Priority"
                    }
                },
                "required": [
                    "image"
                ],
                "title": "CreateTrainingJobV1",
                "type": "object"
            },
            "DockerAuthType": {
                "enum": [
                    "GCP_SERVICE_ACCOUNT_JSON",
                    "AWS_IAM",
                    "AWS_OIDC",
                    "GCP_OIDC",
                    "REGISTRY_SECRET"
                ],
                "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"
                        ]
                    },
                    "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."
                    }
                },
                "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"
            },
            "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.",
                "properties": {
                    "priority": {
                        "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",
                        "type": "integer"
                    }
                },
                "required": [
                    "priority"
                ],
                "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 that includes the artifacts for a training job",
                "properties": {
                    "artifact_presigned_urls": {
                        "description": "Presigned URL's for the artifacts",
                        "items": {
                            "type": "string"
                        },
                        "title": "Artifact Presigned Urls",
                        "type": "array"
                    }
                },
                "required": [
                    "artifact_presigned_urls"
                ],
                "title": "DownloadTrainingJobResponseV1",
                "type": "object"
            },
            "RecreateTrainingJobResponseV1": {
                "description": "A response that sends the new training job",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The created training job."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "RecreateTrainingJobResponseV1",
                "type": "object"
            },
            "GetTrainingJobLogsRequestV1": {
                "description": "A request to fetch training logs.",
                "properties": {
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort order for logs"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 500,
                        "description": "Limit of logs to fetch in a single request",
                        "title": "Limit"
                    },
                    "min_level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level."
                    }
                },
                "title": "GetTrainingJobLogsRequestV1",
                "type": "object"
            },
            "StorageMetricsV1": {
                "description": "A metric for a training job.",
                "properties": {
                    "usage_bytes": {
                        "description": "The number of bytes used on the storage entity.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Usage Bytes",
                        "type": "array"
                    },
                    "utilization": {
                        "description": "The utilization of the storage entity as a decimal percentage.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Utilization",
                        "type": "array"
                    }
                },
                "required": [
                    "usage_bytes",
                    "utilization"
                ],
                "title": "StorageMetricsV1",
                "type": "object"
            },
            "TrainingJobMetricV1": {
                "description": "A metric for a training job.",
                "properties": {
                    "value": {
                        "description": "The value of the metric.",
                        "title": "Value",
                        "type": "number"
                    },
                    "timestamp": {
                        "description": "The timestamp of the metric in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Timestamp",
                        "type": "string"
                    }
                },
                "required": [
                    "value",
                    "timestamp"
                ],
                "title": "TrainingJobMetricV1",
                "type": "object"
            },
            "TrainingJobMetricsV1": {
                "properties": {
                    "gpu_memory_usage_bytes": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Memory Usage Bytes",
                        "type": "array"
                    },
                    "ephemeral_storage": {
                        "$ref": "#/components/schemas/StorageMetricsV1",
                        "description": "The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise."
                    }
                },
                "required": [
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "cpu_usage",
                    "cpu_memory_usage_bytes",
                    "ephemeral_storage"
                ],
                "title": "TrainingJobMetricsV1",
                "type": "object"
            },
            "TrainingJobNodeMetricsV1": {
                "description": "A set of metrics for a training job node.",
                "properties": {
                    "node_id": {
                        "description": "The name of the node.",
                        "title": "Node Id",
                        "type": "string"
                    },
                    "metrics": {
                        "$ref": "#/components/schemas/TrainingJobMetricsV1",
                        "description": "The metrics for the node."
                    }
                },
                "required": [
                    "node_id",
                    "metrics"
                ],
                "title": "TrainingJobNodeMetricsV1",
                "type": "object"
            },
            "GetTrainingJobMetricsResponseV1": {
                "description": "A response to fetch training job metrics. The outer list for each metric represents that metric across time.",
                "properties": {
                    "gpu_memory_usage_bytes": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.",
                        "title": "Gpu Memory Usage Bytes",
                        "type": "object"
                    },
                    "gpu_utilization": {
                        "additionalProperties": {
                            "items": {
                                "$ref": "#/components/schemas/TrainingJobMetricV1"
                            },
                            "type": "array"
                        },
                        "description": "A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.",
                        "title": "Gpu Utilization",
                        "type": "object"
                    },
                    "cpu_usage": {
                        "description": "The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Usage",
                        "type": "array"
                    },
                    "cpu_memory_usage_bytes": {
                        "description": "The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobMetricV1"
                        },
                        "title": "Cpu Memory Usage Bytes",
                        "type": "array"
                    },
                    "ephemeral_storage": {
                        "$ref": "#/components/schemas/StorageMetricsV1",
                        "description": "The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise."
                    },
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The training job."
                    },
                    "cache": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/StorageMetricsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The storage usage for the read-write cache."
                    },
                    "per_node_metrics": {
                        "description": "The metrics for each node in the training job.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobNodeMetricsV1"
                        },
                        "title": "Per Node Metrics",
                        "type": "array"
                    }
                },
                "required": [
                    "gpu_memory_usage_bytes",
                    "gpu_utilization",
                    "cpu_usage",
                    "cpu_memory_usage_bytes",
                    "ephemeral_storage",
                    "training_job",
                    "cache",
                    "per_node_metrics"
                ],
                "title": "GetTrainingJobMetricsResponseV1",
                "type": "object"
            },
            "GetTrainingJobMetricsRequestV1": {
                "description": "A request to fetch metrics. Allows the user to request metrics over a period of time.",
                "properties": {
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to end fetching metrics",
                        "title": "End Epoch Millis"
                    },
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch millis timestamp to start fetching metrics.",
                        "title": "Start Epoch Millis"
                    },
                    "step_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Resolution of the returned series, in seconds. When omitted, a step is derived from the time range so large windows return fewer points.",
                        "title": "Step Seconds"
                    }
                },
                "title": "GetTrainingJobMetricsRequestV1",
                "type": "object"
            },
            "StopTrainingJobRequestV1": {
                "description": "A request to stop a training job.",
                "properties": {},
                "title": "StopTrainingJobRequestV1",
                "type": "object"
            },
            "StopTrainingJobResponseV1": {
                "description": "A response to stopping a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The stopped training job."
                    }
                },
                "required": [
                    "training_job"
                ],
                "title": "StopTrainingJobResponseV1",
                "type": "object"
            },
            "TrainingJobCheckpointV1": {
                "description": "A checkpoint for a training job.",
                "properties": {
                    "checkpoint_id": {
                        "description": "The ID of the checkpoint.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "The timestamp of the checkpoint in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "checkpoint_type": {
                        "description": "The type of checkpoint.",
                        "title": "Checkpoint Type",
                        "type": "string"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The base model of the checkpoint.",
                        "title": "Base Model"
                    },
                    "lora_adapter_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The adapter config of the checkpoint.",
                        "title": "Lora Adapter Config"
                    },
                    "size_bytes": {
                        "description": "The size of the checkpoint in bytes.",
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "sync_status": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sync state of the checkpoint: SYNCING or COMPLETE.",
                        "title": "Sync Status"
                    },
                    "training_job_id": {
                        "description": "The ID of the training job.",
                        "title": "Training Job Id",
                        "type": "string"
                    }
                },
                "required": [
                    "checkpoint_id",
                    "created_at",
                    "checkpoint_type",
                    "base_model",
                    "lora_adapter_config",
                    "size_bytes",
                    "training_job_id"
                ],
                "title": "TrainingJobCheckpointV1",
                "type": "object"
            },
            "GetTrainingJobCheckpointsResponseV1": {
                "description": "A response to fetch checkpoints for a training job.",
                "properties": {
                    "training_job": {
                        "$ref": "#/components/schemas/TrainingJobV1",
                        "description": "The training job."
                    },
                    "checkpoints": {
                        "description": "The checkpoints for the training job.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobCheckpointV1"
                        },
                        "title": "Checkpoints",
                        "type": "array"
                    }
                },
                "required": [
                    "training_job",
                    "checkpoints"
                ],
                "title": "GetTrainingJobCheckpointsResponseV1",
                "type": "object"
            },
            "CheckpointFile": {
                "properties": {
                    "url": {
                        "title": "Url",
                        "type": "string"
                    },
                    "relative_file_name": {
                        "title": "Relative File Name",
                        "type": "string"
                    },
                    "node_rank": {
                        "title": "Node Rank",
                        "type": "integer"
                    },
                    "size_bytes": {
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "last_modified": {
                        "title": "Last Modified",
                        "type": "string"
                    }
                },
                "required": [
                    "url",
                    "relative_file_name",
                    "node_rank",
                    "size_bytes",
                    "last_modified"
                ],
                "title": "CheckpointFile",
                "type": "object"
            },
            "GetTrainingJobCheckpointFilesResponseV1": {
                "description": "A response to fetch presigned URLs for checkpoint files of a training job.",
                "properties": {
                    "presigned_urls": {
                        "description": "List of presigned URLs for checkpoint files.",
                        "items": {
                            "$ref": "#/components/schemas/CheckpointFile"
                        },
                        "title": "Presigned Urls",
                        "type": "array"
                    },
                    "next_page_token": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Token to use for fetching the next page of results. None when there are no more results.",
                        "title": "Next Page Token"
                    },
                    "total_count": {
                        "description": "Total number of checkpoint files available.",
                        "title": "Total Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "presigned_urls",
                    "total_count"
                ],
                "title": "GetTrainingJobCheckpointFilesResponseV1",
                "type": "object"
            },
            "GetTrainingJobCheckpointFilesRequestV1": {
                "description": "Pagination params for ``GET /v1/training_projects/.../checkpoint_files``.",
                "properties": {
                    "page_size": {
                        "default": 1000,
                        "description": "Max files per page (default 1000).",
                        "minimum": 1,
                        "title": "Page Size",
                        "type": "integer"
                    },
                    "page_token": {
                        "default": 0,
                        "description": "Offset into the file list (default 0).",
                        "minimum": 0,
                        "title": "Page Token",
                        "type": "integer"
                    }
                },
                "title": "GetTrainingJobCheckpointFilesRequestV1",
                "type": "object"
            },
            "AuthCodeV1": {
                "description": "Authentication code for a training job interactive session node.",
                "properties": {
                    "session_id": {
                        "description": "Unique identifier of the interactive session.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "replica_id": {
                        "description": "Replica identifier in gXXrY format (e.g., 'g00r0' for group 0, replica 0).",
                        "title": "Replica Id",
                        "type": "string"
                    },
                    "auth_code": {
                        "description": "The device authentication code (e.g., '4F64-C0D9').",
                        "title": "Auth Code",
                        "type": "string"
                    },
                    "auth_url": {
                        "description": "URL where the user should enter the auth code (e.g., 'https://github.com/login/device').",
                        "title": "Auth Url",
                        "type": "string"
                    },
                    "generated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the auth code was generated, in ISO 8601 format.",
                        "title": "Generated At"
                    },
                    "tunnel_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The name of the tunnel node.",
                        "title": "Tunnel Name"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the session expires, in ISO 8601 format.",
                        "title": "Expires At"
                    },
                    "working_directory": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The working directory of the session.",
                        "title": "Working Directory"
                    }
                },
                "required": [
                    "session_id",
                    "replica_id",
                    "auth_code",
                    "auth_url"
                ],
                "title": "AuthCodeV1",
                "type": "object"
            },
            "GetAuthCodesResponseV1": {
                "description": "Response containing auth codes for all nodes of a training job's interactive sessions.",
                "properties": {
                    "auth_codes": {
                        "description": "List of auth codes for each node that has an active interactive session.",
                        "items": {
                            "$ref": "#/components/schemas/AuthCodeV1"
                        },
                        "title": "Auth Codes",
                        "type": "array"
                    }
                },
                "required": [
                    "auth_codes"
                ],
                "title": "GetAuthCodesResponseV1",
                "type": "object"
            },
            "PatchInteractiveSessionRequestV1": {
                "description": "Request to patch an interactive session.\n\nOnly fields that are provided (non-None) will be applied.",
                "properties": {
                    "timeout_minutes": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "For on_startup sessions, minutes to add to the expiration. For on_demand/on_failure sessions, minutes to add to the timeout. Use -1 for infinite timeout (bumps by 10 years).",
                        "title": "Timeout Minutes"
                    },
                    "trigger": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/V1InteractiveSessionTrigger"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Update when the interactive session is created. Cannot be changed if the session trigger is 'on_startup'."
                    }
                },
                "title": "PatchInteractiveSessionRequestV1",
                "type": "object"
            },
            "InteractiveSessionV1": {
                "description": "Representation of a training job interactive session.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the interactive session.",
                        "title": "Id",
                        "type": "string"
                    },
                    "trigger": {
                        "description": "When the interactive session is created.",
                        "title": "Trigger",
                        "type": "string"
                    },
                    "timeout_minutes": {
                        "description": "Minutes before the session times out.",
                        "title": "Timeout Minutes",
                        "type": "integer"
                    },
                    "session_provider": {
                        "description": "The IDE client for the session.",
                        "title": "Session Provider",
                        "type": "string"
                    },
                    "auth_provider": {
                        "description": "The authentication provider for the session.",
                        "title": "Auth Provider",
                        "type": "string"
                    },
                    "pod_name": {
                        "description": "Pod name / node rank for the session.",
                        "title": "Pod Name",
                        "type": "string"
                    },
                    "expires_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the session expires, in ISO 8601 format.",
                        "title": "Expires At"
                    },
                    "tunnel_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The tunnel name for the session.",
                        "title": "Tunnel Name"
                    },
                    "auth_code": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The device authentication code.",
                        "title": "Auth Code"
                    },
                    "auth_url": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "URL where the user should enter the auth code.",
                        "title": "Auth Url"
                    },
                    "auth_code_generated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the auth code was generated.",
                        "title": "Auth Code Generated At"
                    },
                    "authenticated_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the session was authenticated.",
                        "title": "Authenticated At"
                    },
                    "working_directory": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "The working directory of the session.",
                        "title": "Working Directory"
                    }
                },
                "required": [
                    "id",
                    "trigger",
                    "timeout_minutes",
                    "session_provider",
                    "auth_provider",
                    "pod_name"
                ],
                "title": "InteractiveSessionV1",
                "type": "object"
            },
            "PatchInteractiveSessionResponseV1": {
                "description": "Response after patching an interactive session.",
                "properties": {
                    "interactive_session": {
                        "$ref": "#/components/schemas/InteractiveSessionV1",
                        "description": "The updated interactive session."
                    },
                    "message": {
                        "description": "Human-readable summary of what was updated.",
                        "title": "Message",
                        "type": "string"
                    }
                },
                "required": [
                    "interactive_session",
                    "message"
                ],
                "title": "PatchInteractiveSessionResponseV1",
                "type": "object"
            },
            "FileSummary": {
                "description": "Information about a file in the cache.",
                "properties": {
                    "path": {
                        "description": "Relative path of the file in the cache",
                        "title": "Path",
                        "type": "string"
                    },
                    "size_bytes": {
                        "description": "Size of the file in bytes",
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "modified": {
                        "description": "Last modification time of the file",
                        "title": "Modified",
                        "type": "string"
                    },
                    "file_type": {
                        "description": "Type of the file",
                        "title": "File Type",
                        "type": "string"
                    },
                    "permissions": {
                        "description": "Permissions of the file",
                        "title": "Permissions",
                        "type": "string"
                    }
                },
                "required": [
                    "path",
                    "size_bytes",
                    "modified",
                    "file_type",
                    "permissions"
                ],
                "title": "FileSummary",
                "type": "object"
            },
            "GetCacheSummaryResponseV1": {
                "description": "Response for getting cache summary.",
                "properties": {
                    "timestamp": {
                        "description": "Timestamp when the cache summary was captured",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "project_id": {
                        "description": "Project ID associated with the cache",
                        "title": "Project Id",
                        "type": "string"
                    },
                    "file_summaries": {
                        "description": "List of files in the cache",
                        "items": {
                            "$ref": "#/components/schemas/FileSummary"
                        },
                        "title": "File Summaries",
                        "type": "array"
                    }
                },
                "required": [
                    "timestamp",
                    "project_id",
                    "file_summaries"
                ],
                "title": "GetCacheSummaryResponseV1",
                "type": "object"
            },
            "TrainingProjectTombstoneV1": {
                "description": "A training project tombstone.",
                "properties": {
                    "id": {
                        "description": "Unique identifier of the training project",
                        "title": "Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the training project was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "id",
                    "deleted"
                ],
                "title": "TrainingProjectTombstoneV1",
                "type": "object"
            },
            "GetTrainingProjectResponseV1": {
                "description": "A response to getting a training project.",
                "properties": {
                    "training_project": {
                        "$ref": "#/components/schemas/TrainingProjectV1",
                        "description": "The training project."
                    }
                },
                "required": [
                    "training_project"
                ],
                "title": "GetTrainingProjectResponseV1",
                "type": "object"
            },
            "OrderByV1": {
                "description": "A request to order training jobs.",
                "properties": {
                    "field": {
                        "description": "The field to order by.",
                        "examples": [
                            "created_at"
                        ],
                        "title": "Field",
                        "type": "string"
                    },
                    "order": {
                        "description": "The direction to order by.",
                        "examples": [
                            "asc",
                            "desc"
                        ],
                        "title": "Order",
                        "type": "string"
                    }
                },
                "required": [
                    "field",
                    "order"
                ],
                "title": "OrderByV1",
                "type": "object"
            },
            "SearchTrainingJobsRequestV1": {
                "description": "A request to search training jobs.",
                "properties": {
                    "project_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter the training jobs by project ID.",
                        "examples": [
                            "n4q95w5"
                        ],
                        "title": "Project Id"
                    },
                    "job_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter the training jobs by job ID.",
                        "examples": [
                            "p7qr9qv"
                        ],
                        "title": "Job Id"
                    },
                    "statuses": {
                        "anyOf": [
                            {
                                "items": {
                                    "type": "string"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter the training jobs by status.",
                        "examples": [
                            [
                                "TRAINING_JOB_RUNNING",
                                "TRAINING_JOB_COMPLETED"
                            ]
                        ],
                        "title": "Statuses"
                    },
                    "order_by": {
                        "default": [
                            {
                                "field": "created_at",
                                "order": "desc"
                            }
                        ],
                        "description": "Order the training jobs by a field. Currently supports created_at",
                        "items": {
                            "$ref": "#/components/schemas/OrderByV1"
                        },
                        "title": "Order By",
                        "type": "array"
                    }
                },
                "title": "SearchTrainingJobsRequestV1",
                "type": "object"
            },
            "SearchTrainingJobsResponseV1": {
                "description": "A response to search training jobs.",
                "properties": {
                    "training_jobs": {
                        "description": "List of training jobs.",
                        "items": {
                            "$ref": "#/components/schemas/TrainingJobV1"
                        },
                        "title": "Training Jobs",
                        "type": "array"
                    }
                },
                "required": [
                    "training_jobs"
                ],
                "title": "SearchTrainingJobsResponseV1",
                "type": "object"
            },
            "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_context_length": {
                        "description": "The maximum context length (in tokens) supported by this model.",
                        "title": "Max Context Length",
                        "type": "integer"
                    }
                },
                "required": [
                    "model_name",
                    "max_context_length"
                ],
                "title": "SupportedModelV1",
                "type": "object"
            },
            "GetLoopsCapabilitiesResponseV1": {
                "description": "Response for ``GET /v1/loops/capabilities``.",
                "properties": {
                    "supported_models": {
                        "description": "List of models available on the server.",
                        "items": {
                            "$ref": "#/components/schemas/SupportedModelV1"
                        },
                        "title": "Supported Models",
                        "type": "array"
                    }
                },
                "required": [
                    "supported_models"
                ],
                "title": "GetLoopsCapabilitiesResponseV1",
                "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"
            },
            "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"
                    },
                    "name": {
                        "description": "The run's display name.",
                        "title": "Name",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The HuggingFace base model the run is fine-tuning.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "base_url": {
                        "description": "The run's base URL.",
                        "title": "Base Url",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the run was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "sampler": {
                        "$ref": "#/components/schemas/LoopsSamplerV1",
                        "description": "The sampler bound to this run."
                    }
                },
                "required": [
                    "id",
                    "session_id",
                    "name",
                    "base_model",
                    "base_url",
                    "created_at",
                    "sampler"
                ],
                "title": "LoopsRunV1",
                "type": "object"
            },
            "LoopsSamplerStatusV1": {
                "description": "The current status of a Loops sampler.",
                "properties": {
                    "name": {
                        "$ref": "#/components/schemas/DeploymentStatusV1",
                        "description": "The current status of the Loops sampler."
                    }
                },
                "required": [
                    "name"
                ],
                "title": "LoopsSamplerStatusV1",
                "type": "object"
            },
            "LoopsSamplerV1": {
                "properties": {
                    "id": {
                        "title": "Id",
                        "type": "string"
                    },
                    "base_url": {
                        "title": "Base Url",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "The HuggingFace base model the sampler is serving.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "Time the sampler was created in ISO 8601 format",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "model_id": {
                        "description": "Hashid of the underlying Baseten model.",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "deployment_id": {
                        "description": "Hashid of the specific model deployment (version).",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/LoopsSamplerStatusV1",
                        "description": "The sampler's current status."
                    }
                },
                "required": [
                    "id",
                    "base_url",
                    "base_model",
                    "created_at",
                    "model_id",
                    "deployment_id",
                    "status"
                ],
                "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\nBoth filters are optional and can be combined; omit both to list all\nruns visible to the caller.",
                "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"
                    }
                },
                "title": "ListLoopsRunsQueryParamsV1",
                "type": "object"
            },
            "CreateLoopsRunRequestV1": {
                "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.",
                        "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": 3600,
                        "description": "Seconds of inactivity before the run scales to zero. Must be between 1 and 3600 (1 hour). Defaults to 3600.",
                        "exclusiveMinimum": 0,
                        "maximum": 3600,
                        "title": "Scale Down Delay Seconds",
                        "type": "integer"
                    },
                    "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_session_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional Loops session ID whose trainer deployment should be reused for this run, sharing the infrastructure across sessions instead of provisioning fresh. The named session must belong to the same team. Reuse is best-effort: if the prior deployment is stopped, failed, its sampler is unhealthy, or this run requests replicas != 1, a new deployment is provisioned instead.",
                        "title": "Reuse From Session Id"
                    }
                },
                "required": [
                    "session_id",
                    "base_model"
                ],
                "title": "CreateLoopsRunRequestV1",
                "type": "object"
            },
            "CreateLoopsRunResponseV1": {
                "properties": {
                    "run": {
                        "$ref": "#/components/schemas/LoopsRunV1"
                    }
                },
                "required": [
                    "run"
                ],
                "title": "CreateLoopsRunResponseV1",
                "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"
            },
            "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"
            },
            "CreateLoopsSamplerRequestV1": {
                "properties": {
                    "session_id": {
                        "description": "ID of the Loops session this sampler belongs to.",
                        "title": "Session Id",
                        "type": "string"
                    },
                    "base_model": {
                        "description": "Base model ID for standalone samplers (e.g., for baselines).",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "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. Omit to use the default for the base model.",
                        "title": "Max Seq Length"
                    },
                    "model_path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional bt:// URI of an existing sampler-target checkpoint to load weights from on startup. 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 Loops session ID whose deployment should be reused for this sampler. Same best-effort semantics as the run endpoint.",
                        "title": "Reuse From Session Id"
                    }
                },
                "required": [
                    "session_id",
                    "base_model"
                ],
                "title": "CreateLoopsSamplerRequestV1",
                "type": "object"
            },
            "CreateLoopsSamplerResponseV1": {
                "properties": {
                    "sampler": {
                        "$ref": "#/components/schemas/LoopsSamplerV1"
                    }
                },
                "required": [
                    "sampler"
                ],
                "title": "CreateLoopsSamplerResponseV1",
                "type": "object"
            },
            "GetLoopsSamplerResponseV1": {
                "description": "Response for ``GET /v1/loops/samplers/<sampler_id>``.",
                "properties": {
                    "sampler": {
                        "$ref": "#/components/schemas/LoopsSamplerV1",
                        "description": "The Loops sampler."
                    }
                },
                "required": [
                    "sampler"
                ],
                "title": "GetLoopsSamplerResponseV1",
                "type": "object"
            },
            "LoopsCheckpointV1": {
                "description": "A checkpoint saved by a Loops run.",
                "properties": {
                    "checkpoint_id": {
                        "description": "The ID of the checkpoint.",
                        "title": "Checkpoint Id",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "The timestamp of the checkpoint in ISO 8601 format.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    },
                    "checkpoint_type": {
                        "description": "The type of checkpoint.",
                        "title": "Checkpoint Type",
                        "type": "string"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The base model of the checkpoint.",
                        "title": "Base Model"
                    },
                    "lora_adapter_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "description": "The adapter config of the checkpoint.",
                        "title": "Lora Adapter Config"
                    },
                    "size_bytes": {
                        "description": "The size of the checkpoint in bytes.",
                        "title": "Size Bytes",
                        "type": "integer"
                    },
                    "sync_status": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sync state of the checkpoint: SYNCING or COMPLETE.",
                        "title": "Sync Status"
                    },
                    "id": {
                        "description": "The checkpoint ID.",
                        "title": "Id",
                        "type": "string"
                    },
                    "run_id": {
                        "description": "The ID of the run that produced the checkpoint.",
                        "title": "Run Id",
                        "type": "string"
                    },
                    "target": {
                        "$ref": "#/components/schemas/TrainerCheckpointTarget",
                        "description": "Whether this checkpoint is loadable by the sampler or by the run."
                    }
                },
                "required": [
                    "checkpoint_id",
                    "created_at",
                    "checkpoint_type",
                    "base_model",
                    "lora_adapter_config",
                    "size_bytes",
                    "id",
                    "run_id",
                    "target"
                ],
                "title": "LoopsCheckpointV1",
                "type": "object"
            },
            "TrainerCheckpointTarget": {
                "description": "Whether a TrainerServerCheckpoint is loadable by the sampler or the trainer.\n\nSAMPLER checkpoints are consumed by the sampling server for inference;\nTRAINER checkpoints capture full trainer state for resuming training.\nMirrored in the bt:// URI as\n``bt://loops:<trainer_id>/(sampler_weights|weights)/<name>``.",
                "enum": [
                    "sampler",
                    "trainer"
                ],
                "title": "TrainerCheckpointTarget",
                "type": "string"
            },
            "ListLoopsCheckpointsResponseV1": {
                "description": "Checkpoints matching the query filter.",
                "properties": {
                    "checkpoints": {
                        "description": "Matching checkpoints.",
                        "items": {
                            "$ref": "#/components/schemas/LoopsCheckpointV1"
                        },
                        "title": "Checkpoints",
                        "type": "array"
                    }
                },
                "required": [
                    "checkpoints"
                ],
                "title": "ListLoopsCheckpointsResponseV1",
                "type": "object"
            },
            "ListLoopsCheckpointsQueryParamsV1": {
                "description": "Query-string filters for ``GET /v1/loops/checkpoints``.\n\nProvide exactly one of ``run_id`` (all checkpoints for the run),\n``base_model`` (all checkpoints across the caller's runs of that\nbase model), or ``checkpoint_path`` (the single matching checkpoint).",
                "properties": {
                    "run_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by run ID. Returns all checkpoints saved by the run.",
                        "examples": [
                            "k4q95w5"
                        ],
                        "title": "Run Id"
                    },
                    "base_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Filter by base model. Returns checkpoints across the caller's runs of this base model.",
                        "examples": [
                            "Qwen/Qwen3-8B"
                        ],
                        "title": "Base Model"
                    },
                    "checkpoint_path": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "bt:// URI of a Loops checkpoint. Form: bt://loops:<run_id>/(weights|sampler_weights)/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/sampler_weights/step-100"
                        ],
                        "title": "Checkpoint Path"
                    }
                },
                "title": "ListLoopsCheckpointsQueryParamsV1",
                "type": "object"
            },
            "ValidateLoopsCheckpointRequestV1": {
                "description": "Request body for ``POST /v1/loops/checkpoints/validate``.",
                "properties": {
                    "checkpoint_path": {
                        "description": "bt:// URI of a sampler checkpoint. Form: bt://loops:<run_id>/sampler_weights/<checkpoint_name>.",
                        "examples": [
                            "bt://loops:k4q95w5/sampler_weights/step-100"
                        ],
                        "title": "Checkpoint Path",
                        "type": "string"
                    }
                },
                "required": [
                    "checkpoint_path"
                ],
                "title": "ValidateLoopsCheckpointRequestV1",
                "type": "object"
            },
            "ValidateLoopsCheckpointResponseV1": {
                "description": "Response for ``POST /v1/loops/checkpoints/validate``. Empty on success;\ninaccessible or malformed paths raise 400.",
                "properties": {},
                "title": "ValidateLoopsCheckpointResponseV1",
                "type": "object"
            },
            "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"
            },
            "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"
                    },
                    "base_model": {
                        "description": "The HuggingFace base model the deployment is fine-tuning.",
                        "title": "Base Model",
                        "type": "string"
                    },
                    "base_url": {
                        "description": "The run's base URL.",
                        "title": "Base Url",
                        "type": "string"
                    },
                    "status": {
                        "$ref": "#/components/schemas/LoopsDeploymentStatusV1",
                        "description": "Latest deployment status."
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserV1",
                        "description": "The user who owns the Loops deployment."
                    },
                    "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"
                ],
                "title": "LoopsDeploymentV1",
                "type": "object"
            },
            "Name": {
                "enum": [
                    "CREATED",
                    "DEPLOYING",
                    "RUNNING",
                    "SCALED_TO_ZERO",
                    "FAILED",
                    "STOPPED"
                ],
                "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"
            },
            "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"
            },
            "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.\n\nValues are reported in **milliseconds** to match the oracle/inference\n``response_time_stats`` convention. Source histogram is the queue-proxy's\n``revision_request_latencies_bucket`` whose bucket boundaries are in ms.",
                "properties": {
                    "timestamp": {
                        "description": "ISO 8601 timestamp.",
                        "format": "date-time",
                        "title": "Timestamp",
                        "type": "string"
                    },
                    "p50": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "50th percentile request latency (milliseconds).",
                        "title": "P50"
                    },
                    "p95": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "95th percentile request latency (milliseconds).",
                        "title": "P95"
                    },
                    "p99": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "99th percentile request latency (milliseconds).",
                        "title": "P99"
                    }
                },
                "required": [
                    "timestamp"
                ],
                "title": "ResponseTimeDatapointV1",
                "type": "object"
            },
            "GetLoopsDeploymentMetricsResponseV1": {
                "description": "Response for ``POST /v1/loops/deployments/<id>/metrics``.",
                "properties": {
                    "deployment_id": {
                        "description": "The trainer deployment ID.",
                        "title": "Deployment Id",
                        "type": "string"
                    },
                    "metrics": {
                        "$ref": "#/components/schemas/LoopsDeploymentMetricsV1",
                        "description": "Metrics for the deployment."
                    }
                },
                "required": [
                    "deployment_id",
                    "metrics"
                ],
                "title": "GetLoopsDeploymentMetricsResponseV1",
                "type": "object"
            },
            "GetLoopsDeploymentLogsRequestV1": {
                "description": "Query parameters for fetching a Loops deployment's logs.",
                "properties": {
                    "start_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to start fetching logs. Defaults to 30 minutes before the end. The window from start to end must not exceed 7 days.",
                        "title": "Start Epoch Millis"
                    },
                    "end_epoch_millis": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Epoch milliseconds at which to stop fetching logs. Defaults to the current time.",
                        "title": "End Epoch Millis"
                    },
                    "direction": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/SortOrderV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Sort order for logs"
                    },
                    "limit": {
                        "anyOf": [
                            {
                                "maximum": 1000,
                                "minimum": 1,
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": 500,
                        "description": "Limit of logs to fetch in a single request",
                        "title": "Limit"
                    },
                    "min_level": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/LogLevelV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Minimum log severity to include. Omit to return all log lines, including lines that have no level. Any explicit value returns lines at or above that severity and drops lines without a level."
                    }
                },
                "title": "GetLoopsDeploymentLogsRequestV1",
                "type": "object"
            },
            "TeamTrainingGpuCapacityItemV1": {
                "description": "Per-team GPU capacity and current usage for one GPU type.",
                "properties": {
                    "team_id": {
                        "description": "Team identifier",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "team_name": {
                        "description": "Team name",
                        "title": "Team Name",
                        "type": "string"
                    },
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "baseline": {
                        "description": "Baseline GPU allocation for the team. 0 if not configured.",
                        "title": "Baseline",
                        "type": "integer"
                    },
                    "limit": {
                        "description": "Maximum concurrent GPUs of this type for this team",
                        "title": "Limit",
                        "type": "integer"
                    },
                    "usage_count": {
                        "description": "GPUs currently in use by the team's active training jobs",
                        "title": "Usage Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "team_id",
                    "team_name",
                    "gpu_type",
                    "baseline",
                    "limit",
                    "usage_count"
                ],
                "title": "TeamTrainingGpuCapacityItemV1",
                "type": "object"
            },
            "TrainingGpuCapacityItemV1": {
                "description": "GPU capacity and current usage for one GPU type.",
                "properties": {
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "baseline": {
                        "description": "Baseline GPU allocation; jobs below this threshold are expected to run immediately. 0 if not configured.",
                        "title": "Baseline",
                        "type": "integer"
                    },
                    "limit": {
                        "description": "Maximum concurrent GPUs of this type for this org",
                        "title": "Limit",
                        "type": "integer"
                    },
                    "usage_count": {
                        "description": "GPUs currently in use by active training jobs",
                        "title": "Usage Count",
                        "type": "integer"
                    }
                },
                "required": [
                    "gpu_type",
                    "baseline",
                    "limit",
                    "usage_count"
                ],
                "title": "TrainingGpuCapacityItemV1",
                "type": "object"
            },
            "GetTrainingGpuCapacityResponseV1": {
                "description": "Response for the training GPU capacity endpoint.",
                "properties": {
                    "gpu_capacities": {
                        "description": "Org-level GPU capacity limits and current usage per GPU type",
                        "items": {
                            "$ref": "#/components/schemas/TrainingGpuCapacityItemV1"
                        },
                        "title": "Gpu Capacities",
                        "type": "array"
                    },
                    "team_gpu_capacities": {
                        "description": "Per-team GPU capacity limits and current usage per GPU type",
                        "items": {
                            "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1"
                        },
                        "title": "Team Gpu Capacities",
                        "type": "array"
                    }
                },
                "required": [
                    "gpu_capacities"
                ],
                "title": "GetTrainingGpuCapacityResponseV1",
                "type": "object"
            },
            "PatchTeamTrainingGpuCapacityRequestV1": {
                "description": "A request to set the GPU capacity ceiling for a (team, gpu_type) pair.\n\nCreates the limit if one doesn't already exist for this team and GPU type,\notherwise updates it in place.",
                "properties": {
                    "team_id": {
                        "description": "Team identifier",
                        "title": "Team Id",
                        "type": "string"
                    },
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "max_gpus": {
                        "description": "Max concurrent GPUs of this type the team may use",
                        "examples": [
                            8,
                            16,
                            32
                        ],
                        "title": "Max Gpus",
                        "type": "integer"
                    }
                },
                "required": [
                    "team_id",
                    "gpu_type",
                    "max_gpus"
                ],
                "title": "PatchTeamTrainingGpuCapacityRequestV1",
                "type": "object"
            },
            "PatchTeamTrainingGpuCapacityResponseV1": {
                "description": "Response for setting a team's GPU capacity ceiling.",
                "properties": {
                    "team_gpu_capacity": {
                        "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1",
                        "description": "The updated per-team GPU capacity limit"
                    }
                },
                "required": [
                    "team_gpu_capacity"
                ],
                "title": "PatchTeamTrainingGpuCapacityResponseV1",
                "type": "object"
            },
            "ActiveJobAtSubmitV1": {
                "description": "One other job in the same (org, gpu_type) pool that was holding GPU\ncapacity at the moment the target was submitted.",
                "properties": {
                    "training_job_id": {
                        "description": "Hashid of the other training job",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "training_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Other job's name",
                        "title": "Training Job Name"
                    },
                    "instance_type_name": {
                        "description": "Instance type of the other job",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "total_gpus": {
                        "description": "gpu_count * effective_node_count",
                        "title": "Total Gpus",
                        "type": "integer"
                    },
                    "workload_plane_name": {
                        "description": "Workload plane the other job was on",
                        "title": "Workload Plane Name",
                        "type": "string"
                    },
                    "status_at_submit": {
                        "description": "Other job's status as of submitted_at (one of ACTIVE_STATES)",
                        "title": "Status At Submit",
                        "type": "string"
                    },
                    "status_set_at": {
                        "description": "When that status was set",
                        "format": "date-time",
                        "title": "Status Set At",
                        "type": "string"
                    }
                },
                "required": [
                    "training_job_id",
                    "instance_type_name",
                    "total_gpus",
                    "workload_plane_name",
                    "status_at_submit",
                    "status_set_at"
                ],
                "title": "ActiveJobAtSubmitV1",
                "type": "object"
            },
            "CapacityAtSubmitV1": {
                "description": "A GPU capacity row as it stands now, with ``last_modified`` so callers\ncan judge whether the value matches what the dequeue gate saw at submit\ntime. Capacity rows are not historicized: edits overwrite in place. Compare\n``last_modified`` against the response's ``submitted_at`` \u2014 if it's later,\nthe value may have changed.",
                "properties": {
                    "gpu_type": {
                        "description": "GPU type identifier (e.g. H100, A100-40GB)",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "max_gpus": {
                        "description": "Current max concurrent GPUs of this type",
                        "title": "Max Gpus",
                        "type": "integer"
                    },
                    "min_gpus": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Current baseline GPU allocation, if configured",
                        "title": "Min Gpus"
                    },
                    "last_modified": {
                        "description": "When the capacity row was last modified",
                        "format": "date-time",
                        "title": "Last Modified",
                        "type": "string"
                    }
                },
                "required": [
                    "gpu_type",
                    "max_gpus",
                    "last_modified"
                ],
                "title": "CapacityAtSubmitV1",
                "type": "object"
            },
            "PendingJobAheadAtSubmitV1": {
                "description": "A PENDING job in the same (org, gpu_type) pool that was ahead of the\ntarget in dequeue FIFO order at submitted_at \u2014 higher priority, or same\npriority and earlier submission.",
                "properties": {
                    "training_job_id": {
                        "description": "Hashid of the other training job",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "training_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Other job's name",
                        "title": "Training Job Name"
                    },
                    "instance_type_name": {
                        "description": "Instance type of the other job",
                        "title": "Instance Type Name",
                        "type": "string"
                    },
                    "requested_gpus": {
                        "description": "gpu_count * effective_node_count",
                        "title": "Requested Gpus",
                        "type": "integer"
                    },
                    "priority": {
                        "description": "Effective priority (NULL coalesced to 0)",
                        "title": "Priority",
                        "type": "integer"
                    },
                    "submitted_at": {
                        "description": "The other job's submission time",
                        "format": "date-time",
                        "title": "Submitted At",
                        "type": "string"
                    }
                },
                "required": [
                    "training_job_id",
                    "instance_type_name",
                    "requested_gpus",
                    "priority",
                    "submitted_at"
                ],
                "title": "PendingJobAheadAtSubmitV1",
                "type": "object"
            },
            "QueueEventV1": {
                "description": "A single ``TrainingJobStatus`` row inside the queue-context window.",
                "properties": {
                    "training_job_id": {
                        "description": "Hashid of the training job this event is for",
                        "title": "Training Job Id",
                        "type": "string"
                    },
                    "training_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Job name",
                        "title": "Training Job Name"
                    },
                    "status": {
                        "description": "TrainingJobStatus.Name value",
                        "title": "Status",
                        "type": "string"
                    },
                    "created": {
                        "description": "When the status row was inserted",
                        "format": "date-time",
                        "title": "Created",
                        "type": "string"
                    },
                    "event_message": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Human-readable event message from the status metadata",
                        "title": "Event Message"
                    },
                    "exit_code": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Exit code from the status metadata, if any",
                        "title": "Exit Code"
                    }
                },
                "required": [
                    "training_job_id",
                    "status",
                    "created"
                ],
                "title": "QueueEventV1",
                "type": "object"
            },
            "GetTrainingJobQueueContextResponseV1": {
                "description": "Read-only diagnostic for a training job's PENDING window.\n\nReturns the (org, gpu_type) capacity pool the job was gated by, jobs that\nwere holding GPU capacity in that pool when this job was submitted, and\nevery status event in [submitted_at, released_at] for those jobs (or up to\n\"now\" if the target is still PENDING).",
                "properties": {
                    "target_job_id": {
                        "description": "Hashid of the target training job",
                        "title": "Target Job Id",
                        "type": "string"
                    },
                    "target_job_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Target job's name",
                        "title": "Target Job Name"
                    },
                    "gpu_type": {
                        "description": "GPU type the target requested",
                        "title": "Gpu Type",
                        "type": "string"
                    },
                    "requested_gpus": {
                        "description": "GPUs the target requested (gpu_count * effective_node_count)",
                        "title": "Requested Gpus",
                        "type": "integer"
                    },
                    "submitted_at": {
                        "description": "When the job row was inserted (= API POST time)",
                        "format": "date-time",
                        "title": "Submitted At",
                        "type": "string"
                    },
                    "released_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the job's TRAINING_JOB_CREATED status was set, i.e. the moment it was released from PENDING. None if still PENDING.",
                        "title": "Released At"
                    },
                    "pending_seconds": {
                        "anyOf": [
                            {
                                "type": "integer"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "released_at - submitted_at in seconds. None if still PENDING.",
                        "title": "Pending Seconds"
                    },
                    "org_capacity": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CapacityAtSubmitV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Org-level cap for (org, gpu_type). None if no cap is configured."
                    },
                    "team_capacity": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/CapacityAtSubmitV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Team-level cap for (team, gpu_type). None if no team cap is configured."
                    },
                    "active_at_submit": {
                        "description": "Jobs in the same (org, gpu_type) pool that were holding capacity at submitted_at",
                        "items": {
                            "$ref": "#/components/schemas/ActiveJobAtSubmitV1"
                        },
                        "title": "Active At Submit",
                        "type": "array"
                    },
                    "pending_ahead_at_submit": {
                        "description": "PENDING jobs in the same (org, gpu_type) pool that were ahead of the target in dequeue FIFO order at submitted_at (priority DESC then created ASC). These also block the target's release.",
                        "items": {
                            "$ref": "#/components/schemas/PendingJobAheadAtSubmitV1"
                        },
                        "title": "Pending Ahead At Submit",
                        "type": "array"
                    },
                    "events": {
                        "description": "Every status event in [submitted_at, events_window_end] for the target job, every job in active_at_submit, and every job in pending_ahead_at_submit, oldest first.",
                        "items": {
                            "$ref": "#/components/schemas/QueueEventV1"
                        },
                        "title": "Events",
                        "type": "array"
                    },
                    "events_window_end": {
                        "description": "released_at if set, else 'now' (events ongoing)",
                        "format": "date-time",
                        "title": "Events Window End",
                        "type": "string"
                    }
                },
                "required": [
                    "target_job_id",
                    "gpu_type",
                    "requested_gpus",
                    "submitted_at",
                    "active_at_submit",
                    "pending_ahead_at_submit",
                    "events",
                    "events_window_end"
                ],
                "title": "GetTrainingJobQueueContextResponseV1",
                "type": "object"
            },
            "GetBlobCredentialsResponseV1": {
                "description": "Response to create a new set of credentials for blob upload.",
                "properties": {
                    "creds": {
                        "$ref": "#/components/schemas/AWSCredentialsV1",
                        "description": "The credentials to upload the blob to"
                    },
                    "s3_key": {
                        "description": "The S3 key to upload the blob to",
                        "title": "S3 Key",
                        "type": "string"
                    },
                    "s3_bucket": {
                        "description": "The S3 bucket to upload the blob to",
                        "title": "S3 Bucket",
                        "type": "string"
                    }
                },
                "required": [
                    "creds",
                    "s3_key",
                    "s3_bucket"
                ],
                "title": "GetBlobCredentialsResponseV1",
                "type": "object"
            },
            "APIKeyCategory": {
                "description": "Enum representing the category of an API key.",
                "enum": [
                    "PERSONAL",
                    "WORKSPACE_MANAGE_ALL",
                    "WORKSPACE_EXPORT_METRICS",
                    "WORKSPACE_INVOKE"
                ],
                "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",
                            "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"
                    }
                },
                "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",
                            "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"
                    }
                },
                "required": [
                    "prefix",
                    "type"
                ],
                "title": "APIKeyInfoV1",
                "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"
            },
            "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"
            },
            "ModelWeightSnapshotV1": {
                "description": "A model weight snapshot.",
                "properties": {
                    "model": {
                        "description": "Unique identifier of the model",
                        "title": "Model",
                        "type": "string"
                    },
                    "snapshot_uri": {
                        "description": "Path to the model weight snapshot",
                        "title": "Snapshot Uri",
                        "type": "string"
                    },
                    "received_at": {
                        "description": "Time of the snapshot",
                        "format": "date-time",
                        "title": "Received At",
                        "type": "string"
                    }
                },
                "required": [
                    "model",
                    "snapshot_uri",
                    "received_at"
                ],
                "title": "ModelWeightSnapshotV1",
                "type": "object"
            },
            "CreateModelWeightSnapshotRequestV1": {
                "description": "A request to create a model weight snapshot.",
                "properties": {
                    "model": {
                        "description": "Unique identifier of the model",
                        "title": "Model",
                        "type": "string"
                    },
                    "snapshot_uri": {
                        "description": "Path to the model weight snapshot",
                        "title": "Snapshot Uri",
                        "type": "string"
                    }
                },
                "required": [
                    "model",
                    "snapshot_uri"
                ],
                "title": "CreateModelWeightSnapshotRequestV1",
                "type": "object"
            },
            "LimitTypeV1": {
                "enum": [
                    "REQUEST",
                    "TOKEN"
                ],
                "title": "LimitTypeV1",
                "type": "string"
            },
            "ModelAPIOrgDetailsV1": {
                "description": "Workspace-specific state for a Model API.",
                "properties": {
                    "added_at": {
                        "description": "When the workspace first added this Model API.",
                        "format": "date-time",
                        "title": "Added At",
                        "type": "string"
                    },
                    "last_used_at": {
                        "anyOf": [
                            {
                                "format": "date-time",
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "When the workspace last invoked this Model API. Null if the workspace has never invoked it.",
                        "title": "Last Used At"
                    }
                },
                "required": [
                    "added_at"
                ],
                "title": "ModelAPIOrgDetailsV1",
                "type": "object"
            },
            "ModelAPIV1": {
                "description": "A Model API catalog row, optionally enriched with workspace-specific state.",
                "properties": {
                    "name": {
                        "description": "Identifier of the Model API. Stable, URL-safe slug used as the public identifier.",
                        "examples": [
                            "llama-3-3-70b-instruct"
                        ],
                        "title": "Name",
                        "type": "string"
                    },
                    "display_name": {
                        "description": "Human-readable name of the Model API.",
                        "examples": [
                            "Llama 3.3 70B Instruct"
                        ],
                        "title": "Display Name",
                        "type": "string"
                    },
                    "description": {
                        "description": "Description of the Model API.",
                        "title": "Description",
                        "type": "string"
                    },
                    "model_family": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Family the underlying model belongs to.",
                        "examples": [
                            "META",
                            "DEEPSEEK",
                            "QWEN"
                        ],
                        "title": "Model Family"
                    },
                    "release_date": {
                        "description": "Date the Model API was made available.",
                        "format": "date",
                        "title": "Release Date",
                        "type": "string"
                    },
                    "invoke_url": {
                        "description": "Base URL for invoking the Model API. OpenAI-shaped routes (e.g. /v1/chat/completions) live underneath this host.",
                        "examples": [
                            "https://inference.baseten.co"
                        ],
                        "title": "Invoke Url",
                        "type": "string"
                    },
                    "context_length": {
                        "description": "The model's context window length, in tokens.",
                        "examples": [
                            8192
                        ],
                        "title": "Context Length",
                        "type": "integer"
                    },
                    "cost_per_million_input_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost per million input tokens, in dollars.",
                        "examples": [
                            "0.13"
                        ],
                        "title": "Cost Per Million Input Tokens"
                    },
                    "cost_per_million_output_tokens": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Cost per million output tokens, in dollars.",
                        "examples": [
                            "0.50"
                        ],
                        "title": "Cost Per Million Output Tokens"
                    },
                    "rate_limits": {
                        "description": "Rate limits in effect for the workspace. Workspace-specific overrides are returned when the workspace has added this Model API and configured them; otherwise the catalog default rate limits are returned.",
                        "items": {
                            "$ref": "#/components/schemas/RateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "org_details": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ModelAPIOrgDetailsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Workspace-specific state. Null when the workspace has not added this Model API."
                    }
                },
                "required": [
                    "name",
                    "display_name",
                    "description",
                    "release_date",
                    "invoke_url",
                    "context_length",
                    "cost_per_million_input_tokens",
                    "cost_per_million_output_tokens",
                    "rate_limits"
                ],
                "title": "ModelAPIV1",
                "type": "object"
            },
            "RateLimitUnitV1": {
                "enum": [
                    "SECOND",
                    "MINUTE"
                ],
                "title": "RateLimitUnitV1",
                "type": "string"
            },
            "RateLimitV1": {
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/LimitTypeV1",
                        "description": "The type of the rate limit",
                        "examples": [
                            "TOKEN",
                            "REQUEST"
                        ]
                    },
                    "unit": {
                        "$ref": "#/components/schemas/RateLimitUnitV1",
                        "description": "The unit of the rate limit",
                        "examples": [
                            "SECOND",
                            "MINUTE"
                        ]
                    },
                    "threshold": {
                        "description": "The threshold for the rate limit",
                        "examples": [
                            1000,
                            50000
                        ],
                        "minimum": 0,
                        "title": "Threshold",
                        "type": "integer"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold"
                ],
                "title": "RateLimitV1",
                "type": "object"
            },
            "ModelAPIsResponseV1": {
                "description": "Page of Model APIs visible to the caller.",
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/ModelAPIV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "ModelAPIsResponseV1",
                "type": "object"
            },
            "ModelAPIsRequestV1": {
                "description": "Query-string filters for ``GET /v1/model_apis``.",
                "properties": {
                    "cursor": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.",
                        "title": "Cursor"
                    },
                    "limit": {
                        "default": 100,
                        "description": "Maximum number of items to return.",
                        "maximum": 1000,
                        "minimum": 1,
                        "title": "Limit",
                        "type": "integer"
                    },
                    "added_only": {
                        "default": false,
                        "description": "When true, restrict the result to Model APIs the workspace has added. Defaults to the full visible catalog.",
                        "title": "Added Only",
                        "type": "boolean"
                    }
                },
                "title": "ModelAPIsRequestV1",
                "type": "object"
            },
            "CreateLLMModelRequestV1": {
                "description": "A request to create a BIS LLM model",
                "properties": {
                    "resources": {
                        "additionalProperties": true,
                        "description": "Resources allocated to the model",
                        "title": "Resources",
                        "type": "object"
                    },
                    "llm_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Version of the helm chart to use.",
                        "title": "Llm Version"
                    },
                    "llm_config": {
                        "additionalProperties": true,
                        "description": "Configuration specific to the LLM model",
                        "title": "Llm Config",
                        "type": "object"
                    },
                    "environment_variables": {
                        "additionalProperties": true,
                        "description": "Environment variables for the model",
                        "title": "Environment Variables",
                        "type": "object"
                    },
                    "model_metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model metadata persisted into model_config",
                        "title": "Model Metadata"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the model",
                        "examples": [
                            {
                                "autoscaling_window": 600,
                                "concurrency_target": null,
                                "max_replica": 5,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 300,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "additional_autoscaling_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Additional autoscaling configuration (e.g. target in-flight tokens)",
                        "examples": [
                            {
                                "metrics": [
                                    {
                                        "name": "in_flight_tokens",
                                        "target": 40000
                                    }
                                ]
                            }
                        ],
                        "title": "Additional Autoscaling Config"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-defined metadata for the deployment",
                        "examples": [
                            {
                                "environment": "production",
                                "git_sha": "abc123"
                            }
                        ],
                        "title": "Metadata"
                    },
                    "weights": {
                        "anyOf": [
                            {
                                "items": {
                                    "additionalProperties": true,
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Weight configurations for BDN model weight distribution",
                        "examples": [
                            [
                                {
                                    "mount_location": "/models/base",
                                    "source": "hf://meta-llama/Llama-3-8B"
                                }
                            ]
                        ],
                        "title": "Weights"
                    },
                    "name": {
                        "description": "Name of the model",
                        "title": "Name",
                        "type": "string"
                    }
                },
                "required": [
                    "resources",
                    "name"
                ],
                "title": "CreateLLMModelRequestV1",
                "type": "object"
            },
            "LLMModelHandleV1": {
                "description": "Handle for a BIS LLM model deployment.",
                "properties": {
                    "model_id": {
                        "description": "Unique identifier of the model",
                        "title": "Model Id",
                        "type": "string"
                    },
                    "version_id": {
                        "description": "Unique identifier of the model version",
                        "title": "Version Id",
                        "type": "string"
                    },
                    "hostname": {
                        "description": "Hostname used to invoke the model",
                        "title": "Hostname",
                        "type": "string"
                    },
                    "instance_type_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the instance type the model deployment is running on",
                        "title": "Instance Type Name"
                    }
                },
                "required": [
                    "model_id",
                    "version_id",
                    "hostname"
                ],
                "title": "LLMModelHandleV1",
                "type": "object"
            },
            "CreateLLMModelVersionRequestV1": {
                "description": "A request to create a BIS LLM model version",
                "properties": {
                    "resources": {
                        "additionalProperties": true,
                        "description": "Resources allocated to the model",
                        "title": "Resources",
                        "type": "object"
                    },
                    "llm_version": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Version of the helm chart to use.",
                        "title": "Llm Version"
                    },
                    "llm_config": {
                        "additionalProperties": true,
                        "description": "Configuration specific to the LLM model",
                        "title": "Llm Config",
                        "type": "object"
                    },
                    "environment_variables": {
                        "additionalProperties": true,
                        "description": "Environment variables for the model",
                        "title": "Environment Variables",
                        "type": "object"
                    },
                    "model_metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model metadata persisted into model_config",
                        "title": "Model Metadata"
                    },
                    "autoscaling_settings": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/UpdateAutoscalingSettingsV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Autoscaling settings for the model",
                        "examples": [
                            {
                                "autoscaling_window": 600,
                                "concurrency_target": null,
                                "max_replica": 5,
                                "max_scale_down_rate": null,
                                "min_replica": 1,
                                "scale_down_delay": 300,
                                "target_in_flight_tokens": null,
                                "target_utilization_percentage": null
                            }
                        ]
                    },
                    "additional_autoscaling_config": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Additional autoscaling configuration (e.g. target in-flight tokens)",
                        "examples": [
                            {
                                "metrics": [
                                    {
                                        "name": "in_flight_tokens",
                                        "target": 40000
                                    }
                                ]
                            }
                        ],
                        "title": "Additional Autoscaling Config"
                    },
                    "metadata": {
                        "anyOf": [
                            {
                                "additionalProperties": true,
                                "type": "object"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "User-defined metadata for the deployment",
                        "examples": [
                            {
                                "environment": "production",
                                "git_sha": "abc123"
                            }
                        ],
                        "title": "Metadata"
                    },
                    "weights": {
                        "anyOf": [
                            {
                                "items": {
                                    "additionalProperties": true,
                                    "type": "object"
                                },
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Weight configurations for BDN model weight distribution",
                        "examples": [
                            [
                                {
                                    "mount_location": "/models/base",
                                    "source": "hf://meta-llama/Llama-3-8B"
                                }
                            ]
                        ],
                        "title": "Weights"
                    }
                },
                "required": [
                    "resources"
                ],
                "title": "CreateLLMModelVersionRequestV1",
                "type": "object"
            },
            "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"
                    },
                    "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"
                    }
                },
                "required": [
                    "display_name",
                    "user_defined_id",
                    "is_public",
                    "closed_source",
                    "created_at",
                    "modified_at"
                ],
                "title": "LibraryListingV1",
                "type": "object"
            },
            "LibraryListingsV1": {
                "description": "A list of library listings.",
                "properties": {
                    "listings": {
                        "items": {
                            "$ref": "#/components/schemas/LibraryListingV1"
                        },
                        "title": "Listings",
                        "type": "array"
                    }
                },
                "required": [
                    "listings"
                ],
                "title": "LibraryListingsV1",
                "type": "object"
            },
            "CreateLibraryListingRequestV1": {
                "description": "Request to create a new library listing.",
                "properties": {
                    "display_name": {
                        "description": "Display name of the library listing",
                        "title": "Display Name",
                        "type": "string"
                    },
                    "user_defined_id": {
                        "description": "User-defined identifier of the library listing",
                        "title": "User Defined Id",
                        "type": "string"
                    },
                    "is_public": {
                        "default": false,
                        "description": "Whether the listing is publicly accessible",
                        "title": "Is Public",
                        "type": "boolean"
                    },
                    "closed_source": {
                        "default": false,
                        "description": "Whether the listing is closed source (deployers cannot view or download the Truss, and forks copy mirrored weights instead of re-mirroring from upstream)",
                        "title": "Closed Source",
                        "type": "boolean"
                    }
                },
                "required": [
                    "display_name",
                    "user_defined_id"
                ],
                "title": "CreateLibraryListingRequestV1",
                "type": "object"
            },
            "LibraryListingTombstoneV1": {
                "description": "A library listing tombstone.",
                "properties": {
                    "user_defined_id": {
                        "description": "User-defined identifier of the library listing",
                        "title": "User Defined Id",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the library listing was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "user_defined_id",
                    "deleted"
                ],
                "title": "LibraryListingTombstoneV1",
                "type": "object"
            },
            "UpdateLibraryListingRequestV1": {
                "description": "Request to update a library listing.",
                "properties": {
                    "display_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "New display name for the library listing",
                        "title": "Display Name"
                    },
                    "is_public": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether the listing is publicly accessible",
                        "title": "Is Public"
                    }
                },
                "title": "UpdateLibraryListingRequestV1",
                "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"
                    }
                },
                "required": [
                    "version_tag",
                    "is_live",
                    "allow_truss_download",
                    "oracle_version_id",
                    "created_at",
                    "modified_at"
                ],
                "title": "LibraryListingVersionV1",
                "type": "object"
            },
            "LibraryListingVersionsV1": {
                "description": "A list of library listing versions.",
                "properties": {
                    "versions": {
                        "items": {
                            "$ref": "#/components/schemas/LibraryListingVersionV1"
                        },
                        "title": "Versions",
                        "type": "array"
                    }
                },
                "required": [
                    "versions"
                ],
                "title": "LibraryListingVersionsV1",
                "type": "object"
            },
            "CreateLibraryListingVersionRequestV1": {
                "description": "Request to create a new library listing version from an existing model version.",
                "properties": {
                    "display_name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Display name of the library listing. Required when creating a new listing.",
                        "title": "Display Name"
                    },
                    "is_public": {
                        "default": false,
                        "description": "Whether the listing is publicly accessible. Only used when creating a new listing.",
                        "title": "Is Public",
                        "type": "boolean"
                    },
                    "oracle_version_id": {
                        "description": "Id of the source model version to publish",
                        "title": "Oracle Version Id",
                        "type": "string"
                    },
                    "allow_truss_download": {
                        "default": false,
                        "description": "Whether users deploying this model can download the Truss",
                        "title": "Allow Truss Download",
                        "type": "boolean"
                    },
                    "closed_source": {
                        "default": false,
                        "description": "Whether the listing is closed source (deployers cannot view or download the Truss, and forks copy mirrored weights instead of re-mirroring from upstream). Only used when creating a new listing.",
                        "title": "Closed Source",
                        "type": "boolean"
                    },
                    "version_tag": {
                        "description": "Human-readable tag for this version",
                        "title": "Version Tag",
                        "type": "string"
                    }
                },
                "required": [
                    "oracle_version_id",
                    "version_tag"
                ],
                "title": "CreateLibraryListingVersionRequestV1",
                "type": "object"
            },
            "LibraryListingVersionTombstoneV1": {
                "description": "A library listing version tombstone.",
                "properties": {
                    "version_tag": {
                        "description": "Human-readable tag for this version",
                        "title": "Version Tag",
                        "type": "string"
                    },
                    "deleted": {
                        "description": "Whether the library listing version was deleted",
                        "title": "Deleted",
                        "type": "boolean"
                    }
                },
                "required": [
                    "version_tag",
                    "deleted"
                ],
                "title": "LibraryListingVersionTombstoneV1",
                "type": "object"
            },
            "UpdateLibraryListingVersionRequestV1": {
                "description": "Request to update a library listing version.",
                "properties": {
                    "is_live": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether this version should be the live version. Setting to true demotes the current live version.",
                        "title": "Is Live"
                    },
                    "allow_truss_download": {
                        "anyOf": [
                            {
                                "type": "boolean"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Whether users deploying this model can download the Truss",
                        "title": "Allow Truss Download"
                    }
                },
                "title": "UpdateLibraryListingVersionRequestV1",
                "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, TRAINING_JOB, or CHAINLET)"
                    },
                    "name": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Name of the resource",
                        "title": "Name"
                    },
                    "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"
                    },
                    "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"
                    }
                },
                "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"
                    },
                    "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",
                    "minutes",
                    "inference_requests"
                ],
                "title": "DailyDedicatedUsageV1",
                "type": "object"
            },
            "DailyModelApiUsageV1": {
                "properties": {
                    "date": {
                        "description": "Date of the usage",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost incurred on this date in dollars",
                        "title": "Subtotal"
                    },
                    "input_tokens": {
                        "description": "Number of input tokens on this date",
                        "title": "Input Tokens",
                        "type": "integer"
                    },
                    "output_tokens": {
                        "description": "Number of output tokens on this date",
                        "title": "Output Tokens",
                        "type": "integer"
                    },
                    "cached_input_tokens": {
                        "description": "Number of cached input tokens on this date",
                        "title": "Cached Input Tokens",
                        "type": "integer"
                    }
                },
                "required": [
                    "date",
                    "subtotal",
                    "input_tokens",
                    "output_tokens",
                    "cached_input_tokens"
                ],
                "title": "DailyModelApiUsageV1",
                "type": "object"
            },
            "DailyTrainingUsageV1": {
                "properties": {
                    "date": {
                        "description": "Date of the usage",
                        "format": "date",
                        "title": "Date",
                        "type": "string"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost incurred on this date in dollars",
                        "title": "Subtotal"
                    },
                    "minutes": {
                        "description": "Minutes used on this date",
                        "title": "Minutes",
                        "type": "integer"
                    }
                },
                "required": [
                    "date",
                    "subtotal",
                    "minutes"
                ],
                "title": "DailyTrainingUsageV1",
                "type": "object"
            },
            "DedicatedItemV1": {
                "properties": {
                    "billable_resource": {
                        "$ref": "#/components/schemas/BillableResourceV1",
                        "description": "The model deployment resource"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars for this billable resource",
                        "title": "Subtotal"
                    },
                    "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",
                    "minutes",
                    "inference_requests"
                ],
                "title": "DedicatedItemV1",
                "type": "object"
            },
            "DedicatedUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars after applying credits used",
                        "title": "Subtotal"
                    },
                    "credits_used": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Credits applied in dollars",
                        "title": "Credits Used"
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Total cost in dollars",
                        "title": "Total"
                    },
                    "minutes": {
                        "description": "Total minutes used",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "breakdown": {
                        "description": "Per-deployment usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DedicatedItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total",
                    "minutes"
                ],
                "title": "DedicatedUsageV1",
                "type": "object"
            },
            "ModelApiItemV1": {
                "properties": {
                    "model_name": {
                        "description": "Model name",
                        "title": "Model Name",
                        "type": "string"
                    },
                    "model_family": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model family (e.g., llama, mistral)",
                        "title": "Model Family"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars for this model",
                        "title": "Subtotal"
                    },
                    "input_tokens": {
                        "description": "Total input tokens for this model",
                        "title": "Input Tokens",
                        "type": "integer"
                    },
                    "output_tokens": {
                        "description": "Total output tokens for this model",
                        "title": "Output Tokens",
                        "type": "integer"
                    },
                    "cached_input_tokens": {
                        "description": "Total cached input tokens for this model",
                        "title": "Cached Input Tokens",
                        "type": "integer"
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyModelApiUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    }
                },
                "required": [
                    "model_name",
                    "subtotal",
                    "input_tokens",
                    "output_tokens",
                    "cached_input_tokens"
                ],
                "title": "ModelApiItemV1",
                "type": "object"
            },
            "ModelApisUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars after applying credits used",
                        "title": "Subtotal"
                    },
                    "credits_used": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Credits applied in dollars",
                        "title": "Credits Used"
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Total cost in dollars",
                        "title": "Total"
                    },
                    "breakdown": {
                        "description": "Per-model usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/ModelApiItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total"
                ],
                "title": "ModelApisUsageV1",
                "type": "object"
            },
            "ResourceKind": {
                "enum": [
                    "MODEL_DEPLOYMENT",
                    "TRAINING_JOB",
                    "CHAINLET"
                ],
                "title": "ResourceKind",
                "type": "string"
            },
            "TrainingItemV1": {
                "properties": {
                    "billable_resource": {
                        "$ref": "#/components/schemas/BillableResourceV1",
                        "description": "The training job resource"
                    },
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars for this billable resource",
                        "title": "Subtotal"
                    },
                    "minutes": {
                        "description": "Total minutes used for this billable resource",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "daily": {
                        "description": "Daily usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/DailyTrainingUsageV1"
                        },
                        "title": "Daily",
                        "type": "array"
                    }
                },
                "required": [
                    "billable_resource",
                    "subtotal",
                    "minutes"
                ],
                "title": "TrainingItemV1",
                "type": "object"
            },
            "TrainingUsageV1": {
                "properties": {
                    "subtotal": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Subtotal cost in dollars after applying credits used",
                        "title": "Subtotal"
                    },
                    "credits_used": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Credits applied in dollars",
                        "title": "Credits Used"
                    },
                    "total": {
                        "anyOf": [
                            {
                                "type": "number"
                            },
                            {
                                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                                "type": "string"
                            }
                        ],
                        "description": "Total cost in dollars",
                        "title": "Total"
                    },
                    "minutes": {
                        "description": "Total minutes used",
                        "title": "Minutes",
                        "type": "integer"
                    },
                    "breakdown": {
                        "description": "Per-job usage breakdown",
                        "items": {
                            "$ref": "#/components/schemas/TrainingItemV1"
                        },
                        "title": "Breakdown",
                        "type": "array"
                    }
                },
                "required": [
                    "subtotal",
                    "credits_used",
                    "total",
                    "minutes"
                ],
                "title": "TrainingUsageV1",
                "type": "object"
            },
            "UsageSummaryV1": {
                "description": "Billing usage summary for the requested date range.",
                "properties": {
                    "dedicated_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/DedicatedUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Dedicated model serving usage"
                    },
                    "training_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/TrainingUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Training usage"
                    },
                    "model_apis_usage": {
                        "anyOf": [
                            {
                                "$ref": "#/components/schemas/ModelApisUsageV1"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Model APIs usage"
                    }
                },
                "title": "UsageSummaryV1",
                "type": "object"
            },
            "UsageSummaryRequestV1": {
                "properties": {
                    "start_date": {
                        "description": "Start date (ISO 8601, UTC). Earliest queryable: 2026-01-01.",
                        "format": "date-time",
                        "title": "Start Date",
                        "type": "string"
                    },
                    "end_date": {
                        "description": "End date in ISO 8601 format (UTC). Date range cannot exceed 31 days.",
                        "format": "date-time",
                        "title": "End Date",
                        "type": "string"
                    }
                },
                "required": [
                    "start_date",
                    "end_date"
                ],
                "title": "UsageSummaryRequestV1",
                "type": "object"
            },
            "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"
                    }
                },
                "title": "UsersRequestV1",
                "type": "object"
            },
            "EndpointTargetV1": {
                "description": "One configured upstream target of an endpoint.",
                "properties": {
                    "provider": {
                        "$ref": "#/components/schemas/GatewayProvider",
                        "description": "Upstream provider."
                    },
                    "secret_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Referenced secret, if any.",
                        "title": "Secret Id"
                    },
                    "target_model": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Upstream model name, if any.",
                        "title": "Target Model"
                    },
                    "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"
                    }
                },
                "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"
                    },
                    "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",
                    "created_at",
                    "updated_at",
                    "targets"
                ],
                "title": "EndpointV1",
                "type": "object"
            },
            "GatewayProvider": {
                "description": "Customer-facing provider for an endpoint target.\n\nExternal providers resolve to a fixed upstream host + protocol adapter via\n``external_provider_configs()``; ``BASETEN`` derives its host from the referenced oracle.",
                "enum": [
                    "ANTHROPIC",
                    "OPENAI",
                    "BASETEN",
                    "BASETEN_MODEL_API",
                    "VERTEX"
                ],
                "title": "GatewayProvider",
                "type": "string"
            },
            "EndpointsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/EndpointV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "EndpointsResponseV1",
                "type": "object"
            },
            "EndpointTargetRequestV1": {
                "description": "One desired upstream target. The customer picks a provider; Baseten owns the\nupstream host and protocol adapter.",
                "properties": {
                    "provider": {
                        "$ref": "#/components/schemas/GatewayProvider",
                        "description": "Upstream provider for this target.",
                        "examples": [
                            "ANTHROPIC",
                            "OPENAI",
                            "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"
                    },
                    "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"
                    }
                },
                "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"
                    },
                    "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"
                                }
                            ]
                        ],
                        "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"
                                }
                            ]
                        ],
                        "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",
                        "default": "INDEPENDENT",
                        "examples": [
                            "CASCADING",
                            "INDEPENDENT"
                        ]
                    },
                    "parent_group_id": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "examples": [
                            "abc123"
                        ],
                        "title": "Parent Group Id"
                    }
                },
                "title": "GroupHierarchyV1",
                "type": "object"
            },
            "GroupMetadataV1": {
                "properties": {
                    "name": {
                        "anyOf": [
                            {
                                "maxLength": 255,
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ],
                        "default": null,
                        "description": "Optional display name for the group.",
                        "examples": [
                            "Acme prod"
                        ],
                        "title": "Name"
                    },
                    "external_entity_id": {
                        "description": "External-system identifier for this group. Unique within the caller's org.",
                        "examples": [
                            "cust_42"
                        ],
                        "maxLength": 255,
                        "minLength": 1,
                        "title": "External Entity Id",
                        "type": "string"
                    }
                },
                "required": [
                    "external_entity_id"
                ],
                "title": "GroupMetadataV1",
                "type": "object"
            },
            "GroupV1": {
                "properties": {
                    "id": {
                        "description": "Internal Baseten ID for the group.",
                        "title": "Id",
                        "type": "string"
                    },
                    "metadata": {
                        "$ref": "#/components/schemas/GroupMetadataV1",
                        "description": "Group identity + display metadata."
                    },
                    "models": {
                        "items": {
                            "$ref": "#/components/schemas/ModelConfigV1"
                        },
                        "title": "Models",
                        "type": "array"
                    },
                    "effective_models": {
                        "items": {
                            "$ref": "#/components/schemas/EffectiveModelConfigV1"
                        },
                        "title": "Effective Models",
                        "type": "array"
                    },
                    "hierarchy": {
                        "$ref": "#/components/schemas/GroupHierarchyV1",
                        "description": "Parent linkage and limit enforcement mode. Parent is null for root groups."
                    },
                    "created_at": {
                        "description": "When this group was created.",
                        "format": "date-time",
                        "title": "Created At",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "metadata",
                    "hierarchy",
                    "created_at"
                ],
                "title": "GroupV1",
                "type": "object"
            },
            "LimitEnforcementV1": {
                "enum": [
                    "CASCADING",
                    "INDEPENDENT"
                ],
                "title": "LimitEnforcementV1",
                "type": "string"
            },
            "ModelConfigV1": {
                "properties": {
                    "slug": {
                        "description": "Shared endpoint slug.",
                        "title": "Slug",
                        "type": "string"
                    },
                    "rate_limits": {
                        "items": {
                            "$ref": "#/components/schemas/RateLimitV1"
                        },
                        "title": "Rate Limits",
                        "type": "array"
                    },
                    "usage_limits": {
                        "items": {
                            "$ref": "#/components/schemas/UsageLimitV1"
                        },
                        "title": "Usage Limits",
                        "type": "array"
                    }
                },
                "required": [
                    "slug"
                ],
                "title": "ModelConfigV1",
                "type": "object"
            },
            "UsageLimitUnitV1": {
                "enum": [
                    "DAY"
                ],
                "title": "UsageLimitUnitV1",
                "type": "string"
            },
            "UsageLimitV1": {
                "properties": {
                    "type": {
                        "$ref": "#/components/schemas/LimitTypeV1",
                        "description": "The type of the usage limit",
                        "examples": [
                            "REQUEST",
                            "TOKEN"
                        ]
                    },
                    "unit": {
                        "$ref": "#/components/schemas/UsageLimitUnitV1",
                        "description": "The unit of the usage limit",
                        "examples": [
                            "DAY"
                        ]
                    },
                    "threshold": {
                        "description": "The threshold for the usage limit",
                        "examples": [
                            10000000
                        ],
                        "minimum": 0,
                        "title": "Threshold",
                        "type": "integer"
                    }
                },
                "required": [
                    "type",
                    "unit",
                    "threshold"
                ],
                "title": "UsageLimitV1",
                "type": "object"
            },
            "GroupsResponseV1": {
                "properties": {
                    "items": {
                        "description": "Items in this page.",
                        "items": {
                            "$ref": "#/components/schemas/GroupV1"
                        },
                        "title": "Items",
                        "type": "array"
                    },
                    "pagination": {
                        "$ref": "#/components/schemas/PaginationResponseV1",
                        "description": "Pagination metadata for the page."
                    }
                },
                "required": [
                    "items",
                    "pagination"
                ],
                "title": "GroupsResponseV1",
                "type": "object"
            },
            "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.",
                        "items": {
                            "$ref": "#/components/schemas/ModelConfigV1"
                        },
                        "minItems": 1,
                        "title": "Models",
                        "type": "array"
                    },
                    "hierarchy": {
                        "$ref": "#/components/schemas/GroupHierarchyV1",
                        "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"
            }
        },
        "parameters": {
            "secret_name": {
                "schema": {
                    "type": "string"
                },
                "name": "secret_name",
                "in": "path",
                "required": true
            },
            "team_id": {
                "schema": {
                    "type": "string"
                },
                "name": "team_id",
                "in": "path",
                "required": true
            },
            "env_name": {
                "schema": {
                    "type": "string"
                },
                "name": "env_name",
                "in": "path",
                "required": true
            },
            "model_id": {
                "schema": {
                    "type": "string"
                },
                "name": "model_id",
                "in": "path",
                "required": true
            },
            "deployment_id": {
                "schema": {
                    "type": "string"
                },
                "name": "deployment_id",
                "in": "path",
                "required": true
            },
            "replica_id": {
                "schema": {
                    "type": "string"
                },
                "name": "replica_id",
                "in": "path",
                "required": true
            },
            "chain_id": {
                "schema": {
                    "type": "string"
                },
                "name": "chain_id",
                "in": "path",
                "required": true
            },
            "chain_deployment_id": {
                "schema": {
                    "type": "string"
                },
                "name": "chain_deployment_id",
                "in": "path",
                "required": true
            },
            "chainlet_id": {
                "schema": {
                    "type": "string"
                },
                "name": "chainlet_id",
                "in": "path",
                "required": true
            },
            "training_project_id": {
                "schema": {
                    "type": "string"
                },
                "name": "training_project_id",
                "in": "path",
                "required": true
            },
            "training_job_id": {
                "schema": {
                    "type": "string"
                },
                "name": "training_job_id",
                "in": "path",
                "required": true
            },
            "session_id": {
                "schema": {
                    "type": "string"
                },
                "name": "session_id",
                "in": "path",
                "required": true
            },
            "run_id": {
                "schema": {
                    "type": "string"
                },
                "name": "run_id",
                "in": "path",
                "required": true
            },
            "sampler_id": {
                "schema": {
                    "type": "string"
                },
                "name": "sampler_id",
                "in": "path",
                "required": true
            },
            "checkpoint_id": {
                "schema": {
                    "type": "string"
                },
                "name": "checkpoint_id",
                "in": "path",
                "required": true
            },
            "api_key_prefix": {
                "schema": {
                    "type": "string"
                },
                "name": "api_key_prefix",
                "in": "path",
                "required": true
            },
            "model_api_name": {
                "schema": {
                    "type": "string"
                },
                "name": "model_api_name",
                "in": "path",
                "required": true
            },
            "user_defined_listing_id": {
                "schema": {
                    "type": "string"
                },
                "name": "user_defined_listing_id",
                "in": "path",
                "required": true
            },
            "version_tag": {
                "schema": {
                    "type": "string"
                },
                "name": "version_tag",
                "in": "path",
                "required": true
            },
            "user_id": {
                "schema": {
                    "type": "string"
                },
                "name": "user_id",
                "in": "path",
                "required": true
            },
            "endpoint_id": {
                "schema": {
                    "type": "string"
                },
                "name": "endpoint_id",
                "in": "path",
                "required": true
            },
            "group_id": {
                "schema": {
                    "type": "string"
                },
                "name": "group_id",
                "in": "path",
                "required": true
            }
        },
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Send `Authorization: Bearer <api_key>`. The legacy `Authorization: Api-Key <api_key>` scheme is also accepted."
            }
        }
    }
}