openapi: 3.1.0
info:
  title: Together APIs
  description: The Together REST API. See https://docs.together.ai for more details.
  version: '2.0.0'
  termsOfService: https://www.together.ai/terms-of-service
  contact:
    name: Together Support
    url: https://www.together.ai/contact
  license:
    name: MIT
    url: https://github.com/togethercomputer/openapi/blob/main/LICENSE
servers:
  - url: https://api.together.ai/v1
    description: Default environment for APIs
  - url: https://api-inference.together.ai/v2
    description: Optimized environment for inference
security:
  - bearerAuth: []
paths:
  /organizations/{organizationId}/endpoints:
    get:
      tags: [EndpointService]
      summary: List organization endpoints
      description: Lists endpoints shared with every project in the specified organization. Project-private and public endpoints are not included.
      operationId: EndpointService_ListOrganizationEndpoints
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            description: Organization identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of results to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous list response.
        - name: orderBy
          in: query
          schema:
            type: string
            description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`.
        - name: filter
          in: query
          schema:
            type: string
            description: Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint name.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListEndpointsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /organizations/{organizationId}/models:
    get:
      tags: [VolumeService]
      summary: List organization models
      description: Lists custom models shared with every project in the specified organization. Project-private and public models are not included.
      operationId: VolumeService_ListOrganizationModels
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: organizationId
          in: path
          required: true
          schema:
            description: Organization identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of results to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListModelsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/configs:
    get:
      tags: [ConfigService]
      summary: List model configurations
      description: Lists production-ready configuration revisions compatible with a reference model. Specify the model with `referenceModel` or the deprecated `referenceModelId`; if both are supplied, they must identify the same model. Results include public configurations and configurations owned by the specified project.
      operationId: ConfigService_ListProjectConfigs
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: referenceModelId
          in: query
          schema:
            type: string
            description: Deprecated. Use `referenceModel`. Reference model identifier filter; if both are set, they must agree.
        - name: referenceModel
          in: query
          schema:
            type: string
            description: Model resource-name filter using `projects/{projectId}/models/{modelId}`; alternative to `referenceModelId`. If both are set, they must agree.
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of results to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListProjectConfigsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/configs/{id}:
    get:
      tags: [ConfigService]
      summary: Get a model configuration
      description: Retrieves a model configuration revision by ID, including its runtime selectors and certifications.
      operationId: ConfigService_GetProjectConfig
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Config revision identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ModelConfig'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints:
    get:
      tags: [EndpointService]
      summary: List endpoints
      description: Lists the dedicated inference endpoints owned by the specified project.
      operationId: EndpointService_ListEndpoints
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
            description: Maximum number of endpoints to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous response.
        - name: orderBy
          in: query
          schema:
            type: string
            description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`.
        - name: filter
          in: query
          schema:
            type: string
            description: Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare endpoint name or `<project_slug>/<endpoint_name>`.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListEndpointsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [EndpointService]
      summary: Create an endpoint
      description: Creates a stable, inference-addressable endpoint. Add one or more deployments and configure its traffic split before sending inference requests to the endpoint name.
      operationId: EndpointService_CreateEndpoint
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateEndpointRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Endpoint'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{id}:
    patch:
      tags: [EndpointService]
      summary: Update an endpoint
      description: Updates mutable endpoint fields such as its endpoint string, visibility, or deployment traffic split. Use `updateMask` to select fields explicitly and `etag` in the request body for optimistic concurrency.
      operationId: EndpointService_UpdateEndpoint
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: updateMask
          in: query
          schema:
            type: string
            description: Fields to update. If not set, the fields populated are updated.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.EndpointUpdate'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Endpoint'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    get:
      tags: [EndpointService]
      summary: Get an endpoint
      description: Retrieves an endpoint and lightweight summaries of the deployments attached to it.
      operationId: EndpointService_GetEndpoint
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Endpoint'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [EndpointService]
      summary: Delete an endpoint
      description: Permanently deletes an endpoint. Delete its deployments first; use `etag` to reject the request if the endpoint changed after it was read.
      operationId: EndpointService_DeleteEndpoint
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/deployments:
    get:
      tags: [DeploymentService]
      summary: List deployments
      description: Lists the deployments attached to an endpoint, including their model, configuration, scaling settings, placement, and current status.
      operationId: DeploymentService_ListDeployments
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: ID of the project that owns the endpoint.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: ID of the endpoint whose deployments are listed.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of deployments to return. Max 500, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous deployment list response.
        - name: orderBy
          in: query
          schema:
            type: string
            description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`.
        - name: filter
          in: query
          schema:
            type: string
            description: Filter expression using `name`, `state`, `model`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; `state` takes a DeploymentState enum name and `model` takes a model resource name. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and accepts a bare deployment name or `<project_slug>/<endpoint_name>/<deployment_name>`.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListDeploymentsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [DeploymentService]
      summary: Create a deployment
      description: Creates a model deployment under an endpoint. The deployment provisions asynchronously; monitor its status before routing live traffic to it.
      operationId: DeploymentService_CreateDeployment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: ID of the project that owns the endpoint.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: ID of the endpoint that will contain the deployment.
            type: string
        - name: validateOnly
          in: query
          schema:
            type: boolean
            description: When true, validates the request without creating or provisioning a deployment.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateDeploymentRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Deployment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/deployments/{id}:
    patch:
      tags: [DeploymentService]
      summary: Update a deployment
      description: Updates mutable deployment fields such as its model, configuration, autoscaling bounds, or LoRA support. Changes that affect serving may trigger asynchronous reprovisioning.
      operationId: DeploymentService_UpdateDeployment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: updateMask
          in: query
          schema:
            type: string
            description: Fields to update. If not set, the fields populated on `deployment` are updated.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateDeploymentRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Deployment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    get:
      tags: [DeploymentService]
      summary: Get a deployment
      description: Retrieves a deployment's desired configuration, placement, runtime information, and current provisioning status.
      operationId: DeploymentService_GetDeployment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Deployment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [DeploymentService]
      summary: Delete a deployment
      description: Permanently deletes a deployment from its endpoint. Remove the deployment from live traffic first; use `etag` to reject the request if it changed after it was read.
      operationId: DeploymentService_DeleteDeployment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters:
    get:
      tags: [DeploymentService]
      summary: List deployment adapters
      description: Lists LoRA adapters attached to a deployment with per-cluster load state.
      operationId: DeploymentService_ListAdapters
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: deploymentId
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of adapters to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous adapter list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListAdaptersResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [DeploymentService]
      summary: Add a deployment adapter
      description: Attaches a LoRA adapter to a deployment. If the deployment is at adapter capacity, force can evict the oldest adapter.
      operationId: DeploymentService_AddAdapter
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: deploymentId
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.AddAdapterRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.AdapterEntry'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/deployments/{deploymentId}/adapters/{id}:
    get:
      tags: [DeploymentService]
      summary: Get a deployment adapter
      description: Gets an attached adapter and its per-cluster load state.
      operationId: DeploymentService_GetAdapter
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: deploymentId
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Adapter model identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.AdapterEntry'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [DeploymentService]
      summary: Remove a deployment adapter
      description: Detaches an adapter from a deployment using its row-level etag for optimistic concurrency.
      operationId: DeploymentService_RemoveAdapter
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: deploymentId
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Adapter model identifier.
            type: string
        - name: etag
          in: query
          required: true
          schema:
            type: string
            description: Adapter etag from a previous add, update, get, or list response. The removal is rejected if the adapter changed after that response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    patch:
      tags: [DeploymentService]
      summary: Update a deployment adapter
      description: Updates the pinned revision of an attached adapter using its row-level etag for optimistic concurrency.
      operationId: DeploymentService_UpdateAdapter
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: deploymentId
          in: path
          required: true
          schema:
            description: Deployment identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Adapter model identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateAdapterRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.AdapterEntry'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts:
    get:
      tags: [RolloutService]
      summary: List endpoint rollouts
      description: Lists rollout histories for an endpoint. Use `filter=ROLLOUT_FILTER_ACTIVE` to return only the active rollout, if one exists.
      operationId: RolloutService_ListRollouts
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of rollouts to return. Max 500, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous rollout list response.
        - name: filter
          in: query
          schema:
            enum:
              - ROLLOUT_FILTER_ACTIVE
              - ROLLOUT_FILTER_TERMINAL
            type: string
            description: Narrow results to active or terminal rollouts. Omit to list all rollouts.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListRolloutsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [RolloutService]
      summary: Create a rollout
      description: Creates a rollout in the pending state without shifting traffic. Start the rollout in a separate request after reviewing its strategy and metric gates.
      operationId: RolloutService_CreateRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateRolloutRequest'
            # The strategy fields (canary, blueGreen, rolling) are a oneOf: a valid
            # request sets exactly one. Explicit examples keep doc generators from
            # emitting an invalid body that merges all three.
            examples:
              canary:
                summary: Canary rollout with a metric gate
                value:
                  sourceDeploymentId: dep_source123
                  targetDeploymentId: dep_target456
                  canary:
                    steps:
                      - traffic: 25
                      - traffic: 50
                      - traffic: 100
                    stepInterval: 300s
                  metrics:
                    - name: serving_latency
                      stat: METRIC_STAT_TYPE_PERCENTILE
                      percentile: 95
                      thresholdCheck:
                        value: 30000
                        operator: THRESHOLD_OPERATOR_LT
                      window: 300s
              blueGreen:
                summary: Blue-green cutover
                value:
                  sourceDeploymentId: dep_source123
                  targetDeploymentId: dep_target456
                  blueGreen: {}
              rolling:
                summary: Rolling replica swap
                value:
                  sourceDeploymentId: dep_source123
                  targetDeploymentId: dep_target456
                  rolling: {}
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/preview-defaults:
    post:
      tags: [RolloutService]
      summary: Preview rollout defaults
      description: Returns the values a create request would pick for any field left unset, plus the capacity context needed to display them, without creating a rollout. Responses are display state only and re-validated authoritatively at create and start; do not copy response values back into a create request.
      operationId: RolloutService_PreviewRolloutDefaults
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateRolloutRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.RolloutDefaultsPreview'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}:
    get:
      tags: [RolloutService]
      summary: Get a rollout
      description: Retrieves a rollout's strategy, lifecycle state, current traffic percentage, step history, and metric-gate results.
      operationId: RolloutService_GetRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [RolloutService]
      summary: Delete a rollout
      description: Deletes a rollout record. An active rollout must be aborted or completed before it can be deleted.
      operationId: RolloutService_DeleteRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: Etag for optimistic concurrency.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/start:
    post:
      tags: [RolloutService]
      summary: Start a rollout
      description: Starts a pending rollout and begins its configured traffic-shifting workflow.
      operationId: RolloutService_StartRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/pause:
    post:
      tags: [RolloutService]
      summary: Pause a rollout
      description: |-
        Requests a running or stabilizing rollout to pause and records an optional reason. The response returns the PAUSING snapshot; poll GetRollout until state is PAUSED to confirm the executor has parked.
      operationId: RolloutService_PauseRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.PauseRolloutRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/resume:
    post:
      tags: [RolloutService]
      summary: Resume a rollout
      description: Resumes a pausing, paused, or system-paused rollout from its current step and traffic split.
      operationId: RolloutService_ResumeRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.ResumeRolloutRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/cancel:
    post:
      tags: [RolloutService]
      summary: Cancel a rollout
      description: Cancels a running, pausing, paused, system-paused, or stabilizing rollout by freezing the current traffic split. Revert is removed and rejected; cancel with freeze, then run a reverse rollout back to the source. The response is the accepted rollout snapshot; poll GetRollout until it reaches CANCELED.
      operationId: RolloutService_CancelRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CancelRolloutRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/rollouts/{id}/promote:
    post:
      tags: [RolloutService]
      summary: Promote a rollout
      description: Completes a running or paused rollout immediately by sending all live traffic to the target deployment.
      operationId: RolloutService_PromoteRollout
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Rollout identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.PromoteRolloutRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Rollout'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/abExperiments:
    get:
      tags: [ABExperimentService]
      summary: List A/B experiments
      description: Lists the managed live-traffic experiments configured for an endpoint.
      operationId: ABExperimentService_ListABExperiments
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of A/B experiments to return. Max 500, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous A/B experiment list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListABExperimentsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [ABExperimentService]
      summary: Create an A/B experiment
      description: Creates a managed control/variant split across two to 20 deployments under the same endpoint. Exactly one member is the control, member percentages must add up to 100, and the split applies only to traffic that the endpoint would otherwise send to the control.
      operationId: ABExperimentService_CreateABExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateABExperimentRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ABExperiment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}:
    patch:
      tags: [ABExperimentService]
      summary: Update an A/B experiment
      description: Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.
      operationId: ABExperimentService_UpdateABExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: A/B experiment identifier.
            type: string
        - name: updateMask
          in: query
          schema:
            type: string
            description: Fields to update. If omitted, all mutable fields are overwritten.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateABExperimentRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ABExperiment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    get:
      tags: [ABExperimentService]
      summary: Get an A/B experiment
      description: Retrieves an A/B experiment and its participating deployments, roles, and traffic percentages.
      operationId: ABExperimentService_GetABExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: A/B experiment identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ABExperiment'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [ABExperimentService]
      summary: Delete an A/B experiment
      description: Deletes an A/B experiment and removes its managed traffic split. The deployments themselves are not deleted.
      operationId: ABExperimentService_DeleteABExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: A/B experiment identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: Etag for optimistic concurrency. If set, the delete is rejected if the current etag does not match.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/shadowExperiments:
    get:
      tags: [ShadowExperimentService]
      summary: List shadow experiments
      description: Lists experiments that mirror sampled endpoint traffic to target deployments without affecting client responses. Set `includeTargets=true` to include target details inline.
      operationId: ShadowExperimentService_ListShadowExperiments
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of shadow experiments to return. Max 500, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous shadow experiment list response.
        - name: includeTargets
          in: query
          schema:
            type: boolean
            description: Whether to include target deployments in each returned shadow experiment.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListShadowExperimentsResponse'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [ShadowExperimentService]
      summary: Create a shadow experiment
      description: Creates an experiment that mirrors a sampled portion of endpoint traffic to one or more target deployments without returning their responses to clients. Add a description with the update operation after creation.
      operationId: ShadowExperimentService_CreateShadowExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateShadowExperimentRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ShadowExperiment'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{id}:
    patch:
      tags: [ShadowExperimentService]
      summary: Update a shadow experiment
      description: Updates a shadow experiment's description or source sampling strategy. `updateMask` is required; source changes also require the current `etag` in the request body.
      operationId: ShadowExperimentService_UpdateShadowExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
        - name: updateMask
          in: query
          required: true
          schema:
            type: string
            description: Required fields to update, such as description or source.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateShadowExperimentRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ShadowExperiment'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    get:
      tags: [ShadowExperimentService]
      summary: Get a shadow experiment
      description: Retrieves a shadow experiment, including its sampling strategy and target deployments.
      operationId: ShadowExperimentService_GetShadowExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ShadowExperiment'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [ShadowExperimentService]
      summary: Delete a shadow experiment
      description: Deletes a shadow experiment and its target records. The underlying deployments are not deleted.
      operationId: ShadowExperimentService_DeleteShadowExperiment
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: Etag for optimistic concurrency.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets:
    get:
      tags: [ShadowExperimentService]
      summary: List shadow experiment targets
      description: Lists the deployments that receive mirrored requests from a shadow experiment.
      operationId: ShadowExperimentService_ListTargets
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: experimentId
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of targets to return. Max 500, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous shadow experiment target list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListShadowExperimentTargetsResponse'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [ShadowExperimentService]
      summary: Create a shadow experiment target
      description: Adds a deployment under the same endpoint as a target for mirrored requests.
      operationId: ShadowExperimentService_CreateTarget
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: experimentId
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateShadowExperimentTargetRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ShadowExperimentTarget'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{endpointId}/shadowExperiments/{experimentId}/targets/{id}:
    patch:
      tags: [ShadowExperimentService]
      summary: Update a shadow experiment target
      description: Updates a shadow target's name, deployment, or description. `updateMask` is required and must select at least one mutable field.
      operationId: ShadowExperimentService_UpdateTarget
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: experimentId
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Shadow experiment target identifier.
            type: string
        - name: updateMask
          in: query
          required: true
          schema:
            type: string
            description: Comma-separated fields to update. Supported fields are `name`, `targetDeploymentId`, and `description`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateShadowExperimentTargetRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ShadowExperimentTarget'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    get:
      tags: [ShadowExperimentService]
      summary: Get a shadow experiment target
      description: Retrieves one target configured to receive mirrored requests from a shadow experiment.
      operationId: ShadowExperimentService_GetTarget
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: experimentId
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Shadow experiment target identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ShadowExperimentTarget'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [ShadowExperimentService]
      summary: Delete a shadow experiment target
      description: Removes a target from a shadow experiment without deleting the underlying deployment.
      operationId: ShadowExperimentService_DeleteTarget
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: endpointId
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: experimentId
          in: path
          required: true
          schema:
            description: Shadow experiment identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Shadow experiment target identifier.
            type: string
        - name: etag
          in: query
          schema:
            type: string
            description: Etag for optimistic concurrency.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{id}/analytics:
    get:
      tags: [EndpointService]
      summary: Get endpoint analytics
      description: Returns aggregated request, token, latency, throughput, error, and resource-utilization metrics for an endpoint over a time range. Optionally includes time-series buckets and a per-deployment breakdown.
      operationId: EndpointService_GetEndpointAnalytics
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: deploymentId
          in: query
          schema:
            type: string
            description: Restrict to a single deployment under this endpoint.
        - name: startTime
          in: query
          schema:
            type: string
            format: date-time
            description: Inclusive start of the time range. Defaults to 24 hours ago if unset.
        - name: endTime
          in: query
          schema:
            type: string
            format: date-time
            description: Exclusive end of the time range. Defaults to now if unset.
        - name: includeTimeSeries
          in: query
          schema:
            type: boolean
            description: When true, include per-bucket time series in the response.
        - name: granularity
          in: query
          schema:
            type: string
            description: Time-series bucket duration, such as `1m`, `1h`, or `1d`. Defaults to `1d`.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.AnalyticsData'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/endpoints/{id}/events:
    get:
      tags: [EndpointService]
      summary: List endpoint events
      description: Lists an endpoint's audit and lifecycle events newest first. The feed combines endpoint changes with provisioning, scaling, readiness, rollout, and other events from deployments under the endpoint.
      operationId: EndpointService_ListEndpointEvents
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Endpoint identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of events to return. Max 10000, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous endpoint event list response.
        - name: types
          in: query
          schema:
            type: array
            items:
              type: string
            description: Event types to include, such as `deployment.scaled` or `condition.set`. Combined with other filters using AND.
        - name: minLevel
          in: query
          schema:
            enum:
              - LEVEL_DEBUG
              - LEVEL_INFO
              - LEVEL_WARN
              - LEVEL_ERROR
            type: string
            description: Minimum severity. Omit to disable severity filtering.
        - name: since
          in: query
          schema:
            type: string
            format: date-time
            description: Return only events at or after this time.
        - name: until
          in: query
          schema:
            type: string
            format: date-time
            description: Return only events strictly before this time.
        - name: deploymentIds
          in: query
          schema:
            type: array
            items:
              type: string
            description: Deployment IDs whose events should be included. Every ID must belong to the endpoint. Supplying this filter excludes endpoint-scoped events unless `SOURCE_KIND_ENDPOINT` is also included in `sourceKinds`.
        - name: sourceKinds
          in: query
          schema:
            type: array
            items:
              enum:
                - SOURCE_KIND_ENDPOINT
                - SOURCE_KIND_DEPLOYMENT
              type: string
            description: Resource kinds whose events should be included. Omit to include both endpoint- and deployment-scoped events.
        - name: subjectId
          in: query
          schema:
            type: string
            description: ID of a subject associated with the event, such as a rollout. Combined with other filters using AND.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListEndpointEventsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models:
    get:
      tags: [VolumeService]
      summary: List project models
      description: Lists custom model resources owned by the specified project. Use the organization endpoint to list models shared across projects or the supported-model catalog to discover Together-hosted base models.
      operationId: VolumeService_ListModels
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: visibility
          in: query
          schema:
            enum:
              - VISIBILITY_PRIVATE
              - VISIBILITY_INTERNAL
            type: string
            description: Model visibility. Private means it is scoped to the project. Internal means it is scoped to the organization.
        - name: organizationId
          in: query
          schema:
            type: string
            description: Organization whose shared models should be included. Defaults to the authenticated project's organization.
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of models to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous model list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListModelsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [VolumeService]
      summary: Create a model
      description: Registers a custom model resource in the project. Registration creates the model's metadata; upload or import model files separately before deploying it.
      operationId: VolumeService_CreateModel
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateModelRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Model'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/{id}:
    get:
      tags: [VolumeService]
      summary: Get a model
      description: Retrieves a custom model's metadata, visibility, weight information, and base-model relationship.
      operationId: VolumeService_GetModel
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Model identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Model'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: [VolumeService]
      summary: Delete a model
      description: Permanently deletes a custom model resource. The model must not be in use by an active deployment.
      operationId: VolumeService_DeleteModel
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: ID of the project that owns the model.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Model identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.DeleteResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    patch:
      tags: [VolumeService]
      summary: Update a model
      description: Updates mutable model metadata such as its inference name, description, base model, or visibility.
      operationId: VolumeService_UpdateModel
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Model identifier.
            type: string
        - name: updateMask
          in: query
          schema:
            type: string
            format: field-mask
            description: Fields to update. If omitted, all mutable fields are overwritten.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.UpdateModelRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.Model'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/placement-profiles:
    get:
      tags: [PlacementProfileService]
      summary: List placement profiles
      description: Lists reusable, project-visible placement policies that control the regions where deployments may be scheduled.
      operationId: PlacementProfileService_ListPlacementProfiles
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of profiles to return. Max 500, defaults to 50.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous placement profile list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListPlacementProfilesResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/placement-profiles/{id}:
    get:
      tags: [PlacementProfileService]
      summary: Get a placement profile
      description: Retrieves a reusable placement profile and its ordered region preferences.
      operationId: PlacementProfileService_GetPlacementProfile
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Placement profile identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.PlacementProfile'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/{id}/files:
    get:
      tags: [VolumeService]
      summary: List model files
      description: Lists files in the latest or specified revision of a model, including paths, sizes, and content hashes.
      operationId: VolumeService_ListModelFiles
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Model identifier.
            type: string
        - name: revisionId
          in: query
          schema:
            type: string
            description: Revision identifier to read from.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListFilesResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/{id}/revisions:
    get:
      tags: [VolumeService]
      summary: List model revisions
      description: Lists the immutable file revisions available for a custom model, newest first.
      operationId: VolumeService_ListModelRevisions
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Model identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListRevisionsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/{id}/revisions/{revisionId}:
    get:
      tags: [VolumeService]
      summary: Get a model volume revision
      description: Retrieves metadata for one immutable revision of a custom model's files.
      operationId: VolumeService_GetRevisionByModelType
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Model identifier.
            type: string
        - name: revisionId
          in: path
          required: true
          schema:
            description: Revision identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListRevisionsResponseRevision'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/uploads:
    get:
      tags: [VolumeService]
      summary: List remote model uploads
      description: Lists asynchronous jobs that import model files from Hugging Face or a presigned remote URL.
      operationId: VolumeService_ListRemoteModelUploads
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of uploads to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous remote upload list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListRemoteUploadsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: [VolumeService]
      summary: Create a remote model upload
      description: Starts an asynchronous job that imports model files from Hugging Face or a presigned URL into a registered model and creates a model revision when the import completes.
      operationId: VolumeService_CreateRemoteModelUpload
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DE.CreateRemoteUploadSpec'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.RemoteUpload'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/uploads/{id}:
    get:
      tags: [VolumeService]
      summary: Get a remote model upload
      description: Retrieves the status, progress details, retry counts, and timestamps for a remote model import job.
      operationId: VolumeService_GetRemoteModelUpload
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Remote upload identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.RemoteUpload'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /projects/{projectId}/models/uploads/{id}/events:
    get:
      tags: [VolumeService]
      summary: List remote model upload events
      description: Lists progress and diagnostic events for a remote model import job.
      operationId: VolumeService_ListRemoteModelUploadEvents
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            description: Project identifier.
            type: string
        - name: id
          in: path
          required: true
          schema:
            description: Remote upload identifier.
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of events to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous remote upload event list response.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListRemoteUploadEventsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /public/endpoints:
    get:
      tags: [EndpointService]
      summary: List public endpoints
      description: Lists endpoints that are publicly visible across Together projects.
      operationId: EndpointService_ListPublicEndpoints
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
            description: Maximum number of results to return.
        - name: after
          in: query
          schema:
            type: string
            description: Cursor from a previous list response.
        - name: orderBy
          in: query
          schema:
            type: string
            description: Sort field for the results. Supports `created_at` or `updated_at`, optionally followed by `asc` or `desc`.
        - name: filter
          in: query
          schema:
            type: string
            description: Filter expression using `name`, `created_at`, or `updated_at` with comparison operators and AND/OR/NOT; timestamps must be RFC 3339 strings. `name` supports substring matching with `:` and prefix/suffix wildcards with `*`, and must be a bare endpoint name.
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListPublicEndpointsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /public/inference-instance-types:
    get:
      tags: [InstanceTypeService]
      summary: List inference instance types
      description: Lists hardware instance types currently available to inference deployments, including GPU resources, pricing, regions, and best-effort capacity headroom.
      operationId: InstanceTypeService_ListInferenceInstanceTypes
      servers:
        - url: https://api.together.ai/v2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListInferenceInstanceTypesResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /public/inference-instance-types/{id}:
    get:
      tags: [InstanceTypeService]
      summary: Get an inference instance type
      description: Retrieves the GPU resources, pricing, regional availability, and best-effort capacity headroom for one inference instance type.
      operationId: InstanceTypeService_GetInferenceInstanceType
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Resource identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.InferenceInstanceType'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

  /supported-models:
    get:
      tags: [SupportedModelsService]
      summary: List supported models
      description: Lists Together-hosted base models that can be deployed for dedicated inference, together with their capabilities and certified deployment profiles.
      operationId: SupportedModelsService_ListSupportedModels
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: modality
          in: query
          schema:
            description: Filter models by input modality.
            enum:
              - MODALITY_TEXT
              - MODALITY_IMAGE
              - MODALITY_AUDIO
              - MODALITY_VIDEO
            type: string
        - name: product
          in: query
          schema:
            description: Filter models by product surface.
            enum:
              - PRODUCT_SERVERLESS
              - PRODUCT_DEDICATED
              - PRODUCT_FINE_TUNING
            type: string
        - name: search
          in: query
          schema:
            description: Case-insensitive search across model IDs, names, and descriptions.
            type: string
        - name: limit
          in: query
          schema:
            description: Maximum number of models to return.
            type: integer
        - name: after
          in: query
          schema:
            description: Cursor from a previous supported-model list response.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.ListSupportedModelsResponse'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /supported-models/{id}:
    get:
      tags: [SupportedModelsService]
      summary: Get a supported model
      description: Retrieves a Together-hosted base model and the certified model, configuration, hardware, and performance profiles available for deployment.
      operationId: SupportedModelsService_GetSupportedModel
      servers:
        - url: https://api.together.ai/v2
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Supported model identifier.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DE.SupportedModel'
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

  /deployments:
    get:
      description: Get a list of all deployments in your project
      summary: Get the list of deployments
      tags: ['Deployments']
      responses:
        "200":
          description: List of deployments
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentListResponse"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    post:
      description: Create a new deployment with specified configuration
      summary: Create a new deployment
      tags: ['Deployments']
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateDeploymentRequest"
        description: Deployment configuration
        required: true
      responses:
        "200":
          description: Deployment created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentResponseItem"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
  /deployments/{id}:
    delete:
      description: Delete an existing deployment
      summary: Delete a deployment
      tags: ['Deployments']
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Deployment ID or name
            type: string
      responses:
        "200":
          description: Deployment deleted successfully
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Deployment not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    get:
      description: Retrieve details of a specific deployment by its ID or name
      summary: Get a deployment by ID or name
      tags: ['Deployments']
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Deployment ID or name
            type: string
      responses:
        "200":
          description: Deployment details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentResponseItem"
        "404":
          description: Deployment not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    patch:
      description: Update an existing deployment configuration
      summary: Update a deployment
      tags: ['Deployments']
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Deployment ID or name
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateDeploymentRequest"
        description: Updated deployment configuration
        required: true
      responses:
        "200":
          description: Deployment updated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentResponseItem"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Deployment not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
  /deployments/{id}/logs:
    get:
      description: Retrieve logs from a deployment, optionally filtered by replica ID.
      summary: Get logs for a deployment
      tags: ['Deployments']
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Deployment ID or name
            type: string
        - name: replica_id
          in: query
          required: false
          schema:
            description: Replica ID to filter logs
            type: string
        - name: version
          in: query
          schema:
            description: Deployment image version (tag or last 4 characters of image digest) to filter logs
            type: string
        - name: revision
          in: query
          schema:
            description: Deployment revision (UUID) to filter logs
            type: string
      responses:
        "200":
          description: Deployment logs
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeploymentLogs"
        "404":
          description: Deployment not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
  /deployments/secrets:
    get:
      description: Retrieve all secrets in your project
      summary: Get the list of project secrets
      tags: ['Secrets']
      responses:
        "200":
          description: List of secrets
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListSecretsResponse"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    post:
      description: Create a new secret to store sensitive configuration values
      summary: Create a new secret
      tags: ['Secrets']
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateSecretRequest"
        description: Secret configuration
        required: true
      responses:
        "200":
          description: Secret created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecretResponseItem"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
  /deployments/secrets/{id}:
    delete:
      description: Delete an existing secret
      summary: Delete a secret
      tags: ['Secrets']
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Secret ID or name
            type: string
      responses:
        "200":
          description: Secret deleted successfully
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Secret not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    get:
      description: Retrieve details of a specific secret by its ID or name
      summary: Get a secret by ID or name
      tags: ['Secrets']
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Secret ID or name
            type: string
      responses:
        "200":
          description: Secret details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecretResponseItem"
        "404":
          description: Secret not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    patch:
      description: Update an existing secret's value or metadata
      summary: Update a secret
      tags: ['Secrets']

      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Secret ID or name
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateSecretRequest"
        description: Updated secret configuration
        required: true
      responses:
        "200":
          description: Secret updated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SecretResponseItem"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Secret not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
  /deployments/storage/{filename}:
    get:
      description: Download a file by redirecting to a signed URL
      summary: Download a file
      tags: ['DeploymentsStorage']
      parameters:
        - name: filename
          in: path
          required: true
          schema:
            description: Filename
            type: string
      responses:
        "307":
          description: Redirect to signed download URL
          content:
            application/json:
              schema:
                type: string
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        "404":
          description: File not found
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        "500":
          description: Internal error
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
  /deployments/storage/{filename}/url:
    get:
      description: Create a signed URL for downloading a deployment storage file
      summary: Get a file download URL
      tags: ['DeploymentsStorage']
      parameters:
        - name: filename
          in: path
          required: true
          schema:
            description: Filename
            type: string
      responses:
        "200":
          description: Signed URL
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SignedURLResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        "404":
          description: File not found
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        "500":
          description: Internal error
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
  /deployments/storage/volumes:
    get:
      description: Retrieve all volumes in your project
      summary: Get the list of project volumes
      tags: ['DeploymentsVolumes']
      responses:
        "200":
          description: List of volumes
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListVolumesResponse"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
    post:
      description: Create a new volume to preload files in deployments
      summary: Create a new volume
      tags: ['DeploymentsVolumes']
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateVolumeRequest"
        description: Volume configuration
        required: true
      responses:
        "200":
          description: Volume created successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VolumeResponseItem"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
  /deployments/storage/volumes/{id}:
    delete:
      description: Delete an existing volume
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Volume ID or name
            type: string
      responses:
        "200":
          description: Volume deleted successfully
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Volume not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
      summary: Delete a volume
      tags:
        - Volumes
    get:
      description: Retrieve details of a specific volume by its ID or name
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Volume ID or name
            type: string
        - name: version
          in: query
          schema:
            description: Volume version to describe (defaults to current version)
            type: integer
      responses:
        "200":
          description: Volume details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VolumeResponseItem"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Volume not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
      summary: Get a volume by ID or name
      tags:
        - Volumes
    patch:
      description: Update an existing volume's configuration or contents
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Volume ID or name.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateVolumeRequest"
        description: Updated volume configuration
        required: true
      responses:
        "200":
          description: Volume updated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VolumeResponseItem"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Volume not found
          content:
            application/json:
              schema:
                type: object
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
      summary: Update a volume
      tags:
        - Volumes
  /voices:
    get:
      tags: ['Voices']
      summary: Fetch available voices for each model
      description: Fetch available voices for each model
      operationId: fetchVoices
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListVoicesResponse'
  /videos/{id}:
    get:
      tags: ['Video']
      summary: Fetch video metadata
      description: Fetch video metadata
      servers:
        - url: https://api.together.ai/v2
      operationId: retrieveVideo
      parameters:
        - in: path
          name: id
          required: true
          schema:
            description: Identifier of video from create response.
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoJob'
        '400':
          description: Invalid request parameters.
        '404':
          description: Video ID not found.
  /videos:
    post:
      tags: ['Video']
      summary: Create video
      description: Create a video
      operationId: createVideo
      servers:
        - url: https://api.together.ai/v2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVideoBody'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoJob'
  /chat/completions:
    post:
      tags: ['Chat']
      summary: Create chat completion
      description: Generate a model response for a given chat conversation. Supports single queries and multi-turn conversations with system, user, and assistant messages.
      operationId: chat-completions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/ChatCompletionStream'
        '400':
          description: 'BadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'NotFound'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '503':
          description: 'Overloaded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '504':
          description: 'Timeout'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      deprecated: false
  /completions:
    post:
      tags: ['Completion']
      summary: Create completion
      description: Generate text completions for a given prompt using a language, code, or image model.
      operationId: completions
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompletionRequest'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompletionResponse'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/CompletionStream'
        '400':
          description: 'BadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'NotFound'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '503':
          description: 'Overloaded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '504':
          description: 'Timeout'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      deprecated: false
  /embeddings:
    post:
      tags: ['Embeddings']
      summary: Create embedding
      description: Generate vector embeddings for one or more text inputs. Returns numerical arrays representing semantic meaning, useful for search, classification, and retrieval.
      operationId: embeddings
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsRequest'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
        '400':
          description: 'BadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'NotFound'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '503':
          description: 'Overloaded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '504':
          description: 'Timeout'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      deprecated: false
  /models:
    get:
      tags: ['Models']
      summary: List all models
      description: Lists all of Together's open-source models and metadata including pricing, chat template, and context.
      operationId: models
      parameters:
        - name: dedicated
          in: query
          schema:
            description: Filter models to only return dedicated models
            type: boolean
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInfoList'
        '400':
          description: 'BadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'NotFound'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '504':
          description: 'Timeout'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      deprecated: false
    post:
      tags: ['Models']
      summary: Upload a custom model or adapter
      description: Upload a custom model or adapter from Hugging Face or S3
      operationId: uploadModel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelUploadRequest'
      responses:
        '200':
          description: Model / adapter upload job created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelUploadSuccessResponse'

  /jobs/{jobId}:
    get:
      tags: ['Jobs']
      summary: Get job status
      description: Get the status of a specific job
      operationId: getJob
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            example: job-a15dad11-8d8e-4007-97c5-a211304de284
            description: The ID of the job to retrieve
            type: string
      responses:
        '200':
          description: Job status retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobInfoSuccessResponse'

  /jobs:
    get:
      tags: ['Jobs']
      summary: List all jobs
      description: List all jobs and their statuses
      operationId: listJobs
      responses:
        '200':
          description: Jobs retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobsInfoSuccessResponse'

  /images/generations:
    post:
      tags: ['Images']
      summary: Create image
      description: Use an image model to generate an image for a given prompt.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
                - model
              properties:
                prompt:
                  type: string
                  description: A description of the desired images. Maximum length varies by model.
                  example: cat floating in space, cinematic
                model:
                  type: string
                  description: >
                    The model to use for image generation.<br> <br> [See all of Together AI's image models](https://docs.together.ai/docs/serverless-models#image-models)
                  example: black-forest-labs/FLUX.1-schnell
                  anyOf:
                    - type: string
                      enum:
                        - black-forest-labs/FLUX.1-schnell-Free
                        - black-forest-labs/FLUX.1-schnell
                        - black-forest-labs/FLUX.1.1-pro
                    - type: string
                steps:
                  type: integer
                  default: 20
                  description: Number of generation steps.
                image_url:
                  type: string
                  description: URL of an image to use for image models that support it.
                seed:
                  type: integer
                  description: Seed used for generation. Can be used to reproduce image generations.
                n:
                  type: integer
                  default: 1
                  description: Number of image results to generate.
                height:
                  type: integer
                  default: 1024
                  description: Height of the image to generate in number of pixels.
                width:
                  type: integer
                  default: 1024
                  description: Width of the image to generate in number of pixels.
                negative_prompt:
                  type: string
                  description: The prompt or prompts not to guide the image generation.
                response_format:
                  type: string
                  description: Format of the image response. Can be either a base64 string or a URL.
                  enum:
                    - base64
                    - url
                guidance_scale:
                  type: number
                  description: Adjusts the alignment of the generated image with the input prompt. Higher values (e.g., 8-10) make the output more faithful to the prompt, while lower values (e.g., 1-5) encourage more creative freedom.
                  default: 3.5
                output_format:
                  type: string
                  description: The format of the image response. Can be either be `jpeg` or `png`. Defaults to `jpeg`.
                  default: jpeg
                  enum:
                    - jpeg
                    - png
                image_loras:
                  description: An array of objects that define LoRAs (Low-Rank Adaptations) to influence the generated image.
                  type: array
                  items:
                    type: object
                    required: [path, scale]
                    properties:
                      path:
                        type: string
                        description: The URL of the LoRA to apply (e.g. https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA).
                      scale:
                        type: number
                        description: The strength of the LoRA's influence. Most LoRA's recommend a value of 1.
                reference_images:
                  description: An array of image URLs that guide the overall appearance and style of the generated image. These reference images influence the visual characteristics consistently across the generation.
                  type: array
                  items:
                    type: string
                    description: URL of a reference image to guide the image generation.
                disable_safety_checker:
                  type: boolean
                  description: If true, disables the safety checker for image generation.
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
  /files:
    get:
      tags: ['Files']
      summary: List all files
      description: List the metadata for all uploaded data files.
      responses:
        '200':
          description: List of files
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileList'
  /files/{id}:
    get:
      tags: ['Files']
      summary: Retrieve file metadata
      description: Retrieve the metadata for a single uploaded data file.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the file to retrieve
            type: string
      responses:
        '200':
          description: File retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
    delete:
      tags: ['Files']
      summary: Delete a file
      description: Delete a previously uploaded data file.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the file to delete
            type: string
      responses:
        '200':
          description: File deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileDeleteResponse'
  /files/{id}/content:
    get:
      tags: ['Files']
      summary: Get file contents
      description: Get the contents of a single uploaded data file.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the file to get the content of
            type: string
      responses:
        '200':
          description: File content retrieved successfully
          content:
            text/plain:
              schema:
                type: string
                format: binary
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /files/upload:
    post:
      tags: ['Files']
      summary: Upload a file
      description: Upload a file with specified purpose, file name, and file type.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - purpose
                - file_name
                - file
              properties:
                purpose:
                  $ref: '#/components/schemas/FilePurpose'
                file_name:
                  type: string
                  description: The name of the file being uploaded
                  example: 'dataset.csv'
                file_type:
                  $ref: '#/components/schemas/FileType'
                file:
                  type: string
                  format: binary
                  description: The content of the file being uploaded
      responses:
        '200':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /fine-tunes:
    post:
      tags: ['Fine-tuning']
      summary: Create job
      description: Create a fine-tuning job with the provided model and training data.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - training_file
                - model
              properties:
                training_file:
                  type: string
                  description: File-ID of a training file uploaded to the Together API
                validation_file:
                  type: string
                  description: File-ID of a validation file uploaded to the Together API
                packing:
                  type: boolean
                  default: true
                  description: Whether to use sequence packing for training. This flag has no effect if the training data is in Parquet format.
                max_seq_length:
                  type: integer
                  description: Maximum sequence length to use for training. If not specified, the maximum allowed for the model and training method will be used.
                model:
                  type: string
                  description: Name of the base model to run fine-tune job on
                n_epochs:
                  type: integer
                  default: 1
                  description: Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting)
                n_checkpoints:
                  type: integer
                  default: 1
                  maximum: 10
                  description: Number of intermediate model versions saved during training for evaluation
                n_evals:
                  type: integer
                  default: 0
                  description: Number of evaluations to be run on a given validation set during training
                batch_size:
                  oneOf:
                    - type: integer
                    - type: string
                      enum:
                        - max
                  default: 'max'
                  description: Number of training examples processed together (larger batches use more memory but may train faster). Defaults to "max". We use training optimizations like packing, so the effective batch size may be different than the value you set.
                gradient_accumulation_steps:
                  type: integer
                  minimum: 0
                  description: Number of steps to accumulate gradients before performing a weight update. If omitted or set to 0, the model default is used.
                learning_rate:
                  type: number
                  default: 0.00001
                  description: Controls how quickly the model adapts to new information (too high may cause instability, too low may slow convergence)
                lr_scheduler:
                  type: object
                  default: none
                  $ref: '#/components/schemas/LRScheduler'
                  description: The learning rate scheduler to use. It specifies how the learning rate is adjusted during training.
                warmup_ratio:
                  type: number
                  default: 0.0
                  description: The percent of steps at the start of training to linearly increase the learning rate.
                max_grad_norm:
                  type: number
                  default: 1.0
                  description: Max gradient norm to be used for gradient clipping. Set to 0 to disable.
                weight_decay:
                  type: number
                  default: 0.0
                  description: Weight decay. Regularization parameter for the optimizer.
                random_seed:
                  type: integer
                  nullable: true
                  description: >
                    Random seed for reproducible training. When set, the same seed produces the same run (e.g. data shuffle, init). If omitted or null, the server applies its default seed (e.g. 42).
                early_stopping_enabled:
                  type: boolean
                  default: false
                  description: >
                    Whether to stop training early when validation loss stops improving. Requires a validation_file, and n_evals must be at least early_stopping_patience + early_stopping_warmup_evals + 1 so a plateau can be detected.
                early_stopping_patience:
                  type: integer
                  default: 2
                  minimum: 1
                  description: >
                    Number of consecutive evaluations with no improvement in validation loss to allow before stopping. Only applies when early_stopping_enabled is true.
                early_stopping_min_delta:
                  type: number
                  default: 0.0
                  minimum: 0
                  description: >
                    Minimum decrease in validation loss for an evaluation to count as an improvement. Larger values treat small gains as non-improvements, causing training to stop sooner. Only applies when early_stopping_enabled is true.
                early_stopping_warmup_evals:
                  type: integer
                  default: 1
                  minimum: 0
                  nullable: true
                  description: >
                    Number of initial evaluations excluded from the early-stopping decision. These still establish the baseline validation loss but do not count toward patience. Set to 0 to disable warmup; if omitted, defaults to 1. Only applies when early_stopping_enabled is true.
                suffix:
                  type: string
                  maxLength: 64
                  description: Suffix to add to your fine-tuned model name. Must be at most 64 characters long.
                wandb_api_key:
                  type: string
                  description: Integration key for tracking experiments and model metrics on W&B platform
                wandb_base_url:
                  type: string
                  description: The base URL of a dedicated Weights & Biases instance.
                wandb_project_name:
                  type: string
                  description: The Weights & Biases project for your run. If not specified, uses `together` as the project name.
                wandb_name:
                  type: string
                  description: The Weights & Biases name for your run.
                wandb_entity:
                  type: string
                  description: The Weights & Biases entity for your run.
                train_on_inputs:
                  oneOf:
                    - type: boolean
                    - type: string
                      enum:
                        - auto
                  type: boolean
                  default: auto
                  description: Whether to mask user messages in conversational data or prompts in instruction data.
                  deprecated: true
                training_method:
                  type: object
                  oneOf:
                    - $ref: '#/components/schemas/TrainingMethodSFT'
                    - $ref: '#/components/schemas/TrainingMethodDPO'
                  description: The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization.
                training_type:
                  type: object
                  default: null
                  nullable: true
                  anyOf:
                    - $ref: '#/components/schemas/FullTrainingType'
                    - $ref: '#/components/schemas/LoRATrainingType'
                  description: The training type to use. Defaults to LoRA if not provided.
                multimodal_params:
                  $ref: '#/components/schemas/MultimodalParams'
                from_checkpoint:
                  type: string
                  description: The checkpoint identifier to continue training from a previous fine-tuning job. Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the final checkpoint.
                from_hf_model:
                  type: string
                  description: The Hugging Face Hub repo to start training from. Should be as close as possible to the base model (specified by the `model` argument) in terms of architecture and size.
                hf_model_revision:
                  type: string
                  description: The revision of the Hugging Face Hub model to continue training from. E.g., hf_model_revision=main (default, used if the argument is not provided) or hf_model_revision='607a30d783dfa663caf39e06633721c8d4cfcd7e' (specific commit).
                hf_api_token:
                  type: string
                  description: The API token for the Hugging Face Hub.
                hf_output_repo_name:
                  type: string
                  description: The name of the Hugging Face repository to upload the fine-tuned model to.
      responses:
        '200':
          description: Fine-tuning job initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneResponseTruncated'
    get:
      tags: ['Fine-tuning']
      summary: List all jobs
      description: List the metadata for all fine-tuning jobs. Returns a list of FinetuneResponseTruncated objects.
      responses:
        '200':
          description: List of fine-tune jobs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneTruncatedList'
  /fine-tunes/estimate-price:
    post:
      tags: ['Fine-tuning']
      summary: Estimate price
      description: Estimate the price of a fine-tuning job.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - training_file
              properties:
                training_file:
                  type: string
                  description: File-ID of a training file uploaded to the Together API
                validation_file:
                  type: string
                  description: File-ID of a validation file uploaded to the Together API
                model:
                  type: string
                  description: Name of the base model to run fine-tune job on
                n_epochs:
                  type: integer
                  default: 1
                  description: Number of complete passes through the training dataset (higher values may improve results but increase cost and risk of overfitting)
                n_evals:
                  type: integer
                  default: 0
                  description: Number of evaluations to be run on a given validation set during training
                training_method:
                  type: object
                  oneOf:
                    - $ref: '#/components/schemas/TrainingMethodSFT'
                    - $ref: '#/components/schemas/TrainingMethodDPO'
                  description: The training method to use. 'sft' for Supervised Fine-Tuning or 'dpo' for Direct Preference Optimization.
                training_type:
                  type: object
                  default: null
                  nullable: true
                  oneOf:
                    - $ref: '#/components/schemas/FullTrainingType'
                    - $ref: '#/components/schemas/LoRATrainingType'
                  description: The training type to use. Defaults to LoRA if not provided.
                from_checkpoint:
                  type: string
                  description: The checkpoint identifier to continue training from a previous fine-tuning job. Format is `{$JOB_ID}` or `{$OUTPUT_MODEL_NAME}` or `{$JOB_ID}:{$STEP}` or `{$OUTPUT_MODEL_NAME}:{$STEP}`. The step value is optional; without it, uses the final checkpoint.
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '200':
          description: Price estimated successfully
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    x-stainless-variantName: AvailableEstimate
                    required:
                      - estimation_available
                    properties:
                      estimation_available:
                        type: boolean
                        enum: [true]
                        x-stainless-const: true
                        description: Whether price estimation is available for the requested fine-tune job.
                      estimated_total_price:
                        type: number
                        description: The price of the fine-tuning job
                      allowed_to_proceed:
                        type: boolean
                        description: Whether you are allowed to proceed with the fine-tuning job.
                        example: true
                      user_limit:
                        type: number
                        description: Your credit limit in dollars.
                      estimated_train_token_count:
                        type: number
                        description: The estimated number of tokens to be trained
                      estimated_eval_token_count:
                        type: number
                        description: The estimated number of tokens for evaluation
                  - type: object
                    x-stainless-variantName: UnavailableEstimate
                    required:
                      - estimation_available
                      - unavailable_reason
                    properties:
                      estimation_available:
                        type: boolean
                        enum: [false]
                        x-stainless-const: true
                        description: Whether price estimation is available for the requested fine-tune job.
                      unavailable_reason:
                        type: string
                        description: Reason price estimation is unavailable for the requested fine-tune job.
                        enum:
                          - multimodal_dataset
                          - train_file_not_validated
                          - eval_file_not_validated
                          - train_file_invalid
                          - eval_file_invalid
                        example: multimodal_dataset
  /fine-tunes/preview:
    post:
      tags: ['Fine-tuning']
      summary: Preview tokenized data
      description: Preview how sampled rows from a fine-tuning training file will be tokenized before packing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FineTunePreviewRequest'
      responses:
        '200':
          description: Tokenized data preview generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTunePreviewResponse'
        '400':
          description: Invalid request or unsupported dataset for preview.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/FineTunePreviewMessageError'
                  - $ref: '#/components/schemas/FineTunePreviewDetailError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: Training file not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTunePreviewMessageError'
        '502':
          description: Preview service unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTunePreviewMessageError'
        '503':
          description: Preview service is at capacity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTunePreviewDetailError'
  /fine-tunes/{id}:
    get:
      tags: ['Fine-tuning']
      summary: List job
      description: List the metadata for a single fine-tuning job.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the job to retrieve
            type: string
      responses:
        '200':
          description: Fine-tune job details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneResponse'
    delete:
      tags: ['Fine-tuning']
      summary: Delete a fine-tune job
      description: Delete a fine-tuning job.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the fine-tune job to delete
            type: string
        - name: force
          deprecated: true
          in: query
          schema:
            description: Deprecated and unused parameter.
            type: boolean
            default: false
      responses:
        '200':
          description: Fine-tune job deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneDeleteResponse'
        '404':
          description: Fine-tune job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /fine-tunes/{id}/events:
    get:
      tags: ['Fine-tuning']
      summary: List job events
      description: List the events for a single fine-tuning job.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the fine-tune job to list events for
            type: string
      responses:
        '200':
          description: List of fine-tune events
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneListEvents'
  /fine-tunes/{id}/checkpoints:
    get:
      tags: ['Fine-tuning']
      summary: List checkpoints
      description: List the checkpoints for a single fine-tuning job.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the fine-tune job to list checkpoints for
            type: string
      responses:
        '200':
          description: List of fine-tune checkpoints
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneListCheckpoints'
  /fine-tunes/{id}/download-tokenized-dataset:
    get:
      tags: ['Fine-tuning']
      summary: Download tokenized dataset
      description: Get a presigned URL for the tokenized dataset archive generated for a fine-tune job.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the fine-tune job whose tokenized dataset should be downloaded.
            type: string
      responses:
        '200':
          description: Presigned tokenized dataset download URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTuneTokenizedDatasetRetrieveResponse'
        '404':
          description: Fine-tune job or tokenized dataset not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /finetune/download:
    get:
      tags: ['Fine-tuning']
      summary: Download model
      description: Receive a compressed fine-tuned model or checkpoint.
      parameters:
        - in: query
          name: ft_id
          required: true
          schema:
            description: Fine-tune ID to download. A string that starts with `ft-`.
            type: string
        - in: query
          name: checkpoint_step
          required: false
          schema:
            description: Specifies the checkpoint step to download from the list checkpoints response. A final checkpoint step downloads the final model; 0 or omitted downloads the final model by default. Ignores `checkpoint` value if set.
            type: integer
        - in: query
          name: checkpoint
          schema:
            description: Specifies checkpoint type to download - `merged` vs `adapter`. This field is required if the checkpoint_step is not set.
            type: string
            enum:
              - merged
              - adapter
              - model_output_path
      responses:
        '200':
          description: Successfully downloaded the fine-tuned model or checkpoint.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid request parameters.
        '404':
          description: Fine-tune ID not found.
  /fine-tunes/{id}/cancel:
    post:
      tags: ['Fine-tuning']
      summary: Cancel job
      description: Cancel a currently running fine-tuning job. Returns a FinetuneResponseTruncated object.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Fine-tune ID to cancel. A string that starts with `ft-`.
            type: string
      responses:
        '200':
          description: Successfully cancelled the fine-tuning job.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FinetuneResponseTruncated'
        '400':
          description: Invalid request parameters.
        '404':
          description: Fine-tune ID not found.
  /fine-tunes/{id}/metrics:
    get:
      tags: ['Fine-tuning']
      summary: Get metrics
      description: >
        Retrieves recorded training metrics for a fine-tuning job in chronological order. All query parameters are optional: omit them to retrieve all metrics.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: Fine-tune job ID. A string that starts with `ft-`.
            type: string
        - name: global_step_from
          in: query
          required: false
          schema:
            type: integer

          description: Return only metrics with global_step >= this value.
          example: 0
        - name: global_step_to
          in: query
          required: false
          schema:
            type: integer

          description: Return only metrics with global_step <= this value.
          example: 500
        - name: logged_at_from
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: Return only metrics logged at or after this ISO-8601 timestamp.
          example: "2024-01-01T00:00:00Z"
        - name: logged_at_to
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: Return only metrics logged at or before this ISO-8601 timestamp.
          example: "2024-01-01T12:00:00Z"
        - name: resolution
          in: query
          required: false
          schema:
            type: integer

          description: Number of (uniformly sampled) train metrics to return.
          example: 100
      responses:
        '200':
          description: List of metrics snapshots in chronological order.
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      additionalProperties:
                        type: number
                      description: A flat dictionary of scalar metric values.
                example:
                  metrics:
                    - train/loss: 0.5
                      train/learning_rate: 0.0001
                      train/global_step: 7
                    - train/loss: 0.45
                      train/learning_rate: 0.00009
                      train/global_step: 14
        '400':
          description: 'Invalid request: bad JSON body or missing job ID.'
        '404':
          description: Fine-tune job not found.
        '500':
          description: 'Internal server error: failed to retrieve metrics.'
  /fine-tunes/models/supported:
    get:
      tags: ['Fine-tuning']
      summary: List supported models
      description: List models supported for fine-tuning.
      responses:
        '200':
          description: List of supported models.
          content:
            application/json:
              schema:
                type: object
                required:
                  - models
                  - detailed_models
                properties:
                  models:
                    type: array
                    items:
                      type: string
                    description: List of supported model names.
                  detailed_models:
                    type: array
                    items:
                      type: object
                      required:
                        - name
                        - parent_model
                      properties:
                        name:
                          type: string
                          description: Supported model name.
                        parent_model:
                          type: string
                          description: Parent model used for fine-tuning.
                    description: Supported models with parent model details.
  /fine-tunes/models/limits:
    get:
      tags: ['Fine-tuning']
      summary: Get model limits
      description: Get model limits for a specific fine-tuning model.
      parameters:
        - in: query
          name: model_name
          schema:
            type: string
            description: The model name to get limits for.
          required: true
      responses:
        '200':
          description: Model limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTuneModelLimits'
        '404':
          description: Model not found or not supported for fine-tuning.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message explaining the model is not available.
  /rerank:
    post:
      tags: ['Rerank']
      summary: Create a rerank request
      description: Rerank a list of documents by relevance to a query. Returns a relevance score and ordering index for each document.
      operationId: rerank
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RerankRequest'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RerankResponse'
        '400':
          description: 'BadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'NotFound'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '503':
          description: 'Overloaded'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '504':
          description: 'Timeout'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      deprecated: false
  /audio/speech:
    post:
      tags: ['Audio']
      summary: Create audio generation request
      description: Generate audio from input text
      operationId: audio-speech
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioSpeechRequest'
      responses:
        '200':
          description: 'OK'
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
            audio/wav:
              schema:
                type: string
                format: binary
            audio/mpeg:
              schema:
                type: string
                format: binary
            text/event-stream:
              schema:
                $ref: '#/components/schemas/AudioSpeechStreamResponse'
        '400':
          description: 'BadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /audio/speech/websocket:
    get:
      tags: ['Audio']
      summary: Real-time text-to-speech via WebSocket
      description: |
        Establishes a WebSocket connection for real-time text-to-speech generation. This endpoint uses WebSocket protocol (wss://api.together.ai/v1/audio/speech/websocket) for bidirectional streaming communication.

        **Connection Setup:**
        - Protocol: WebSocket (wss://)
        - Authentication: Pass API key as Bearer token in Authorization header
        - Parameters: Sent as query parameters (model, voice, max_partial_length, language)

        **Client Events:**
        - `tts_session.updated`: Update session parameters like voice. The `session` object also accepts an `extra_params` field for additional model-specific parameters that fine-tune speech generation behavior, such as `pronunciation_dict` (a list of pronunciation rules for specific characters or symbols, where each entry uses the format `"<source>/<replacement>"` (e.g., `["omg/oh my god"]`) to override how the model pronounces matching tokens).
          ```json
          {
            "type": "tts_session.updated",
            "session": {
              "voice": "tara",
              "extra_params": {
                "pronunciation_dict": ["omg/oh my god"]
              }
            }
          }
          ```
        - `input_text_buffer.append`: Send text chunks for TTS generation
          ```json
          {
            "type": "input_text_buffer.append",
            "text": "Hello, this is a test."
          }
          ```
        - `input_text_buffer.clear`: Clear the buffered text
          ```json
          {
            "type": "input_text_buffer.clear"
          }
          ```
        - `input_text_buffer.commit`: Signal end of text input and process remaining text
          ```json
          {
            "type": "input_text_buffer.commit"
          }
          ```

        **Server Events:**
        - `session.created`: Initial session confirmation (sent first)
          ```json
          {
            "event_id": "evt_123456",
            "type": "session.created",
            "session": {
              "id": "session-id",
              "object": "realtime.tts.session",
              "modalities": ["text", "audio"],
              "model": "hexgrad/Kokoro-82M",
              "voice": "tara"
            }
          }
          ```
        - `conversation.item.input_text.received`: Acknowledgment that text was received
          ```json
          {
            "type": "conversation.item.input_text.received",
            "text": "Hello, this is a test."
          }
          ```
        - `conversation.item.audio_output.delta`: Audio chunks as base64-encoded data
          ```json
          {
            "type": "conversation.item.audio_output.delta",
            "item_id": "tts_1",
            "delta": "<base64_encoded_audio_chunk>"
          }
          ```
        - `conversation.item.audio_output.done`: Audio generation complete for an item
          ```json
          {
            "type": "conversation.item.audio_output.done",
            "item_id": "tts_1"
          }
          ```
        - `conversation.item.tts.failed`: Error occurred
          ```json
          {
            "type": "conversation.item.tts.failed",
            "error": {
              "message": "Error description",
              "type": "invalid_request_error",
              "param": null,
              "code": "invalid_api_key"
            }
          }
          ```

        **Text Processing:**
        - Partial text (no sentence ending) is held in buffer until:
          - We believe that the text is complete enough to be processed for TTS generation
          - The partial text exceeds `max_partial_length` characters (default: 250)
          - The `input_text_buffer.commit` event is received

        **Audio Format:**
        - Format: Raw PCM (s16le, mono)
        - Sample Rate: 24000 Hz
        - Encoding: Base64 (per delta event)
        - Delivered via `conversation.item.audio_output.delta` events

        **Error Codes:**
        - `invalid_api_key`: Invalid API key provided (401)
        - `missing_api_key`: Authorization header missing (401)
        - `model_not_available`: Invalid or unavailable model (400)
        - Invalid text format errors (400)

      operationId: realtime-tts
      parameters:
        - in: query
          name: model
          required: false
          schema:
            description: The TTS model to use for speech generation. Can also be set via `tts_session.updated` event.
            type: string
            enum:
              - hexgrad/Kokoro-82M
              - cartesia/sonic-english
            default: hexgrad/Kokoro-82M
        - in: query
          name: voice
          required: false
          schema:
            type: string
            description: |
              The voice to use for speech generation. Default is 'tara'.
              Available voices vary by model. Can also be updated via `tts_session.updated` event.
        - in: query
          name: max_partial_length
          required: false
          schema:
            type: integer
            default: 250
            description: |
              Maximum number of characters in partial text before forcing TTS generation
              even without a sentence ending. Helps reduce latency for long text without punctuation.
        - in: query
          name: language
          required: false
          schema:
            type: string
            default: en
            example: en
            description: |
              Language or locale of input text. Accepts ISO 639-1 language codes (e.g., `en`, `fr`, `es`, `zh`) as well as locale codes for region-specific variants. Locale codes must be lowercase (e.g., `zh-hk` for Cantonese). Can also be set via `tts_session.updated` event.
      responses:
        '101':
          description: |
            Switching Protocols - WebSocket connection established successfully.

            Error message format:
            ```json
            {
              "type": "conversation.item.tts.failed",
              "error": {
                "message": "Error description",
                "type": "invalid_request_error",
                "param": null,
                "code": "error_code"
              }
            }
            ```
  /audio/transcriptions:
    post:
      tags: ['Audio']
      summary: Create audio transcription request
      description: Transcribes audio into text
      operationId: audio-transcriptions
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudioTranscriptionRequest'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioTranscriptionResponse'
        '400':
          description: >-
            BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '413':
          description: >-
            Payload Too Large. The request body exceeded the 80 MB direct-upload limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side).
          content:
            text/html:
              schema:
                type: string
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /audio/translations:
    post:
      tags: ['Audio']
      summary: Create audio translation request
      description: Translates audio into English
      operationId: audio-translations
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudioTranslationRequest'
      responses:
        '200':
          description: 'OK'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioTranslationResponse'
        '400':
          description: >-
            BadRequest. Possible error codes include `audio_too_long` (audio duration exceeds the 4 hour cap), `file_too_large` (URL-fetched audio exceeds the 1 GB server-side cap), `unsupported_format` (codec or container could not be decoded), and `invalid_params` (request parameters failed validation).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '401':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '413':
          description: >-
            Payload Too Large. The request body exceeded the 80 MB direct-upload limit. For larger payloads, host the file and submit an HTTPS URL via the `file` field (URL-fetched audio is capped at 1 GB server-side).
          content:
            text/html:
              schema:
                type: string
        '429':
          description: 'RateLimit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /compute/clusters:
    get:
      tags: ['GPUClusterService']
      summary: List all GPU clusters
      description: List all GPU clusters.
      operationId: GPUClusterService_List
      parameters:
        - name: projectId
          in: query
          schema:
            description: |-
              Optional UMS project ID to filter clusters by. When set, only clusters
               belonging to this project are returned. The caller must be a member of
               the project; otherwise the result set will be empty.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClusters'
    post:
      tags: ['GPUClusterService']
      summary: Create a GPU cluster
      description: |
        Create an Instant Cluster on Together's high-performance GPU clusters.
        With features like on-demand scaling, long-lived resizable high-bandwidth shared DC-local storage,
        Kubernetes and Slurm cluster flavors, a REST API, and Terraform support,
        you can run workloads flexibly without complex infrastructure management.
      operationId: GPUClusterService_Create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GPUClusterCreateRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClusterInfo'
  /compute/clusters/{cluster_id}:
    get:
      tags: ['GPUClusterService']
      summary: Get GPU cluster by cluster ID
      description: Retrieve information about a specific GPU cluster.
      operationId: GPUClusterService_Get
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster to retrieve
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClusterInfo'
    put:
      tags: ['GPUClusterService']
      summary: Update a GPU cluster
      description: Update the configuration of an existing GPU cluster.
      operationId: GPUClusterService_Update
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster to update
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GPUClusterUpdateRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClusterInfo'
    delete:
      tags: ['GPUClusterService']
      summary: Delete GPU cluster by cluster ID
      description: Delete a GPU cluster by cluster ID.
      operationId: GPUClusterService_Delete
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster to delete
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClusterDeleteResponse'
  /compute/regions:
    get:
      tags: ['RegionService']
      summary: List regions and corresponding supported driver versions
      operationId: RegionService_List
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegionListResponse'
  /compute/clusters/storage/volumes:
    get:
      tags: ['SharedVolumeService']
      summary: List all shared volumes
      description: List all shared volumes.
      operationId: SharedVolumeService_List
      parameters:
        - name: projectId
          in: query
          schema:
            description: |-
              Optional UMS project ID to filter volumes by. When set, only volumes
               belonging to this project are returned. The caller must be a member of
               the project; otherwise the result set will be empty.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClustersSharedVolumes'
    put:
      tags: ['SharedVolumeService']
      summary: Update a shared volume
      description: |
        Update the configuration of an existing shared volume.
      operationId: SharedVolumeService_Update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GPUClustersSharedVolumeUpdateRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClustersSharedVolume'
    post:
      tags: ['SharedVolumeService']
      summary: Create a shared volume
      description: |
        Instant Clusters supports long-lived, resizable in-DC shared storage with user data persistence.
        You can dynamically create and attach volumes to your cluster at cluster creation time, and resize as your data grows.
        All shared storage is backed by multi-NIC bare metal paths, ensuring high-throughput and low-latency performance for shared storage.
      operationId: SharedVolumeService_Create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GPUClustersSharedVolumeCreateRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClustersSharedVolume'
  /compute/clusters/storage/volumes/{volume_id}:
    get:
      tags: ['SharedVolumeService']
      summary: Get a shared volume by ID
      description: Retrieve information about a specific shared volume.
      operationId: SharedVolumeService_Get
      parameters:
        - name: volume_id
          in: path
          required: true
          schema:
            description: The ID of the volume to retrieve
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClustersSharedVolume'
    delete:
      tags: ['SharedVolumeService']
      summary: Delete a shared volume by ID
      description: |
        Delete a shared volume. Note that if this volume is attached to a cluster, deleting will fail.
      operationId: SharedVolumeService_Delete
      parameters:
        - name: volume_id
          in: path
          required: true
          schema:
            description: The ID of the volume to delete
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GPUClustersSharedVolumeDeleteResponse'
  /clusters/availability-zones:
    get:
      tags: ['endpoints']
      summary: List all available availability zones
      description: List all available availability zones.
      operationId: availabilityZones
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAvailibilityZonesResponse'
  /endpoints:
    get:
      tags: ['Endpoints']
      summary: List all endpoints
      description: Returns a list of all endpoints associated with your account. You can filter the results by type (dedicated or serverless).
      operationId: listEndpoints
      parameters:
        - name: type
          in: query
          required: false
          schema:
            description: Filter endpoints by type
            type: string
            enum:
              - dedicated
              - serverless
        - name: usage_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - on-demand
              - reserved
            description: Filter endpoints by usage type
        - name: mine
          in: query
          required: false
          schema:
            type: boolean
            description: If true, return only endpoints owned by the caller
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                properties:
                  object:
                    description: The object type, which is always `list`.
                    const: list
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ListEndpoint'
                example:
                  object: 'list'
                  data:
                    - object: 'endpoint'
                      id: 'endpoint-5c0c20db-62fe-4f41-8ffc-d9e4ea1a264e'
                      name: 'allenai/OLMo-7B'
                      model: 'allenai/OLMo-7B'
                      type: 'serverless'
                      owner: 'together'
                      state: 'STARTED'
                      created_at: '2024-02-28T21:34:35.444Z'
        '403':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: 'Internal error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    post:
      tags: ['Endpoints']
      summary: Create a dedicated endpoint
      description: Creates a new dedicated endpoint for serving models. The endpoint starts automatically after creation. You can deploy any supported model on hardware configurations that meet the model's requirements.
      operationId: createEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEndpointRequest'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DedicatedEndpoint'
        '403':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: 'Internal error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

  /endpoints/{endpointId}:
    get:
      tags: ['Endpoints']
      summary: Get endpoint by ID
      description: Retrieves details about a specific endpoint, including its current state, configuration, and scaling settings.
      operationId: getEndpoint
      parameters:
        - name: endpointId
          in: path
          required: true
          schema:
            type: string
            description: The ID of the endpoint to retrieve
            example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DedicatedEndpoint'
        '403':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: 'Internal error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

    patch:
      tags: ['Endpoints']
      summary: Update endpoint, this can also be used to start or stop a dedicated endpoint
      description: Updates an existing endpoint's configuration. You can modify the display name, autoscaling settings, or change the endpoint's state (start/stop).
      operationId: updateEndpoint
      parameters:
        - name: endpointId
          in: path
          required: true
          schema:
            type: string
            description: The ID of the endpoint to update
            example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type: string
                  description: A human-readable name for the endpoint
                  example: My Llama3 70b endpoint
                state:
                  type: string
                  description: The desired state of the endpoint
                  enum:
                    - STARTED
                    - STOPPED
                  example: STARTED
                autoscaling:
                  $ref: '#/components/schemas/Autoscaling'
                  description: New autoscaling configuration for the endpoint
                inactive_timeout:
                  type: integer
                  description: The number of minutes of inactivity after which the endpoint stops automatically. Set to 0 to disable automatic timeout.
                  nullable: true
                  example: 60
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DedicatedEndpoint'
        '403':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: 'Internal error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

    delete:
      tags: ['Endpoints']
      summary: Delete endpoint
      description: Permanently deletes an endpoint. This action cannot be undone.
      operationId: deleteEndpoint
      parameters:
        - name: endpointId
          in: path
          required: true
          schema:
            type: string
            description: The ID of the endpoint to delete
            example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7
      responses:
        '204':
          description: 'No Content - Endpoint successfully deleted'
        '403':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'Not Found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: 'Internal error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

  /endpoints/{endpointId}/adapters:
    parameters:
      - name: endpointId
        in: path
        required: true
        schema:
          type: string
        description: The endpoint ID
    post:
      tags: ['Endpoints']
      summary: Add a LoRA adapter to an endpoint
      description: |
        Adds a LoRA adapter model to a dedicated endpoint. After this call,
        inference requests to the adapter model name will be routed to the
        specified endpoint. The endpoint must have LoRA enabled, and the
        adapter's base model must be compatible with the endpoint's model.
        The endpoint name prefix in model_id must match the resolved endpoint.
      operationId: addAdapter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model_id
              properties:
                model_id:
                  type: string
                  description: 'Combined identifier in format "endpoint_name:adapter_model_name".'
                  example: 'username/Meta-Llama-3.1-8B-Instruct-def456:username/my-adapter-abc123'
      responses:
        '200':
          description: Adapter successfully bound to endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  model_id:
                    type: string
        '400':
          description: 'Bad Request — invalid model_id format, endpoint name mismatch, LoRA not enabled, incompatible base model, or adapter already bound'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '403':
          description: 'Forbidden — adapter model not found or not owned'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'Not Found — endpoint does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    get:
      tags: ['Endpoints']
      summary: List adapters on an endpoint
      description: Returns all LoRA adapters bound to the specified dedicated endpoint.
      operationId: listAdapters
      responses:
        '200':
          description: List of bound adapters
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: 'list'
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        model_id:
                          type: string
                          description: 'Combined endpoint:adapter identifier'
                        adapter_name:
                          type: string
                        endpoint_name:
                          type: string
        '404':
          description: 'Not Found — endpoint does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
    delete:
      tags: ['Endpoints']
      summary: Remove a LoRA adapter from an endpoint
      description: |
        Removes the routing rule that binds an adapter to an endpoint.
        The adapter must be currently bound to this specific endpoint.
      operationId: removeAdapter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model_id
              properties:
                model_id:
                  type: string
                  description: 'Combined identifier in format "endpoint_name:adapter_model_name".'
      responses:
        '200':
          description: Adapter successfully unbound
          content:
            application/json:
              schema:
                type: object
                properties:
                  model_id:
                    type: string
                  deleted:
                    type: boolean
        '400':
          description: 'Bad Request — invalid model_id format, or adapter not bound to this endpoint'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '403':
          description: 'Forbidden — adapter model not found or not owned'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '404':
          description: 'Not Found — endpoint does not exist'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'

  /hardware:
    get:
      tags: ['Hardware']
      summary: List available hardware configurations
      description: >
        Returns a list of available hardware configurations for deploying models. When a model parameter is provided, it returns only hardware configurations compatible with that model, including their current availability status.
      operationId: listHardware
      parameters:
        - name: model
          in: query
          required: false
          schema:
            type: string
            description: |
              Filter hardware configurations by model compatibility. When provided,
              the response includes availability status for each compatible configuration.
              [See all of Together AI's dedicated models](https://docs.together.ai/docs/dedicated-models)
            example: deepseek-ai/DeepSeek-R1
      responses:
        '200':
          description: 'List of available hardware configurations'
          content:
            application/json:
              schema:
                type: object
                required:
                  - object
                  - data
                properties:
                  object:
                    description: The object type, which is always `list`.
                    const: list
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/HardwareWithStatus'
        '403':
          description: 'Unauthorized'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: 'Internal error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /tci/execute:
    post:
      tags: ['Code Interpreter']
      summary: Execute code
      callbacks: {}
      description: |
        Executes the given code snippet and returns the output. Without a session_id, a new session is created to run the code. If you pass a valid session_id, the code runs in that session. This is useful for running multiple code snippets in the same environment, because dependencies and similar things are persisted
        between calls to the same session.
      operationId: tci/execute
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteRequest'
        description: Execute Request
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecuteResponse'
          description: Execute Response
  /tci/sessions:
    get:
      summary: List active sessions
      tags: ['Code Interpreter']
      callbacks: {}
      description: |
        Lists all your currently active sessions.
      operationId: sessions/list
      parameters: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionListResponse'
          description: List Response
  /batches:
    get:
      tags: ['Batches']
      summary: List batch jobs
      description: List all batch jobs for the authenticated user
      security:
        - bearerAuth: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BatchJob'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
    post:
      tags: ['Batches']
      summary: Create a batch job
      description: Create a new batch job with the given input file and endpoint
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatchRequest'
      responses:
        '201':
          description: Job created (potentially with warnings)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchJobWithWarning'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'

  /batches/{id}:
    get:
      tags: ['Batches']
      summary: Get a batch job
      description: Get details of a batch job by ID
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the batch job to retrieve
            example: batch_job_abc123def456
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchJob'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
  /batches/{id}/cancel:
    post:
      tags: ['Batches']
      summary: Cancel a batch job
      description: Cancel a batch job by ID
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The ID of the batch job to cancel
            example: batch_job_abc123def456
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchJob'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchErrorResponse'
  /evaluation:
    post:
      tags:
        - evaluation
      summary: Create an evaluation job
      operationId: createEvaluationJob

      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EvaluationTypedRequest"
      responses:
        "200":
          description: "Evaluation job created successfully"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EvaluationResponse"
        "400":
          description: "Invalid request format"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
        "500":
          description: "Failed to create evaluation job"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
    get:
      tags:
        - evaluation
      summary: Get all evaluation jobs
      operationId: getAllEvaluationJobs
      parameters:
        - name: status
          in: query
          required: false
          schema:
            type: string
            description: Filter evaluation jobs by status
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 10
            description: Limit the number of results
      responses:
        "200":
          description: "evaluation jobs retrieved successfully"
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/EvaluationJob"
        "400":
          description: "Invalid request format"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
        "500":
          description: "Error retrieving jobs from manager"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
  /evaluation/model-list:
    get:
      tags:
        - evaluation
      summary: Get model list
      operationId: getModelList
      parameters:
        - name: model_source
          in: query
          required: false
          schema:
            type: string
            description: Filter models by source
            default: "all"
      responses:
        "200":
          description: "Model list retrieved successfully"
          content:
            application/json:
              schema:
                type: object
                properties:
                  model_list:
                    type: array
                    items:
                      type: string
                      description: "The name of the model"
        "400":
          description: "Invalid request format"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
        "500":
          description: "Error retrieving model list"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
  /evaluation/{id}:
    get:
      tags:
        - evaluation
      summary: Get evaluation job details
      operationId: getEvaluationJobDetails
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the evaluation job to retrieve
            type: string
      responses:
        "200":
          description: "Evaluation job details retrieved successfully"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EvaluationJob"
        "404":
          description: "Evaluation job not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
        "500":
          description: "Failed to get evaluation job"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"

  /evaluation/{id}/status:
    get:
      tags:
        - evaluation
      summary: Get evaluation job status and results
      operationId: getEvaluationJobStatusAndResults
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: The ID of the evaluation job to get the status of
            type: string
      responses:
        "200":
          description: "Evaluation job status and results retrieved successfully"
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: "The status of the evaluation job"
                    enum: ["completed", "error", "user_error", "running", "queued", "pending"]
                  results:
                    description: "The results of the evaluation job"
                    oneOf:
                      - $ref: "#/components/schemas/EvaluationClassifyResults"
                      - $ref: "#/components/schemas/EvaluationScoreResults"
                      - $ref: "#/components/schemas/EvaluationCompareResults"
        "404":
          description: "Evaluation job not found"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"
        "500":
          description: "Failed to get evaluation job"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorData"

  /realtime:
    get:
      tags: ['Audio']
      summary: Real-time audio transcription via WebSocket
      description: |
        Establishes a WebSocket connection for real-time audio transcription. This endpoint uses WebSocket protocol (wss://api.together.ai/v1/realtime) for bidirectional streaming communication.

        **Connection Setup:**
        - Protocol: WebSocket (wss://)
        - Authentication: Pass API key as Bearer token in Authorization header
        - Parameters: Sent as query parameters (model, input_audio_format)

        **Client Events:**
        - `input_audio_buffer.append`: Send audio chunks as base64-encoded data
          ```json
          {
            "type": "input_audio_buffer.append",
            "audio": "<base64_encoded_audio_chunk>"
          }
          ```
        - `input_audio_buffer.commit`: Signal end of audio stream. When VAD is enabled, the server automatically detects speech boundaries and emits `completed` events. When VAD is disabled, you must send `commit` to trigger transcription of the buffered audio.
          ```json
          {
            "type": "input_audio_buffer.commit"
          }
          ```
        - `transcription_session.updated`: Update session configuration, including Voice Activity Detection (VAD) parameters. Send this after receiving `session.created`. Can also be sent at any time during the session to change VAD settings.
          ```json
          {
            "type": "transcription_session.updated",
            "session": {
              "turn_detection": {
                "type": "server_vad",
                "threshold": 0.3,
                "min_silence_duration_ms": 500,
                "min_speech_duration_ms": 250,
                "max_speech_duration_s": 5.0,
                "speech_pad_ms": 250
              }
            }
          }
          ```
          To disable VAD entirely (manual commit mode), set `turn_detection` to `null`:
          ```json
          {
            "type": "transcription_session.updated",
            "session": {
              "turn_detection": null
            }
          }
          ```

        **Voice Activity Detection (VAD)**

        VAD controls how the server automatically detects speech segments in the audio stream. When enabled (the default), the server uses Silero VAD to identify speech regions and emits transcription events as each segment completes. When disabled, you must manually call `input_audio_buffer.commit` to trigger transcription.

        VAD can be configured in two ways:
        1. **Query parameters** at connection time: `turn_detection=server_vad&threshold=0.3&min_silence_duration_ms=500`
        2. **Session message** after connection: Send `transcription_session.updated` with a `turn_detection` object (see above)

        To disable VAD at connection time, use `turn_detection=none` as a query parameter.

        **VAD Parameters:**

        All parameters are Omitted fields use their defaults.

        | Parameter | Type | Default | Description |
        |-----------|------|---------|-------------|
        | `type` | string | `server_vad` | VAD mode. Use `server_vad` to enable, or set `turn_detection` to `null` to disable. |
        | `threshold` | float | `0.3` | Speech probability threshold (0.0–1.0). Audio frames with probability above this value are classified as speech. Lower values detect more speech but may increase false positives. For low-SNR audio (e.g., 8kHz phone calls), values of 0.01–0.2 may work better. |
        | `min_silence_duration_ms` | int | `500` | Minimum silence duration in milliseconds before ending a speech segment. Higher values merge nearby speech bursts into single segments. For phone calls with mid-sentence pauses, 2000–5000ms prevents over-segmentation. |
        | `min_speech_duration_ms` | int | `250` | Minimum speech segment duration in milliseconds. Segments shorter than this are discarded. Filters out brief noise bursts or clicks. |
        | `max_speech_duration_s` | float | `5.0` | Maximum speech segment duration in seconds. Segments longer than this are force-split at the longest internal silence gap. Useful for continuous speech without natural pauses. |
        | `speech_pad_ms` | int | `250` | Padding in milliseconds added to the start and end of each detected segment. Prevents clipping speech edges. When padding would cause adjacent segments to overlap, the gap is split at the midpoint instead. |

        **Server Events:**
        - `session.created`: Initial session confirmation (sent first)
          ```json
          {
            "type": "session.created",
            "session": {
              "id": "session-id",
              "object": "realtime.session",
              "modalities": ["audio"],
              "model": "openai/whisper-large-v3"
            }
          }
          ```
        - `transcription_session.updated`: Confirms session configuration was applied. Sent in response to a client `transcription_session.updated` message.
          ```json
          {
            "type": "transcription_session.updated",
            "session": {
              "turn_detection": {
                "type": "server_vad",
                "threshold": 0.3,
                "min_silence_duration_ms": 500,
                "min_speech_duration_ms": 250,
                "max_speech_duration_s": 5.0,
                "speech_pad_ms": 250
              }
            }
          }
          ```
        - `conversation.item.input_audio_transcription.delta`: Partial transcription results
          ```json
          {
            "type": "conversation.item.input_audio_transcription.delta",
            "delta": "The quick brown"
          }
          ```
        - `conversation.item.input_audio_transcription.completed`: Final transcription
          ```json
          {
            "type": "conversation.item.input_audio_transcription.completed",
            "transcript": "The quick brown fox jumps over the lazy dog"
          }
          ```
        - `conversation.item.input_audio_transcription.failed`: Error occurred
          ```json
          {
            "type": "conversation.item.input_audio_transcription.failed",
            "error": {
              "message": "Error description",
              "type": "invalid_request_error",
              "param": null,
              "code": "invalid_api_key"
            }
          }
          ```

        **Error Codes:**
        - `invalid_api_key`: Invalid API key provided (401)
        - `missing_api_key`: Authorization header missing (401)
        - `model_not_available`: Invalid or unavailable model (400)
        - Unsupported audio format errors (400)

      operationId: realtime-transcription
      parameters:
        - in: query
          name: model
          required: true
          schema:
            type: string
            description: The Whisper model to use for transcription
        - in: query
          name: input_audio_format
          required: true
          schema:
            type: string
            enum:
              - pcm_s16le_16000
            default: pcm_s16le_16000
          description: Audio format specification. Currently supports 16-bit PCM at 16kHz sample rate.
      responses:
        '101':
          description: |
            Switching Protocols - WebSocket connection established successfully.

            Error message format:
            ```json
            {
              "type": "conversation.item.input_audio_transcription.failed",
              "error": {
                "message": "Error description",
                "type": "invalid_request_error",
                "param": null,
                "code": "error_code"
              }
            }
            ```

  /queue/cancel:
    post:
      description: |
        Cancel a pending job. Only jobs in pending status can be canceled.
        Running jobs cannot be stopped. Returns the job status after the
        attempt. If the job is not pending, returns 409 with the current status
        unchanged.
      operationId: cancelQueueJob
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QueueCancelRequest"
        description: Cancel request
        required: true
      responses:
        "200":
          description: Successfully canceled
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueCancelResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "404":
          description: Request not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "409":
          description: Job could not be canceled (already completed/failed)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueCancelResponse"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
      summary: Cancel a queued job
      tags:
        - Queue
  /queue/clear:
    post:
      description: Cancel all pending jobs for the given model. Running jobs are left untouched. Returns the number of jobs that were canceled.
      operationId: clearQueue
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QueueClearRequest"
        description: Clear request
        required: true
      responses:
        "200":
          description: Pending jobs canceled
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueClearResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
      summary: Clear a model's pending jobs
      tags:
        - Queue
  /queue/metrics:
    get:
      description: Get the current queue statistics for a model, including pending and running job counts.
      operationId: getQueueMetrics
      parameters:
        - name: model
          in: query
          required: true
          schema:
            description: Model name to get metrics for
            type: string
      responses:
        "200":
          description: Queue metrics
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueMetricsResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
      summary: Get queue metrics
      tags:
        - Queue
  /queue/status:
    get:
      description: Poll the current status of a previously submitted job. Provide the request_id and model as query parameters.
      operationId: getQueueJobStatus
      parameters:
        - name: request_id
          in: query
          required: true
          schema:
            description: Request ID returned from the submit endpoint
            type: string
        - name: model
          in: query
          required: true
          schema:
            description: Model name the job was submitted to
            type: string
      responses:
        "200":
          description: Status information
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueJobStatusResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "404":
          description: Request not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
      summary: Get job status
      tags:
        - Queue
  /queue/submit:
    post:
      description: |
        Submit a new job to the queue for asynchronous processing. Jobs are
        processed in strict priority order (higher priority first, FIFO within
        the same priority). Returns a request ID that can be used to poll status
        or cancel the job.
      operationId: submitQueueJob
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QueueJobRequest"
        description: Job request
        required: true
      responses:
        "200":
          description: Successfully queued request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueJobResponse"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QueueError"
      summary: Submit a queued job
      tags:
        - Queue
  /rl/model-resources:
    get:
      summary: List model resources
      description: Lists the caller's model resources.
      operationId: listModelResources
      tags: [RL]
      responses:
        "200":
          description: List of model resources
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResourcesListResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: status
          in: query
          required: false
          schema:
            description: Status filters. When omitted, resources in any status are returned.
            type: array
            items:
              type: string
              enum:
                - MODEL_RESOURCES_STATUS_PENDING
                - MODEL_RESOURCES_STATUS_CREATING
                - MODEL_RESOURCES_STATUS_READY
                - MODEL_RESOURCES_STATUS_ERROR
                - MODEL_RESOURCES_STATUS_STOPPED
                - MODEL_RESOURCES_STATUS_STOPPING
        - name: limit
          in: query
          required: false
          schema:
            description: Maximum number of resources to return (1-100)
            type: integer
            default: "20"
        - name: after
          in: query
          required: false
          schema:
            description: Cursor for pagination
            type: string
        - name: created_by
          in: query
          required: false
          schema:
            description: Filter resources in the current project by the creator ID. Pass "me" to show resources you created.
            type: string
    post:
      summary: Create model resources
      description: Provisions a standalone model resource that training sessions can attach to.
      operationId: createModelResources
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.CreateModelResourcesRequest'
        required: true
      responses:
        "200":
          description: Model resource details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResources'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /rl/model-resources/estimate-cost:
    post:
      summary: Estimate on-demand model resource cost
      description: Estimates a model resource's on-demand hourly price without creating it.
      operationId: estimateModelResourcesCost
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.CreateModelResourcesRequest'
        required: true
      responses:
        "200":
          description: Estimated on-demand cost
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResourcesEstimateCostResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /rl/model-resources/{model_resources_id}:
    get:
      summary: Get model resources
      description: Gets a model resource by its ID and returns its details.
      operationId: getModelResources
      tags: [RL]
      responses:
        "200":
          description: Model resource details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResources'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: model_resources_id
          in: path
          required: true
          schema:
            description: ID of the model resource
            type: string
  /rl/model-resources/{model_resources_id}/stop:
    post:
      summary: Stop model resources
      description: Stops every session attached to the resource and tears down its GPU pods.
      operationId: stopModelResources
      tags: [RL]
      responses:
        "200":
          description: Model resource details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ModelResources'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: model_resources_id
          in: path
          required: true
          schema:
            description: ID of the model resource
            type: string
        - name: force
          in: query
          required: false
          schema:
            description: Stop the resource even if active training sessions are attached
            type: boolean
            default: false
  /rl/training-sessions:
    get:
      summary: List training sessions
      description: Lists all training sessions.
      operationId: listTrainingSessions
      tags: [RL]
      responses:
        "200":
          description: List of training sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingSessionsListResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: status
          in: query
          required: false
          schema:
            description: Status filters. When omitted, sessions in any status are returned.
            type: array
            items:
              type: string
              enum:
                - TRAINING_SESSION_STATUS_CREATING
                - TRAINING_SESSION_STATUS_RUNNING
                - TRAINING_SESSION_STATUS_STOPPED
                - TRAINING_SESSION_STATUS_STOPPING
                - TRAINING_SESSION_STATUS_ERROR
                - TRAINING_SESSION_STATUS_EXPIRED
        - name: limit
          in: query
          required: false
          schema:
            description: Maximum number of sessions to return (1-100)
            type: integer
            default: "20"
        - name: after
          in: query
          required: false
          schema:
            description: Cursor for pagination (ID of the last session from the previous page)
            type: string
        - name: model_resources_id
          in: query
          required: false
          schema:
            description: Filter sessions by the model resource they are attached to
            type: string
        - name: created_by
          in: query
          required: false
          schema:
            description: Filter sessions in the current project by the creator ID. Pass "me" to show sessions you created.
            type: string
    post:
      summary: Create training session
      description: Creates a training session and returns its details.
      operationId: startTrainingSession
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.StartTrainingSessionRequest'
        required: true
      responses:
        "200":
          description: Training session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingSession'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /rl/supported-models:
    get:
      summary: List supported models
      description: Returns the models supported by the RL service and their limits for training/sampling operations.
      operationId: listSupportedModels
      tags: [RL]
      responses:
        "200":
          description: List of supported RL models
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.SupportedModelsListResponse'
        "429":
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
  /rl/training-sessions/{session_id}:
    get:
      summary: Get training session
      description: Gets a training session by its ID and returns its details.
      operationId: getTrainingSession
      tags: [RL]
      responses:
        "200":
          description: Training session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingSession'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: ID of the training session
            type: string
    patch:
      summary: Update a training session
      description: Updates the display name or metadata associated with a training session. Omitted fields remain unchanged, and empty strings clear existing values.
      operationId: updateTrainingSession
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.UpdateTrainingSessionRequest'
        required: true
      responses:
        "200":
          description: Updated training session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingSession'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: ID of the training session
            type: string
  /rl/training-sessions/{session_id}/stop:
    post:
      summary: Stop training session
      description: Stops a training session.
      operationId: stopTrainingSession
      tags: [RL]
      responses:
        "200":
          description: Training session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingSession'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: ID of the training session
            type: string
  /rl/training-sessions/{session_id}/operations/forward-backward/{operation_id}:
    get:
      summary: Get forward-backward operation
      description: Retrieves the current status and result of a forward-backward operation.
      operationId: getForwardBackwardOperation
      tags: [RL]
      responses:
        "200":
          description: Forward-backward operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ForwardBackwardOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/optim-step/{operation_id}:
    get:
      summary: Get optim-step operation
      description: Retrieves the current status and result of an optim-step operation.
      operationId: getOptimStepOperation
      tags: [RL]
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.OptimStepOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/weights-sync/{operation_id}:
    get:
      summary: Get weights-sync operation
      description: Retrieves the current status and result of a weights-sync operation.
      operationId: getWeightsSyncOperation
      tags: [RL]
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.WeightsSyncOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/sample/{operation_id}:
    get:
      summary: Get sample operation
      description: Retrieves the current status and result of a sample operation.
      operationId: GetSample
      tags: [RL]
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.SampleOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/forward-backward:
    post:
      summary: Forward-backward pass
      description: Submits a forward-backward pass operation that will asynchronously compute gradients via backpropagation.
      operationId: forwardBackward
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.ForwardBackwardBody'
        required: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ForwardBackwardOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/custom-forward-backward:
    post:
      summary: Custom forward-backward pass
      description: Submits a forward-backward pass driven by externally computed gradients of the loss with respect to per-token log-probabilities.
      operationId: customForwardBackward
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.CustomForwardBackwardBody'
        required: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.CustomForwardBackwardOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/custom-forward-backward/{operation_id}:
    get:
      summary: Get custom forward-backward operation
      description: Retrieves the current status and result of a custom forward-backward operation.
      operationId: getCustomForwardBackwardOperation
      tags: [RL]
      responses:
        "200":
          description: Custom forward-backward operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.CustomForwardBackwardOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/forward:
    post:
      summary: Forward pass
      description: Submits a forward operation that will asynchronously run a no-grad forward pass and return per-token log-probabilities for each sample.
      operationId: forward
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.ForwardBody'
        required: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ForwardOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/forward/{operation_id}:
    get:
      summary: Get forward operation
      description: Retrieves the current status and result of a forward operation.
      operationId: getForwardOperation
      tags: [RL]
      responses:
        "200":
          description: Forward operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.ForwardOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/optim-step:
    post:
      summary: Optimizer step
      description: Submits an optimizer step operation that will asynchronously apply accumulated gradients to update model parameters. Does not make the updated parameters available for sampling; call `weights-sync` afterwards when you want subsequent samples to use the updated policy.
      operationId: OptimStep
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.OptimStepBody'
        required: true
      responses:
        "200":
          description: Optimizer step operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.OptimStepOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/weights-sync:
    post:
      summary: Weights sync
      description: Submits a weights-sync operation that makes the session's current trained parameters available for sampling. Call this after `optim-step` when you want subsequent samples to use the updated policy.
      operationId: WeightsSync
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.WeightsSyncBody'
        required: true
      responses:
        "200":
          description: Weights-sync operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.WeightsSyncOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/sample:
    post:
      summary: Sample
      description: Submits a sample operation that will asynchronously generate text completions with logprobs.
      operationId: Sample
      tags: [RL]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RL.SampleBody'
        required: true
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.SampleOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/inference-checkpoint:
    post:
      summary: Create inference checkpoint
      description: Submits an operation that will asynchronously save the current LoRA adapter as an inference checkpoint and upload it to object storage.
      operationId: createInferenceCheckpoint
      tags: [RL]
      responses:
        "200":
          description: Inference checkpoint operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.InferenceCheckpointOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/inference-checkpoint/{operation_id}:
    get:
      summary: Get inference checkpoint operation
      description: Retrieves the current status and result of an inference checkpoint operation.
      operationId: getInferenceCheckpointOperation
      tags: [RL]
      responses:
        "200":
          description: Inference checkpoint operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.InferenceCheckpointOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/training-sessions/{session_id}/operations/training-checkpoint:
    post:
      summary: Save training checkpoint
      description: Submits an operation that will asynchronously save the full training state (adapter + optimizer + step).
      operationId: createTrainingCheckpoint
      tags: [RL]
      responses:
        "200":
          description: Save training checkpoint operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingCheckpointOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
  /rl/training-sessions/{session_id}/operations/training-checkpoint/{operation_id}:
    get:
      summary: Get save training checkpoint operation
      description: Retrieves the current status and result of a save training checkpoint operation.
      operationId: getTrainingCheckpointOperation
      tags: [RL]
      responses:
        "200":
          description: Save training checkpoint operation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.TrainingCheckpointOperation'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            description: Training session ID
            type: string
        - name: operation_id
          in: path
          required: true
          schema:
            description: Operation ID
            type: string
  /rl/checkpoints/{id}/download:
    get:
      summary: Download checkpoint
      description: Returns presigned URLs for downloading a checkpoint's model files. Only inference checkpoints support downloading.
      operationId: downloadCheckpoint
      tags: [RL]
      responses:
        "200":
          description: Checkpoint download URLs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RL.CheckpointDownloadResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
      parameters:
        - name: id
          in: path
          required: true
          schema:
            description: ID of the checkpoint
            type: string
        - name: variant
          in: query
          required: true
          schema:
            description: "Checkpoint variant to download: merged (full model) or adapter (LoRA weights only)"
            $ref: '#/components/schemas/RL.CheckpointVariant'

  /compute/clusters/{cluster_id}/addons:
    get:
      tags: ['InstanceClusterAddOnService']
      operationId: InstanceClusterAddOnService_List
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster whose add-ons to list.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterAddOnsListResponse'
    post:
      tags: ['InstanceClusterAddOnService']
      operationId: InstanceClusterAddOnService_Create
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster to create the add-on on.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClusterAddOnCreateRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddOnInfo'
  /compute/clusters/{cluster_id}/addons/{addon_id}:
    get:
      tags: ['InstanceClusterAddOnService']
      operationId: InstanceClusterAddOnService_Get
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster that owns the add-on.
            type: string
        - name: addon_id
          in: path
          required: true
          schema:
            description: The ID of the add-on to retrieve.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddOnInfo'
    put:
      tags: ['InstanceClusterAddOnService']
      operationId: InstanceClusterAddOnService_Update
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster that owns the add-on.
            type: string
        - name: addon_id
          in: path
          required: true
          schema:
            description: The ID of the add-on to update.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClusterAddOnUpdateRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddOnInfo'
    delete:
      tags: ['InstanceClusterAddOnService']
      operationId: InstanceClusterAddOnService_Delete
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The ID of the cluster that owns the add-on.
            type: string
        - name: addon_id
          in: path
          required: true
          schema:
            description: The ID of the add-on to delete.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterAddOnDeleteResponse'
  /compute/clusters/{cluster_id}/instances/{instance_id}/remediations:
    get:
      tags: ['RemediationService']
      summary: List remediations
      description: |
        Lists remediations for an instance or cluster.
      operationId: RemediationService_ListRemediations
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
        - name: instance_id
          in: path
          required: true
          schema:
            description: |
              To list remediations on a specific node, pass the node's instance ID.
              To list remediations for all nodes in a cluster, pass `-` as a wildcard for the instance ID.
            type: string
        - name: page_size
          in: query
          schema:
            description: Maximum results to return.
            type: integer
        - name: page_token
          in: query
          schema:
            description: Pagination token from previous request.
            type: string
        - name: state
          in: query
          schema:
            description: |-
              Filter by state(s). Returns remediations matching any of the specified states.

              - `PENDING_APPROVAL`: Awaiting approval before processing can begin.
              - `PENDING`: Approved and queued for processing.
              - `RUNNING`: Actively being processed.
              - `SUCCEEDED`: Successfully completed.
              - `FAILED`: Failed with an error.
              - `CANCELLED`: Cancelled by user or system.
              - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
              - `QUARANTINING`: Cordoning or preparing the host before remediation.
              - `QUARANTINED`: Host has been cordoned or isolated for remediation.
            type: array
            items:
              enum:
                - PENDING_APPROVAL
                - PENDING
                - RUNNING
                - SUCCEEDED
                - FAILED
                - CANCELLED
                - AUTO_RESOLVED
                - QUARANTINING
                - QUARANTINED
              type: string
        - name: order_by
          in: query
          schema:
            description: Order by expression.
            type: string
        - name: trigger
          in: query
          schema:
            description: Filter by trigger type(s). Returns remediations matching any of the specified triggers.
            type: array
            items:
              enum:
                - REMEDIATION_TRIGGER_MANUAL
                - REMEDIATION_TRIGGER_AUTOMATED
              type: string
        - name: mode
          in: query
          schema:
            description: Filter by remediation mode(s). Returns remediations matching any of the specified modes.
            type: array
            items:
              enum:
                - REMEDIATION_MODE_VM_ONLY
                - REMEDIATION_MODE_HOST_AWARE
                - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT
                - REMEDIATION_MODE_REBOOT_VM
                - REMEDIATION_MODE_HOST_POWER_CYCLE
              type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRemediationsResponse'
    post:
      tags: ['RemediationService']
      description: |-
        Creates a new remediation for an instance.

        Remediations created via the API goes directly to PENDING state.

        Our system may trigger automated remediations that require approval. These remediations are created with PENDING_APPROVAL state.
        The user must call /approve to start the actual remediation process.
        These operations can also be rejected by calling /reject.
      operationId: RemediationService_CreateRemediation
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
        - name: remediation_id
          in: query
          schema:
            description: Client-specified ID for idempotency.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Remediation'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Remediation'
  /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}:
    get:
      tags: ['RemediationService']
      description: Retrieve the status of a specific remdiation on a specific instance in a specific cluster.
      operationId: RemediationService_GetRemediation
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
        - name: remediation_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Remediation'
  /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/approve:
    post:
      tags: ['RemediationService']
      description: |
        Approves a pending remediation.

        Only remediations with state PENDING_APPROVAL can be approved.

        On APPROVE: state changes to PENDING and the remediation process begins.
        The reviewed_by, review_time, and review_comment fields are populated
        on the remediation after approval.
      operationId: RemediationService_ApproveRemediation
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
        - name: remediation_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveRemediationRequest'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Remediation'
  /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/cancel:
    post:
      tags: ['RemediationService']
      description: |
        Cancels a pending remediation.

        Only remediations in PENDING_APPROVAL or PENDING state can be cancelled.
      operationId: RemediationService_CancelRemediation
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            description: The cluster ID.
            type: string
        - name: instance_id
          in: path
          required: true
          schema:
            description: The instance ID.
            type: string
        - name: remediation_id
          in: path
          required: true
          schema:
            description: The remediation ID.
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Remediation'
  /compute/clusters/{cluster_id}/instances/{instance_id}/remediations/{remediation_id}/reject:
    post:
      tags: ['RemediationService']
      description: |
        Rejects a pending remediation.

        Only remediations with state PENDING_APPROVAL can be rejected.

        On REJECT: state changes to CANCELLED.
        The reviewed_by, review_time, and review_comment fields are populated
        on the remediation after rejection.
      operationId: RemediationService_RejectRemediation
      parameters:
        - name: cluster_id
          in: path
          required: true
          schema:
            type: string
        - name: instance_id
          in: path
          required: true
          schema:
            type: string
        - name: remediation_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentBody'
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Remediation'
  /compute/passive_health_check_alerts:
    get:
      tags: ['HealthCheckService']
      summary: List passive health check alerts
      description: |-
        Lists passive health check alerts. Filters combine across axes; empty values skip that axis.
      operationId: HealthCheckService_ListPassiveHealthCheckAlerts
      parameters:
        - name: intent_id
          in: query
          schema:
            description: Remediation intent ID to filter by.
            type: string
        - name: instance_id
          in: query
          schema:
            description: Instance ID to filter by.
            type: string
        - name: cluster_id
          in: query
          schema:
            description: Optional instance cluster ID to filter by. Required for non-admin callers.
            type: string
        - name: page_size
          in: query
          schema:
            description: Max number of results to return.
            default: 50
            type: integer
        - name: page_token
          in: query
          schema:
            description: Opaque pagination token from the previous response.
            type: string
        - name: status
          in: query
          schema:
            description: Lifecycle filter. Omit to return firing alerts.
            enum:
              - PHC_ALERT_STATUS_FIRING
              - PHC_ALERT_STATUS_RESOLVED
              - PHC_ALERT_STATUS_ALL
            type: string
        - name: severity_filter
          in: query
          schema:
            description: Severity tiers to include. Omit or pass an empty array to include all severities.
            type: array
            items:
              enum:
                - PHC_SEVERITY_INFO
                - PHC_SEVERITY_WARNING
                - PHC_SEVERITY_CRITICAL
              type: string
        - name: order_by
          in: query
          schema:
            description: Sort order for returned alerts. Omit for newest alerts first.
            enum:
              - PHC_ALERT_ORDER_STARTED_AT_ASC
              - PHC_ALERT_ORDER_STARTED_AT_DESC
            default: PHC_ALERT_ORDER_STARTED_AT_DESC
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListPassiveHealthCheckAlertsResponse'
  /whoami:
    get:
      tags: ['Account']
      summary: Get API key identity
      description: >
        Returns identity information about the authenticated API key. Useful for confirming which project and organization a key is scoped to, and for obtaining the project slug used to compose the `model` value (`<project_slug>/<endpoint_slug>`) in dedicated endpoint inference calls.

        Requires a Bearer API key in the `Authorization` header. Cookie, session, and SLS JWT credentials are not accepted.
      operationId: whoami
      responses:
        '200':
          description: API key identity information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhoamiResponse'
        '401':
          description: Unauthorized — missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorData'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

  schemas:
    DE.ListPublicEndpointsResponse:
      type: object
      description: Response containing publicly discoverable endpoints and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.PublicEndpoint'
          description: Endpoints visible through the public catalog.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.PublicEndpoint:
      type: object
      description: Endpoint metadata exposed through the public endpoint catalog.
      required:
        - id
        - projectId
        - name
        - createdAt
        - updatedAt
        - visibility
      properties:
        id:
          type: string
          description: Unique endpoint identifier.
        projectId:
          type: string
          description: ID of the project that owns the endpoint.
        name:
          type: string
          description: Endpoint string in the form `<project_slug>/<endpoint_name>`, passed as the `model` parameter when calling inference.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the endpoint was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the endpoint was last updated.
        visibility:
          const: VISIBILITY_PUBLIC
          type: string
          description: Public visibility of the endpoint.
    DE.ListEndpointsResponse:
      type: object
      description: Response containing endpoints and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          description: The list of endpoints.
          type: array
          items:
            $ref: '#/components/schemas/DE.Endpoint'
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.Endpoint:
      description: Stable inference entry point that groups deployments and routes requests among them.
      type: object
      required:
        - name
        - id
        - projectId
        - createdAt
        - updatedAt
        - etag
        - deployments
        - trafficSplit
        - visibility
        - endpointType
      properties:
        id:
          readOnly: true
          description: Unique endpoint identifier.
          type: string
        projectId:
          readOnly: true
          type: string
          description: ID of the project that owns the endpoint.
        name:
          type: string
          description: |-
            Project-qualified endpoint name in the form `<project_slug>/<endpoint_name>`.
            Pass this value as `model` in inference requests. Create and update requests
            may use either a bare endpoint name or the qualified form; a supplied project
            slug must match the project in the request path.
        createdAt:
          readOnly: true
          type: string
          description: Timestamp when the endpoint was created.
          format: date-time
        updatedAt:
          type: string
          description: Output only. Timestamp when the endpoint was last updated.
          format: date-time
        etag:
          type: string
          description: |-
            Opaque version tag for optimistic concurrency control.
            Supply on update/delete to ensure consistent read-modify-write.
            If not set, the write overwrites based on current state.
        trafficSplit:
          type: array
          items:
            $ref: '#/components/schemas/DE.TrafficSplitEntry'
          description: Deployments eligible for live traffic and their capacity weights. An empty list leaves the endpoint unrouted.
        visibility:
          default: VISIBILITY_PRIVATE
          enum:
            - VISIBILITY_PRIVATE
            - VISIBILITY_INTERNAL
          type: string
          description: Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
        endpointType:
          readOnly: true
          enum:
            - ENDPOINT_TYPE_DEDICATED
            - ENDPOINT_TYPE_SERVERLESS
            - ENDPOINT_TYPE_RESERVED
          type: string
          description: Serving class of the endpoint. Reserved endpoints use reserved capacity.
        deployments:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/DE.DeploymentSummary'
          description: |-
            Lightweight summaries of deployments under this endpoint.
            Retrieve a deployment through the endpoint's deployment API for full details.
        activeRolloutId:
          readOnly: true
          type: string
          description: ID of the currently active rollout in an in-flight state, including paused.
    DE.DeploymentSummary:
      type: object
      description: Compact deployment status embedded in an endpoint response.
      required:
        - id
        - autoscaling
        - createdAt
        - model
        - modelId
        - name
        - state
        - trafficMode
        - estimatedEffectiveTrafficShare
      properties:
        id:
          readOnly: true
          type: string
          description: Deployment identifier.
        modelId:
          type: string
          description: Deprecated. Use `model`. Model identifier being served.
        hardware:
          readOnly: true
          type: string
          description: Hardware configuration selected by the deployment's config, such as its GPU type and count.
        trafficMode:
          enum:
            - TRAFFIC_MODE_LIVE
            - TRAFFIC_MODE_SHADOW
          type: string
          description: Whether the deployment serves client-visible responses or only mirrored shadow traffic.
        state:
          readOnly: true
          enum:
            - DEPLOYMENT_STATE_PROVISIONING
            - DEPLOYMENT_STATE_READY
            - DEPLOYMENT_STATE_SCALING
            - DEPLOYMENT_STATE_DEGRADED
            - DEPLOYMENT_STATE_FAILED
            - DEPLOYMENT_STATE_STOPPED
            - DEPLOYMENT_STATE_STOPPING
          type: string
          description: Current state of the deployment.
        name:
          readOnly: true
          type: string
          description: |-
            Inference-addressable name in the fully-qualified form
            "<project_slug>/<endpoint_name>/<deployment_name>". Pass it as the
            "model" field when calling the inference API to pin to this deployment.
        createdAt:
          readOnly: true
          type: string
          description: Timestamp when the deployment was created.
          format: date-time
        autoscaling:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/DE.AutoscalingResponse'
          description: Autoscaling configuration for the deployment.
        desiredReplicas:
          readOnly: true
          type: integer
          description: |-
            Number of replicas the autoscaler currently wants across all regions.
        readyReplicas:
          readOnly: true
          type: integer
          description: |-
            Number of replicas currently ready to serve requests across all regions.
        model:
          type: string
          description: |-
            Resource name of the served model in the form
            `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
            For public models, the model's owning project may differ from the deployment's project.
        estimatedEffectiveTrafficShare:
          readOnly: true
          type: number
          format: double
          description: Estimated fraction from 0 to 1 of endpoint traffic currently routed to this deployment.
    DE.TrafficSplitEntry:
      type: object
      description: Capacity weight assigned to one deployment in an endpoint's live traffic split.
      required:
        - deploymentId
        - weight
      properties:
        deploymentId:
          type: string
          description: ID of a deployment under the endpoint that can receive live traffic.
        weight:
          type: number
          description: |-
            Non-negative, finite weight applied to each ready replica. A deployment's
            effective routing capacity is `weight * readyReplicas`, and requests are
            distributed in proportion to that capacity. Set to `0` to remove the
            deployment from the live traffic split.
    DE.CreateEndpointRequest:
      type: object
      description: Request parameters for creating an endpoint.
      required:
        - name
      properties:
        name:
          type: string
          description: Inference-addressable endpoint name to create.
        visibility:
          default: VISIBILITY_PRIVATE
          enum:
            - VISIBILITY_PRIVATE
            - VISIBILITY_INTERNAL
          type: string
          description: Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
    DE.EndpointUpdate:
      type: object
      description: Mutable endpoint fields for update requests.
      properties:
        name:
          type: string
          description: Updated endpoint string.
        etag:
          type: string
          description: Current endpoint version. The update is rejected if this value no longer matches.
        trafficSplit:
          type: array
          description: Replacement live traffic split. Use an empty list to stop routing live traffic.
          items:
            $ref: '#/components/schemas/DE.TrafficSplitEntry'
        visibility:
          default: VISIBILITY_PRIVATE
          enum:
            - VISIBILITY_PRIVATE
            - VISIBILITY_INTERNAL
          type: string
          description: Who can discover the endpoint. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
    DE.CreateDeploymentRequest:
      type: object
      description: Configuration for creating a deployment that binds a model and immutable config to an endpoint.
      required:
        - name
        - autoscaling
      properties:
        name:
          type: string
          description: Name for the deployment within its endpoint. Returned as a fully-qualified endpoint string.
        modelId:
          type: string
          description: Deprecated. Use `model`. Model identifier to serve, accepted when `model` is unset.
        modelRevisionId:
          type: string
          description: Deprecated. Use `model` with a /revisions/{revisionId} segment. If omitted, the latest revision is resolved at creation.
        configId:
          type: string
          description: Deprecated. Use `config`. Config revision identifier to deploy, accepted when `config` is unset.
        model:
          type: string
          description: Model resource name in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omit the revision segment to pin the latest revision at creation time.
        autoscaling:
          allOf:
            - $ref: '#/components/schemas/DE.Autoscaling'
          description: Autoscaling configuration for the deployment.
        config:
          type: string
          description: Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`. The config must be compatible with the model.
        enableLora:
          type: boolean
          description: Enables dynamic loading of LoRA adapters on the deployment.
        placement:
          allOf:
            - $ref: '#/components/schemas/DE.Placement'
          description: Placement policy to use when scheduling the deployment.
    DE.UpdateDeploymentRequest:
      type: object
      description: Mutable deployment settings. Use the resource-name fields or their deprecated ID alternatives for a model or config change, but not both.
      properties:
        name:
          type: string
          description: Updated endpoint string.
        autoscaling:
          allOf:
            - $ref: '#/components/schemas/DE.Autoscaling'
          description: Updated autoscaling configuration.
        etag:
          type: string
          description: Current deployment version. The update is rejected if this value no longer matches.
    DE.CreateABExperimentRequest:
      type: object
      description: Configuration for a managed live-traffic split across deployments under one endpoint.
      required:
        - name
        - members
      properties:
        name:
          type: string
          description: Human-readable A/B experiment name, unique within the endpoint.
        description:
          type: string
          description: Optional free-form description.
        members:
          type: array
          items:
            $ref: '#/components/schemas/DE.ABExperimentMember'
          description: Two to 20 participating deployments with exactly one control. Integer traffic percentages across all members must add up to 100.
    DE.UpdateABExperimentRequest:
      type: object
      description: Mutable description and traffic allocation for an A/B experiment.
      properties:
        description:
          type: string
          description: Updated free-form description.
        members:
          type: array
          items:
            $ref: '#/components/schemas/DE.ABExperimentMember'
          description: Complete replacement member set. Requires two to 20 deployments, exactly one control, and percentages that add up to 100.
        etag:
          type: string
          description: Opaque version tag from a prior read for optimistic concurrency.
    DE.CreateRemoteUploadSpec:
      description: Request parameters for creating a remote upload.
      type: object
      required:
        - modelId
        - remoteUrl
      properties:
        modelId:
          type: string
          description: ID of the registered model that will receive the imported files.
        remoteUrl:
          type: string
          description: Hugging Face repository URL or presigned archive URL to import.
        token:
          type: string
          description: Optional source credential used to access a private remote location. The value is write-only and is not returned.
    DE.ListFilesResponse:
      type: object
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.ListFilesResponseFile'
          description: Files in the selected model revision.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
        revisionId:
          type: string
          description: ID of the model revision whose files are listed.
        revisionCreatedAt:
          type: string
          format: date-time
          description: Time when the listed model revision was created.
        totalSizeBytes:
          type: string
          description: Total size of all files in the revision, in bytes.
      description: Files and aggregate size information for one model revision.
    DE.DeleteResponse:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Empty response returned after a successful delete operation.
    DE.ListEndpointAccessResponse:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: '#/components/schemas/DE.AccessEntry'
          description: All principals currently granted access on the endpoint.
      description: Principals currently allowed to send inference requests to an endpoint.
    DE.ListInferenceInstanceTypesResponse:
      type: object
      description: Hardware instance types available for inference deployments.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.InferenceInstanceType'
          description: Instance types available for inference.
        next_cursor:
          type: string
          description: Cursor for the next page. Always null today because this catalog is returned in full.
        object:
          const: list
          description: Object type. Always `list`.
    DE.RevokeEndpointAccessResponse:
      type: object
      properties: {}
      description: Empty response returned after an endpoint access grant is revoked or confirmed absent.
    DE.ListRemoteUploadsResponse:
      type: object
      description: Remote model import jobs and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.RemoteUpload'
          description: Remote upload jobs.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ListPlacementProfilesResponse:
      type: object
      description: Reusable deployment placement profiles visible to the project.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.PlacementProfile'
          description: Placement profiles visible in the project.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.PlacementProfile:
      type: object
      required:
        - id
        - projectId
        - organizationId
        - name
        - preferredRegions
      properties:
        id:
          type: string
          description: Unique placement profile identifier.
        projectId:
          type: string
          description: Project that owns the placement profile.
        organizationId:
          type: string
          description: Organization that owns the placement profile.
        name:
          type: string
          description: Human-readable placement profile name.
        preferredRegions:
          type: array
          items:
            type: string
          description: Preferred deployment regions in descending priority order.
      description: Reusable ordered region preferences for scheduling a project's deployments.
    DE.ListRemoteUploadEventsResponse:
      type: object
      description: Status and diagnostic events for a remote model import job.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.RemoteUploadEvent'
          description: Events for the remote upload.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.RevokeEndpointAccessRequest:
      type: object
      properties:
        principalType:
          type: string
          description: Type of principal to revoke. Supported values are `project`, `api_key`, and `organization`.
        principalId:
          type: string
          description: Identifier of the principal whose access is being revoked.
      description: Principal whose permission to call the endpoint should be revoked.
      required:
        - projectId
        - id
        - principalType
        - principalId
    DE.GrantEndpointAccessRequest:
      type: object
      properties:
        principalType:
          type: string
          description: Type of principal to grant. Supported values are `project`, `api_key`, and `organization`.
        principalId:
          type: string
          description: Identifier of the principal to grant access to.
      description: Principal that should be allowed to send inference requests to the endpoint.
      required:
        - projectId
        - id
        - principalType
        - principalId
    DE.Deployment:
      description: Serving workload that binds a model and immutable config to an endpoint and manages its replicas.
      type: object
      required:
        - id
        - projectId
        - endpointId
        - name
        - createdAt
        - updatedAt
        - modelId
        - modelRevisionId
        - model
        - autoscaling
        - configId
        - config
        - etag
        - hardware
        - trafficMode
        - status
      properties:
        id:
          readOnly: true
          type: string
          description: Unique deployment identifier.
        projectId:
          readOnly: true
          type: string
          description: ID of the project that owns the deployment.
        endpointId:
          type: string
          description: ID of the endpoint that contains the deployment.
        name:
          type: string
          description: Project- and endpoint-qualified deployment name in the form `<project_slug>/<endpoint_name>/<deployment_name>`. Pass it as `model` in an inference request to target this deployment directly instead of using the endpoint's traffic split.
        createdAt:
          readOnly: true
          type: string
          description: Timestamp when the deployment was created.
          format: date-time
        updatedAt:
          readOnly: true
          type: string
          description: Timestamp when the deployment was last updated.
          format: date-time
        modelId:
          type: string
          description: Deprecated. Use `model`. Model identifier being served, populated during migration.
        modelRevisionId:
          type: string
          description: Deprecated. Use `model` with a /revisions/{revisionId} segment. Pin to a specific model revision.
        model:
          type: string
          description: Pinned model resource in the form `projects/{projectId}/models/{modelId}/revisions/{revisionId}`.
        autoscaling:
          allOf:
            - $ref: '#/components/schemas/DE.AutoscalingResponse'
          description: Replica bounds, timing windows, and metrics that control horizontal scaling.
        configId:
          type: string
          description: Deprecated. Use `config`. Config revision identifier, populated during migration.
        config:
          type: string
          description: Immutable config revision in the form `projects/{projectId}/configs/{configRevisionId}`.
        speculatorId:
          readOnly: true
          type: string
          description: Deprecated. Use `speculator`. Speculative decoding model identifier derived from the deployment config.
        speculatorRevisionId:
          readOnly: true
          type: string
          description: Deprecated. Use `speculator`. ID of the speculative decoding draft-model revision pinned at creation time.
        speculator:
          readOnly: true
          type: string
          description: Pinned draft-model resource used for speculative decoding, in the same form as `model`. Omitted when speculative decoding is disabled.
        estimatedEffectiveTrafficShare:
          readOnly: true
          type: number
          format: double
          description: Estimated fraction in [0, 1] of endpoint traffic that reaches this deployment under the current routing configuration. Absent or unrouted deployments are 0.
        enableLora:
          type: boolean
          description: Whether the deployment can dynamically load LoRA adapters.
        etag:
          type: string
          description: Opaque version tag for optimistic concurrency control. Supply on update/delete to ensure consistent read-modify-write. If not set, the write overwrites based on current state.
        hardware:
          readOnly: true
          type: string
          description: Hardware selected by the deployment config, including GPU type and count.
        trafficMode:
          readOnly: true
          enum:
            - TRAFFIC_MODE_LIVE
            - TRAFFIC_MODE_SHADOW
          type: string
          description: Whether the deployment serves client-visible responses or only mirrored shadow traffic.
        runtimeInfo:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/DE.RuntimeInfo'
          description: Serving engine and feature support derived from the immutable config.
        desiredReplicas:
          readOnly: true
          type: integer
          description: Number of replicas the autoscaler currently wants across all regions.
        status:
          readOnly: true
          allOf:
            - $ref: '#/components/schemas/DE.DeploymentStatus'
          description: Current lifecycle state and observed replica counts.
        placement:
          allOf:
            - $ref: '#/components/schemas/DE.Placement'
          description: Region constraints used to schedule the deployment's replicas.
    DE.AdapterEntry:
      type: object
      description: Adapter attached to a deployment with desired revision and observed load state.
      required:
        - adapterModelId
        - desiredRevisionId
        - perCluster
        - etag
      properties:
        adapterModelId:
          type: string
          description: Adapter model identifier attached to the deployment.
        desiredRevisionId:
          type: string
          description: Adapter revision pinned on the deployment.
        perCluster:
          type: array
          items:
            $ref: '#/components/schemas/DE.DeploymentAdapterStatus'
          description: Per-cluster adapter load state reported by the controller.
        etag:
          type: string
          description: Row-level etag required for UpdateAdapter and RemoveAdapter.
        adapterModel:
          type: string
          description: Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}.
        desiredRevision:
          type: string
          description: Resource name of the adapter model revision pinned on the deployment, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
    DE.DeploymentAdapterStatus:
      type: object
      description: Controller-reported load state for an adapter on one deployment cluster.
      required:
        - adapterModelId
        - clusterId
        - state
        - readyPodCount
        - failedPodCount
        - totalPodCount
      properties:
        adapterModelId:
          type: string
          description: Adapter model identifier for this status row.
        clusterId:
          type: string
          description: Cluster reporting this adapter status.
        realizedRevisionId:
          type: string
          description: Adapter revision currently loaded on pods in this cluster.
        realizedEtag:
          type: string
          description: Adapter row etag observed by the controller when it wrote this status.
        state:
          enum:
            - ADAPTER_LOAD_STATE_PENDING
            - ADAPTER_LOAD_STATE_LOADING
            - ADAPTER_LOAD_STATE_READY
            - ADAPTER_LOAD_STATE_REMOVING
            - ADAPTER_LOAD_STATE_FAILED
          type: string
          description: Current adapter load state in this cluster.
        reason:
          type: string
          description: Stable reason code for the current adapter state.
        message:
          type: string
          description: Human-readable details about the current adapter state.
        readyPodCount:
          type: integer
          description: Number of pods with the adapter ready to serve.
        failedPodCount:
          type: integer
          description: Number of pods that failed to load the adapter.
        totalPodCount:
          type: integer
          description: Total pods expected to report adapter load state.
        loadedAt:
          type: string
          description: Time when the adapter first reached READY in this cluster.
          format: date-time
        updatedAt:
          type: string
          description: Time when this adapter status was last updated.
          format: date-time
        adapterModel:
          type: string
          description: Resource name of the adapter model, using projects/{projectId}/models/{adapterModelId}.
        realizedRevision:
          type: string
          description: Resource name of the adapter model revision currently loaded in this cluster, using projects/{projectId}/models/{adapterModelId}/revisions/{revisionId}.
    DE.ListAdaptersResponse:
      type: object
      description: Response containing attached adapters and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.AdapterEntry'
          description: Adapters attached to the deployment.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.AddAdapterRequest:
      type: object
      description: Configuration for attaching a LoRA adapter to a deployment that has adapter loading enabled.
      required:
        - adapterModelId
      properties:
        adapterModelId:
          type: string
          description: Adapter model identifier to attach.
        adapterRevisionId:
          type: string
          description: Optional adapter revision to pin. If omitted, the latest revision is resolved at request time.
        force:
          type: boolean
          description: Whether to evict the oldest adapter if the deployment is at adapter capacity.
    DE.UpdateAdapterRequest:
      type: object
      description: Request body for updating an adapter.
      required:
        - adapterRevisionId
        - etag
      properties:
        adapterRevisionId:
          type: string
          description: New adapter revision to pin.
        etag:
          type: string
          description: Row-level etag from a prior AddAdapter, UpdateAdapter, GetAdapter, or ListAdapters response.
    DE.ListRolloutsResponse:
      type: object
      description: Response containing rollout resources and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.Rollout'
          description: Rollouts under the endpoint.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.CreateRolloutRequest:
      type: object
      description: Strategy, metric gates, timing, and cleanup policy for shifting traffic between two deployments under one endpoint.
      required:
        - sourceDeploymentId
        - targetDeploymentId
      oneOf:
        - x-stainless-variantName: Canary
          required:
            - canary
        - x-stainless-variantName: BlueGreen
          required:
            - blueGreen
        - x-stainless-variantName: Rolling
          required:
            - rolling
      properties:
        sourceDeploymentId:
          type: string
          description: Deployment that traffic shifts away from.
        targetDeploymentId:
          type: string
          description: Deployment that traffic shifts toward.
        canary:
          allOf:
            - $ref: '#/components/schemas/DE.CanaryConfig'
          description: Canary rollout strategy configuration. Mutually exclusive with blueGreen and rolling.
        blueGreen:
          allOf:
            - $ref: '#/components/schemas/DE.BlueGreenConfig'
          description: Blue-green rollout strategy configuration. Mutually exclusive with canary and rolling.
        rolling:
          allOf:
            - $ref: '#/components/schemas/DE.RollingConfig'
          description: Rolling rollout strategy configuration. Mutually exclusive with canary and blueGreen.
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/DE.MetricRule'
          description: Optional metric gates evaluated after each step's soak. Canary only; rejected on rolling and blue-green rollouts.
        finalSourceReplicas:
          type: integer
          description: Optional final replica count for the source deployment. Defaults to 0, which drains and stops the source.
        finalTargetReplicas:
          type: integer
          description: Optional target replica count at completion. Must be at least 1 when set; defaults to the source deployment's replica count at create time, or to the source and target deployments' combined replica count when both already stand in the endpoint traffic split after a cancel.
    DE.BlueGreenConfig:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Blue-green strategy configuration for a single cutover to the target deployment.
    DE.RollingConfig:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Rolling strategy configuration for capacity-preserving batches that ramp target replicas up while draining source replicas.
    DE.CanaryConfig:
      type: object
      description: Canary strategy configuration for gradual traffic progression. An empty config uses the default 5, 25, 50, 100 percent ladder; over a frozen traffic-split pair left by cancel, the default ladder is derived at start from the pair's current served share so it begins above it.
      properties:
        steps:
          type: array
          items:
            $ref: '#/components/schemas/DE.RolloutStep'
          description: Optional progression steps. Defaults to 5, 25, 50, 100 percent when empty; explicit steps must increase and end at 100 percent.
        stepInterval:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Optional positive soak between steps. Defaults to 3m if omitted, and grows to cover metric rule windows plus ingestion lag.
    DE.RolloutStep:
      type: object
      description: One stage of a canary rollout progression.
      required:
        - traffic
      properties:
        traffic:
          type: integer
          description: Required percentage of traffic on the target deployment for this step.
        replicas:
          type: integer
          description: Optional explicit target replica count for this step.
    DE.MetricRule:
      type: object
      description: Metric gate evaluated during a rollout.
      required:
        - name
        - stat
      oneOf:
        - x-stainless-variantName: Threshold
          required:
            - thresholdCheck
        - x-stainless-variantName: Regression
          required:
            - regressionCheck
      properties:
        name:
          enum:
            - inflight_requests
            - router_error_rate
            - router_latency
            - serving_latency
          type: string
        stat:
          enum:
            - METRIC_STAT_TYPE_AVG
            - METRIC_STAT_TYPE_MIN
            - METRIC_STAT_TYPE_MAX
            - METRIC_STAT_TYPE_PERCENTILE
          type: string
          description: Required aggregation used for the metric.
        percentile:
          type: integer
          description: Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE.
        thresholdCheck:
          allOf:
            - $ref: '#/components/schemas/DE.ThresholdCheck'
          description: Threshold evaluation criteria. Mutually exclusive with regressionCheck.
        regressionCheck:
          allOf:
            - $ref: '#/components/schemas/DE.RegressionCheck'
          description: Regression evaluation criteria. Mutually exclusive with thresholdCheck.
        window:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Optional query window for the metric. Defaults to the step soak duration.
    DE.ThresholdCheck:
      type: object
      description: Threshold criteria that fail when the target metric violates the configured bound.
      required:
        - value
        - operator
      properties:
        value:
          type: number
          description: Required numeric threshold value.
        operator:
          enum:
            - THRESHOLD_OPERATOR_GT
            - THRESHOLD_OPERATOR_GTE
            - THRESHOLD_OPERATOR_LT
            - THRESHOLD_OPERATOR_LTE
          type: string
          description: Required comparison operator applied to the target metric value.
    DE.RegressionCheck:
      type: object
      description: Regression criteria that fail when the target regresses against the source beyond a limit.
      required:
        - maxRegressionPercent
        - direction
      properties:
        maxRegressionPercent:
          type: number
          description: Required maximum allowed regression percentage.
        direction:
          enum:
            - REGRESSION_DIRECTION_HIGHER_IS_WORSE
            - REGRESSION_DIRECTION_LOWER_IS_WORSE
          type: string
          description: Required direction that indicates whether higher or lower metric values are worse.
    DE.PauseRolloutRequest:
      type: object
      description: Optional concurrency check and audit reason for pausing a running rollout.
      properties:
        etag:
          type: string
          description: Optional etag for optimistic concurrency.
        reason:
          type: string
          description: Optional human-readable reason recorded on the rollout pause metadata.
    DE.ResumeRolloutRequest:
      type: object
      description: Optional concurrency check for resuming a paused rollout.
      properties:
        etag:
          type: string
          description: Optional etag for optimistic concurrency.
    DE.CancelRolloutRequest:
      type: object
      description: Reason, disposition, and optional concurrency check for canceling a rollout.
      required:
        - reason
      properties:
        reason:
          type: string
          description: Required human-readable reason recorded in the rollout audit trail.
        etag:
          type: string
          description: Optional etag for optimistic concurrency.
        disposition:
          enum:
            - CANCEL_DISPOSITION_FREEZE
            - CANCEL_DISPOSITION_REVERT
          type: string
          description: Optional cancel behavior. Absent defaults to freeze, which preserves the current traffic split. Revert is removed and rejected with FAILED_PRECONDITION; cancel with freeze, then run a reverse rollout back to the source.
    DE.PromoteRolloutRequest:
      type: object
      description: Optional concurrency check for immediately completing a rollout on its target deployment.
      properties:
        etag:
          type: string
          description: Optional etag for optimistic concurrency.
    DE.RolloutDefaultsPreview:
      type: object
      description: Completed create-form state — the caller's spec with defaulted values filled in, the steps the rollout is expected to walk, and the capacity context the defaults were computed from. Display only.
      required:
        - spec
        - sourceReplicas
        - targetReplicas
        - targetMinReplicas
        - targetMaxReplicas
        - warnings
      properties:
        spec:
          allOf:
            - $ref: '#/components/schemas/DE.CreateRolloutRequest'
          description: The caller's spec with defaulted values filled in for display. canary.steps is echoed exactly as sent; the suggested ladder is returned in estimatedEffectiveSteps instead.
        estimatedEffectiveSteps:
          type: array
          items:
            $ref: '#/components/schemas/DE.RolloutStep'
          description: Steps the rollout is expected to walk when the caller leaves steps unset. Display only. Empty when the caller supplied steps or no ladder applies.
        frozenPair:
          type: boolean
          description: True when both deployments still share the endpoint traffic split left by a cancelled rollout, so the rollout resumes from the current split rather than from zero.
        estimatedSeedPercent:
          type: integer
          description: Percentage of the pair's traffic currently reaching the target, the floor the suggested steps start above. Unset when not a frozen pair or unknown; 0 is a real measurement.
        sourceReplicas:
          type: integer
          description: Source deployment replica count the defaults were computed from. Zero is a real value.
        targetReplicas:
          type: integer
          description: Target deployment replica count the defaults were computed from. Zero is a real value.
        targetMinReplicas:
          type: integer
          description: Target deployment autoscaling minimum replica count. Zero is a real value.
        targetMaxReplicas:
          type: integer
          description: Target deployment autoscaling maximum replica count. Zero is a real value.
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/DE.PreviewWarning'
          description: Non-blocking findings to surface next to the form. An empty list means the shown values are safe to submit as-is.
    DE.PreviewWarning:
      type: object
      description: A non-blocking finding attached to a rollout defaults preview.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable warning code, such as CREATE_WILL_REJECT or TARGET_ALREADY_IN_TRAFFIC_SPLIT. Render message for unrecognized codes.
        message:
          type: string
          description: Plain-language description of the finding, safe to show users as-is.
    DE.PauseInfo:
      type: object
      description: Pause metadata returned while a rollout is paused.
      required:
        - pausedAt
      properties:
        reason:
          type: string
          description: Human-readable reason recorded when the rollout was paused.
        pausedAt:
          type: string
          description: Timestamp when the rollout was paused.
          format: date-time
    DE.Rollout:
      type: object
      description: Public view of a rollout resource and its embedded runtime status.
      required:
        - id
        - endpointId
        - sourceDeploymentId
        - targetDeploymentId
        - strategy
        - state
        - createdAt
        - status
      properties:
        id:
          type: string
          description: Output only. Unique rollout identifier.
          readOnly: true
        endpointId:
          type: string
          description: Output only. Endpoint this rollout belongs to.
          readOnly: true
        sourceDeploymentId:
          type: string
          description: Output only. Deployment that traffic is shifting away from.
          readOnly: true
        targetDeploymentId:
          type: string
          description: Output only. Deployment that traffic is shifting toward.
          readOnly: true
        strategy:
          enum:
            - ROLLOUT_STRATEGY_TYPE_ROLLING
            - ROLLOUT_STRATEGY_TYPE_CANARY
            - ROLLOUT_STRATEGY_TYPE_BLUE_GREEN
          type: string
          description: Output only. Rollout strategy selected at creation.
          readOnly: true
        state:
          enum:
            - ROLLOUT_STATE_RUNNING
            - ROLLOUT_STATE_PAUSED
            - ROLLOUT_STATE_STABILIZING
            - ROLLOUT_STATE_ABORTING
            - ROLLOUT_STATE_COMPLETED
            - ROLLOUT_STATE_ABORTED
            - ROLLOUT_STATE_PENDING
            - ROLLOUT_STATE_SYSTEM_PAUSED
            - ROLLOUT_STATE_CANCELLING
            - ROLLOUT_STATE_CANCELED
            - ROLLOUT_STATE_PAUSING
          type: string
          description: Output only. High-level rollout lifecycle state.
          readOnly: true
        currentStep:
          type: integer
          description: Output only. Zero-based index of the current step. Unset while PENDING; step 0 is reported explicitly after start.
          readOnly: true
        currentTrafficPercent:
          type: integer
          description: Output only. Applied percentage of traffic on the target deployment.
          readOnly: true
        createdAt:
          type: string
          description: Output only. Timestamp when the rollout was created.
          format: date-time
          readOnly: true
        startedAt:
          type: string
          description: Output only. Timestamp when the rollout started running.
          format: date-time
          readOnly: true
        completedAt:
          type: string
          description: Output only. Timestamp when the rollout reached a terminal state.
          format: date-time
          readOnly: true
        etag:
          type: string
          description: Output only. Opaque version tag for optimistic concurrency control.
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/DE.RolloutStatus'
          description: Output only. Derived runtime progress and failure details.
          readOnly: true
        pauseInfo:
          allOf:
            - $ref: '#/components/schemas/DE.PauseInfo'
          description: Output only. Why and when the rollout was paused. Set while a pause is pending or effective (PAUSING, PAUSED, or SYSTEM_PAUSED); while PAUSING, pausedAt records when the pause was requested.
          readOnly: true
    DE.RolloutStatus:
      type: object
      description: Derived runtime progress for a rollout.
      required: [totalSteps, steps]
      properties:
        totalSteps:
          type: integer
          description: Total number of steps in the rollout progression. Always serializes when status is present.
        condition:
          allOf:
            - $ref: '#/components/schemas/DE.RolloutCondition'
          description: Failure detail set when the rollout pauses, system-pauses, or aborts.
        steps:
          type: array
          items:
            $ref: '#/components/schemas/DE.RolloutStepStatus'
          description: Per-step rollout execution summaries.
        updatedAt:
          type: string
          description: Timestamp of the most recent progress update.
          format: date-time
    DE.RolloutCondition:
      type: object
      description: Structured reason a rollout stopped progressing.
      properties:
        category:
          enum:
            - ROLLOUT_FAILURE_CATEGORY_METRIC_REGRESSION
            - ROLLOUT_FAILURE_CATEGORY_METRICS_UNAVAILABLE
            - ROLLOUT_FAILURE_CATEGORY_TARGET_NOT_READY
            - ROLLOUT_FAILURE_CATEGORY_SOURCE_NOT_DRAINED
            - ROLLOUT_FAILURE_CATEGORY_HEALTH_REGRESSION
            - ROLLOUT_FAILURE_CATEGORY_CAPACITY_EXHAUSTED
            - ROLLOUT_FAILURE_CATEGORY_ROUTING_ERROR
            - ROLLOUT_FAILURE_CATEGORY_DEPENDENCY_OUTAGE
            - ROLLOUT_FAILURE_CATEGORY_ABORTED_BY_OPERATOR
            - ROLLOUT_FAILURE_CATEGORY_INTERNAL
            - ROLLOUT_FAILURE_CATEGORY_POLICY_INFEASIBLE
            - ROLLOUT_FAILURE_CATEGORY_UNDER_SERVED
            - ROLLOUT_FAILURE_CATEGORY_ENTITLEMENT_LAPSED
          type: string
          description: Category that classifies why the rollout stopped.
        message:
          type: string
          description: Human-readable explanation for the condition.
        atStep:
          type: integer
          description: Step index where the condition arose. Step 0 serializes explicitly.
        observedAt:
          type: string
          description: Timestamp when the condition was observed.
          format: date-time
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/DE.MetricResult'
          description: Metrics observed at the failing gate, enriched with their criteria.
    DE.RolloutStepStatus:
      type: object
      description: Collapsed execution state for one rollout step.
      properties:
        stepIndex:
          type: integer
          description: Index of this step in the rollout progression. Step 0 serializes explicitly.
        targetTrafficPercent:
          type: integer
          description: Target traffic percentage configured for this step. Always serializes for recorded steps.
        state:
          enum:
            - ROLLOUT_STEP_STATE_PENDING
            - ROLLOUT_STEP_STATE_RUNNING
            - ROLLOUT_STEP_STATE_PASSED
            - ROLLOUT_STEP_STATE_FAILED
          type: string
          description: Execution state of this rollout step.
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/DE.MetricResult'
          description: Metric gate results for this step.
        startedAt:
          type: string
          description: Timestamp when this step started.
          format: date-time
        completedAt:
          type: string
          description: Timestamp when this step completed.
          format: date-time
        failureReason:
          type: string
          description: Failure reason when this step failed.
    DE.MetricResult:
      type: object
      description: Observed metric value enriched with its rollout rule and verdict.
      properties:
        name:
          type: string
          description: Metric name as exported to the observability backend.
        stat:
          enum:
            - METRIC_STAT_TYPE_AVG
            - METRIC_STAT_TYPE_MIN
            - METRIC_STAT_TYPE_MAX
            - METRIC_STAT_TYPE_PERCENTILE
          type: string
          description: Aggregation used for the metric.
        percentile:
          type: integer
          description: Percentile value, such as 99. Set only when stat is METRIC_STAT_TYPE_PERCENTILE.
        check:
          enum:
            - METRIC_CHECK_TYPE_THRESHOLD
            - METRIC_CHECK_TYPE_REGRESSION
          type: string
          description: Evaluation form used by the metric rule.
        sourceValue:
          type: number
          description: Observed source baseline. Set only for regression checks; a 0 reading serializes explicitly.
        targetValue:
          type: number
          description: Observed target value. A 0 reading serializes explicitly.
        threshold:
          type: number
          description: Threshold criteria used when check is METRIC_CHECK_TYPE_THRESHOLD.
        operator:
          enum:
            - THRESHOLD_OPERATOR_GT
            - THRESHOLD_OPERATOR_GTE
            - THRESHOLD_OPERATOR_LT
            - THRESHOLD_OPERATOR_LTE
          type: string
          description: Threshold comparison operator.
        maxRegressionPercent:
          type: number
          description: Regression percentage limit used when check is METRIC_CHECK_TYPE_REGRESSION.
        direction:
          enum:
            - REGRESSION_DIRECTION_HIGHER_IS_WORSE
            - REGRESSION_DIRECTION_LOWER_IS_WORSE
          type: string
          description: Direction that indicates whether higher or lower values are worse.
        verdict:
          enum:
            - METRIC_VERDICT_PASS
            - METRIC_VERDICT_BREACHED
            - METRIC_VERDICT_UNAVAILABLE
          type: string
          description: Result of evaluating this metric at the gate.
    DE.ABExperiment:
      type: object
      required:
        - name
        - members
        - id
        - projectId
        - endpointId
        - createdAt
        - createdBy
        - updatedAt
        - etag
      properties:
        id:
          type: string
          description: Output only. Unique A/B experiment identifier.
        projectId:
          type: string
          description: Output only. Project that owns the parent endpoint.
        endpointId:
          type: string
          description: Output only. Endpoint this A/B experiment belongs to.
        name:
          type: string
          description: Human-readable A/B experiment name, unique within the endpoint.
        description:
          type: string
          description: Optional free-form description.
        members:
          type: array
          items:
            $ref: '#/components/schemas/DE.ABExperimentMember'
          description: Two to 20 participating deployments with exactly one control and percentages that add up to 100.
        createdBy:
          type: string
          description: Output only. Identifier of the principal that created the A/B experiment.
        createdAt:
          type: string
          description: Output only. Timestamp when the A/B experiment was created.
          format: date-time
        updatedAt:
          type: string
          description: Output only. Timestamp when the A/B experiment was last updated.
          format: date-time
        etag:
          type: string
          description: Optional opaque version tag for optimistic concurrency control.
      description: Managed cohort split that subdivides a control deployment's live traffic among the control and one or more variants.
    DE.ABExperimentMember:
      type: object
      properties:
        deploymentId:
          type: string
          description: Deployment under the parent endpoint.
        role:
          enum:
            - AB_EXPERIMENT_MEMBER_ROLE_CONTROL
            - AB_EXPERIMENT_MEMBER_ROLE_VARIANT
          type: string
          description: Role of this deployment within the A/B experiment.
        percent:
          type: integer
          description: Integer traffic percent in [1, 100]. Percentages across all members must sum to 100.
      description: Deployment participating in an A/B experiment.
      required:
        - deploymentId
        - role
        - percent
    DE.Placement:
      description: Placement controls where a deployment is scheduled.
      oneOf:
        - type: object
          x-stainless-variantName: Inline
          required:
            - inline
          properties:
            inline:
              description: Inline placement parameters evaluated at deploy time.
              allOf:
                - $ref: '#/components/schemas/DE.InlinePlacement'
        - type: object
          x-stainless-variantName: Profile
          required:
            - profile
          properties:
            profile:
              type: string
              description: UID of a saved placement profile.
    DE.InlinePlacement:
      type: object
      properties:
        regions:
          type: array
          items:
            type: string
          description: Regions where the deployment is allowed to run. Multiple regions allow best-effort replica spreading.
        constraint:
          enum:
            - ENFORCEMENT_REQUIRED
            - ENFORCEMENT_PREFERRED
          type: string
          description: How strictly the regions list is enforced.
      description: Inline placement parameters expanded into scheduling rules by the server.
    DE.ListModelsResponse:
      type: object
      description: Custom model resources and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.Model'
          description: The list of models.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ListSupportedModelsResponse:
      type: object
      description: Response containing supported models and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.SupportedModel'
          description: Supported models in the catalog.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.SupportedModelDeploymentProfile:
      type: object
      description: Certified deployment profile for a supported model.
      required:
        - profileId
        - certifiedConfigRevisionId
        - certifiedModelRevisionId
        - gpuType
        - gpuCount
        - quantization
        - performanceBenchmarks
        - config
        - model
        - parallelism
        - modelName
      properties:
        profileId:
          type: string
          description: Stable profile identifier, usually the certified config id.
        certifiedConfigRevisionId:
          type: string
          description: Certified configuration revision identifier.
        certifiedModelRevisionId:
          type: string
          description: Certified model weight revision identifier, if available.
        gpuType:
          type: string
          description: GPU instance type for the profile.
        gpuCount:
          type: integer
          description: Number of GPUs required by the profile.
        quantization:
          type: string
          description: Quantization method for the profile, if available.
        tensorParallelSize:
          type: integer
          description: Deprecated. Use `parallelism`. Legacy tensor-parallel shard count for the profile.
          deprecated: true
        performanceBenchmarks:
          $ref: '#/components/schemas/DE.SupportedModelPerformanceBenchmarks'
          description: Performance benchmarks for the profile, if available.
        config:
          type: string
          description: Certified config revision in the form `projects/{projectId}/configs/{configRevisionId}`. Omitted when the profile does not pin a config.
        model:
          type: string
          description: Deployable model resource in the form `projects/{projectId}/models/{modelId}[/revisions/{revisionId}]`. Omitted when the profile does not pin model weights.
        parallelism:
          type: string
          description: Free-form parallelism spec for the profile, such as TP8, TP4, EP, or PD; supersedes tensor_parallel_size.
        modelName:
          type: string
          description: Fully-qualified deploy model name in the form `{projectSlug}/{modelName}`, such as `Qwen/Qwen3.5-9B-FP8`; empty when no public model is linked.
    DE.SupportedModelPerformanceBenchmarks:
      type: object
      description: Performance benchmark metrics for a supported model profile.
      properties:
        decodingSpeedTps:
          type: number
          format: double
          description: Decoding throughput in tokens per second.
        timeToFirstTokenMs:
          type: integer
          description: Time to first token in milliseconds.
        maxContextLength:
          type: string
          description: Maximum context length supported by the profile.
    DE.SupportedModel:
      type: object
      description: Curated catalog entry for a platform-supported model.
      required:
        - id
        - name
        - displayName
        - inputModalities
        - outputModalities
        - products
        - capabilities
        - publisher
        - status
        - displayType
        - baseModelId
        - baseModel
        - deploymentProfiles
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: Unique ID of the deployable Together-hosted base model.
        name:
          type: string
          description: Catalog-controlled HF model ID used for inference.
        displayName:
          type: string
          description: Catalog-controlled human-readable model name.
        description:
          type: string
          description: Human-readable model description.
        inputModalities:
          type: array
          items:
            enum:
              - MODALITY_TEXT
              - MODALITY_IMAGE
              - MODALITY_AUDIO
              - MODALITY_VIDEO
            type: string
          description: Input modalities supported by the model.
        outputModalities:
          type: array
          items:
            enum:
              - MODALITY_TEXT
              - MODALITY_IMAGE
              - MODALITY_AUDIO
              - MODALITY_VIDEO
            type: string
          description: Output modalities produced by the model.
        products:
          type: array
          items:
            enum:
              - PRODUCT_SERVERLESS
              - PRODUCT_DEDICATED
              - PRODUCT_FINE_TUNING
              - PRODUCT_RESERVED
            type: string
          description: Product surfaces where the model is offered.
        features:
          type: array
          items:
            enum:
              - FEATURE_TOOL_CALLING
              - FEATURE_STRUCTURED_OUTPUT
              - FEATURE_REASONING
            type: string
          description: Advanced features exposed by the model.
        capabilities:
          type: array
          items:
            enum:
              - CAPABILITY_CHAT
              - CAPABILITY_EMBEDDING
              - CAPABILITY_RERANKING
              - CAPABILITY_IMAGE_GENERATION
              - CAPABILITY_VIDEO_GENERATION
            type: string
          description: High-level tasks the model supports.
        architecture:
          type: string
          description: Model architecture from the underlying weights metadata.
        contextLength:
          type: string
          description: Maximum context length from the underlying weights metadata.
        publisher:
          type: string
          description: Organization or publisher associated with the model.
        status:
          enum:
            - SUPPORTED_MODEL_STATUS_RECOMMENDED
            - SUPPORTED_MODEL_STATUS_SUPPORTED
            - SUPPORTED_MODEL_STATUS_DEPRECATED
            - SUPPORTED_MODEL_STATUS_HIDDEN
          type: string
          description: Catalog recommendation status for the model.
        tags:
          type: array
          items:
            type: string
          description: Searchable catalog tags for the model.
        inputFormat:
          type: string
          description: Preferred input format for the model.
        outputFormat:
          type: string
          description: Preferred output format for the model.
        serverlessEndpoint:
          type: string
          description: Serverless endpoint name for inference, if available.
        familyId:
          type: string
          description: Model family identifier for related catalog entries.
        displayType:
          type: string
          description: UI-facing model type badge, such as chat, language, code, image, embedding, rerank, moderation, audio, video, or transcribe.
        baseModelId:
          type: string
          description: Bare model ID for the architecture's base model; empty when no base model is linked.
        baseModel:
          type: string
          description: Resource name for the base model as `projects/{projectId}/models/{modelId}`; empty when unresolved.
        deploymentProfiles:
          type: array
          items:
            $ref: '#/components/schemas/DE.SupportedModelDeploymentProfile'
          description: Certified deployment profiles available for the model.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the catalog entry was created.
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the catalog entry was last updated.
    DE.ListEndpointEventsResponse:
      type: object
      description: Endpoint and deployment lifecycle events, ordered newest first.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.EndpointEvent'
          description: Events for the endpoint, newest first.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ListRevisionsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.ListRevisionsResponseRevision'
          description: Immutable revisions available for the model.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
      description: Immutable model revisions and pagination metadata.
    DE.ListProjectConfigsResponse:
      type: object
      description: Model-compatible config revisions and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.ModelConfig'
          description: The list of model configs.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ListDeploymentsResponse:
      type: object
      description: Deployments under an endpoint and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.Deployment'
          description: The list of deployments.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ListABExperimentsResponse:
      type: object
      description: Managed A/B traffic experiments under an endpoint.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.ABExperiment'
          description: A/B experiments under the endpoint.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.CreateShadowExperimentRequest:
      type: object
      description: Sampling strategy and optional initial targets for mirroring endpoint requests without affecting client responses.
      required:
        - name
        - source
      properties:
        name:
          type: string
          description: Human-readable shadow experiment name, unique within the endpoint. At most 256 characters.
        source:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentSource'
          description: Endpoint source and sampling configuration for the experiment.
        targets:
          type: array
          items:
            $ref: '#/components/schemas/DE.CreateShadowExperimentTargetRequest'
          description: Optional initial target deployments. At most 100 targets; manage later changes through the target APIs.
    DE.UpdateShadowExperimentRequest:
      type: object
      description: Mutable description and source sampling strategy for a shadow experiment.
      properties:
        description:
          type: string
          description: Updated free-form description.
        source:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentSource'
          description: Updated endpoint sampling configuration. Source updates require etag in the request body.
        etag:
          type: string
          description: Opaque version tag from a prior read for optimistic concurrency.
    DE.CreateShadowExperimentTargetRequest:
      type: object
      description: Deployment under the parent endpoint that should receive mirrored requests from a shadow experiment.
      required:
        - name
        - targetDeploymentId
      properties:
        name:
          type: string
          description: Human-readable target name, unique within the shadow experiment. At most 256 characters.
        targetDeploymentId:
          type: string
          description: Deployment under the parent endpoint that receives mirrored traffic. It must not be a live traffic-split member or the source or target of an active rollout; traffic-split weight 0 warm-up targets are allowed.
        description:
          type: string
          description: Optional free-form target description.
    DE.UpdateShadowExperimentTargetRequest:
      type: object
      description: Mutable name, deployment, and description for a shadow experiment target.
      properties:
        name:
          type: string
          description: Updated human-readable target name.
        targetDeploymentId:
          type: string
          description: Replacement deployment under the parent endpoint. It must not be a live traffic-split member or the source or target of an active rollout; traffic-split weight 0 warm-up targets are allowed.
        description:
          type: string
          description: Updated free-form target description.
        etag:
          type: string
          description: Opaque version tag from a prior read for optimistic concurrency.
    DE.ListShadowExperimentsResponse:
      type: object
      description: Response containing shadow experiments and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.ShadowExperiment'
          description: Shadow experiments under the endpoint.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ListShadowExperimentTargetsResponse:
      type: object
      description: Response containing shadow experiment targets and pagination metadata.
      required:
        - data
        - object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/DE.ShadowExperimentTarget'
          description: Target deployments under the shadow experiment.
        next_cursor:
          type: string
          description: Cursor for the next page. Null if there are no more results.
        object:
          const: list
          description: Object type. Always `list`.
    DE.ShadowExperiment:
      type: object
      description: Experiment that mirrors sampled endpoint requests to target deployments without changing client responses.
      required:
        - id
        - projectId
        - endpointId
        - name
        - source
        - targets
        - createdAt
        - createdBy
        - updatedAt
        - etag
        - state
      properties:
        id:
          type: string
          description: Output only. Unique shadow experiment identifier.
          readOnly: true
        projectId:
          type: string
          description: Output only. Project that owns the parent endpoint.
          readOnly: true
        endpointId:
          type: string
          description: Output only. Endpoint whose traffic this experiment samples.
          readOnly: true
        name:
          type: string
          description: Human-readable shadow experiment name, unique within the endpoint. At most 256 characters.
        description:
          type: string
          description: User defined description.
        source:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentSourceResponse'
          description: Endpoint source and sampling configuration for mirrored requests.
        targets:
          type: array
          items:
            $ref: '#/components/schemas/DE.ShadowExperimentTarget'
          description: Target deployments that receive mirrored traffic.
        createdBy:
          type: string
          description: Identifier of the principal that created the experiment.
          readOnly: true
        createdAt:
          type: string
          description: Timestamp when the experiment was created.
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          description: Timestamp when the experiment was last updated.
          format: date-time
          readOnly: true
        etag:
          type: string
          description: Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write.
        state:
          type: string
          enum:
            - SHADOW_EXPERIMENT_STATE_ACTIVE
            - SHADOW_EXPERIMENT_STATE_INACTIVE
          description: Derived serving state, active when the experiment has at least one target.
          readOnly: true
    DE.ShadowExperimentTarget:
      type: object
      description: Deployment that receives mirrored traffic for a shadow experiment.
      required:
        - id
        - experimentId
        - name
        - targetDeploymentId
        - createdAt
        - updatedAt
        - etag
      properties:
        id:
          type: string
          description: Output only. Unique shadow experiment target identifier.
          readOnly: true
        experimentId:
          type: string
          description: Output only. Shadow experiment this target belongs to.
          readOnly: true
        name:
          type: string
          description: Human-readable target name, unique within the shadow experiment. At most 256 characters.
        targetDeploymentId:
          type: string
          description: Deployment under the parent endpoint that receives mirrored traffic. It must not be a live traffic-split member or the source or target of an active rollout; traffic-split weight 0 warm-up targets are allowed.
        description:
          type: string
          description: Optional free-form target description.
        createdAt:
          type: string
          description: Output only. Timestamp when the target was created.
          format: date-time
          readOnly: true
        updatedAt:
          type: string
          description: Output only. Timestamp when the target was last updated.
          format: date-time
          readOnly: true
        etag:
          type: string
          description: Opaque version tag for optimistic concurrency control. Returned on read; set it on update or delete requests for consistent read-modify-write.
    DE.ShadowExperimentSource:
      type: object
      description: Traffic source for a shadow experiment. The public API supports endpoint sources only.
      required:
        - endpoint
      properties:
        endpoint:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentEndpointSource'
          description: Endpoint-level source that samples traffic at the API gateway.
    DE.ShadowExperimentEndpointSource:
      type: object
      description: Endpoint-level source that samples endpoint traffic at the API gateway.
      required:
        - sampling
      properties:
        sampling:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentSampling'
          description: Sampling strategy applied to endpoint traffic.
    DE.ShadowExperimentSourceResponse:
      type: object
      description: Endpoint traffic source returned for a shadow experiment.
      required:
        - endpoint
      properties:
        endpoint:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentEndpointSourceResponse'
          description: Endpoint-level source that samples traffic at the API gateway.
    DE.ShadowExperimentEndpointSourceResponse:
      type: object
      description: Endpoint-level source returned for a shadow experiment.
      required:
        - sampling
      properties:
        sampling:
          allOf:
            - $ref: '#/components/schemas/DE.ShadowExperimentSamplingResponse'
          description: Resolved sampling strategy applied to endpoint traffic.
    DE.ShadowExperimentSamplingResponse:
      description: Sampling strategy returned for endpoint-level shadow traffic.
      oneOf:
        - type: object
          x-stainless-variantName: Uniform
          required:
            - uniform
          properties:
            uniform:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentUniformSamplingResponse'
              description: Fixed random request sampling.
        - type: object
          x-stainless-variantName: KeyBased
          required:
            - keyBased
          properties:
            keyBased:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentKeyBasedSamplingResponse'
              description: Fixed sampling by a sticky request key.
        - type: object
          x-stainless-variantName: AdaptiveUniform
          required:
            - adaptiveUniform
          properties:
            adaptiveUniform:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveUniformSamplingResponse'
              description: Adaptive random sampling toward a target QPS.
        - type: object
          x-stainless-variantName: AdaptiveKeyBased
          required:
            - adaptiveKeyBased
          properties:
            adaptiveKeyBased:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveKeyBasedSamplingResponse'
              description: Adaptive sticky-key sampling toward a target QPS.
    DE.ShadowExperimentUniformSamplingResponse:
      type: object
      description: Fixed-rate random sampling returned by the API. A zero rate may be omitted by JSON serialization.
      properties:
        rate:
          type: number
          description: Fraction of requests sampled, from 0.0 to 1.0.
    DE.ShadowExperimentKeyBasedSamplingResponse:
      type: object
      description: Fixed-rate sticky-key sampling returned by the API. A zero rate may be omitted by JSON serialization.
      required:
        - key
      properties:
        rate:
          type: number
          description: Fraction of distinct key values sampled, from 0.0 to 1.0.
        key:
          type: string
          description: Request-body field used as the sticky sampling key.
    DE.ShadowExperimentAdaptiveUniformSamplingResponse:
      type: object
      description: Adaptive random sampling returned by the API.
      required:
        - targetQps
      properties:
        targetQps:
          type: number
          description: Per-gateway-replica target QPS.
        window:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Sliding window for QPS observation when explicitly configured.
    DE.ShadowExperimentAdaptiveKeyBasedSamplingResponse:
      type: object
      description: Adaptive sticky-key sampling returned by the API.
      required:
        - targetQps
        - key
      properties:
        targetQps:
          type: number
          description: Per-gateway-replica target QPS.
        key:
          type: string
          description: Request-body field used as the sticky sampling key.
        window:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Sliding window for QPS observation when explicitly configured.
    DE.ShadowExperimentSampling:
      description: Sampling strategy for endpoint-level shadow traffic. Exactly one strategy must be set.
      oneOf:
        - type: object
          x-stainless-variantName: Uniform
          required:
            - uniform
          properties:
            uniform:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentUniformSampling'
              description: Fixed random request sampling.
        - type: object
          x-stainless-variantName: KeyBased
          required:
            - keyBased
          properties:
            keyBased:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentKeyBasedSampling'
              description: Fixed sampling by a sticky request key.
        - type: object
          x-stainless-variantName: AdaptiveUniform
          required:
            - adaptiveUniform
          properties:
            adaptiveUniform:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveUniformSampling'
              description: Adaptive random sampling toward a target QPS.
        - type: object
          x-stainless-variantName: AdaptiveKeyBased
          required:
            - adaptiveKeyBased
          properties:
            adaptiveKeyBased:
              allOf:
                - $ref: '#/components/schemas/DE.ShadowExperimentAdaptiveKeyBasedSampling'
              description: Adaptive sticky-key sampling toward a target QPS.
    DE.ShadowExperimentUniformSampling:
      type: object
      description: Fixed-rate random sampling of endpoint requests.
      required:
        - rate
      properties:
        rate:
          type: number
          description: Required fraction of requests to sample, from 0.0 to 1.0.
    DE.ShadowExperimentKeyBasedSampling:
      type: object
      description: Fixed-rate sampling of distinct key values with sticky decisions.
      required:
        - rate
        - key
      properties:
        rate:
          type: number
          description: Required fraction of distinct key values to sample, from 0.0 to 1.0.
        key:
          type: string
          description: Required request-body field used as the sticky sampling key.
    DE.ShadowExperimentAdaptiveUniformSampling:
      type: object
      description: Adaptive random sampling that throttles toward a target QPS.
      required:
        - targetQps
      properties:
        targetQps:
          type: number
          description: Required per-gateway-replica target QPS for adaptive sampling.
        window:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Optional sliding window for QPS observation. Defaults to 60s and must not be negative.
    DE.ShadowExperimentAdaptiveKeyBasedSampling:
      type: object
      description: Adaptive sticky-key sampling that throttles toward a target QPS.
      required:
        - targetQps
        - key
      properties:
        targetQps:
          type: number
          description: Required per-gateway-replica target QPS for adaptive sampling.
        key:
          type: string
          description: Required request-body field used as the sticky sampling key.
        window:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Optional sliding window for QPS observation. Defaults to 60s and must not be negative.
    DE.UpdateModelRequest:
      type: object
      description: Mutable metadata for a custom model resource.
      properties:
        name:
          type: string
          description: Updated inference-addressable model name.
        description:
          type: string
          description: Updated user-facing model description.
        visibility:
          default: VISIBILITY_PRIVATE
          enum:
            - VISIBILITY_PRIVATE
            - VISIBILITY_INTERNAL
          type: string
          description: Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
    DE.CreateModelRequest:
      type: object
      description: Request for registering a custom model or adapter in a project.
      required: [name, type, baseModelId]
      properties:
        name:
          type: string
          description: Name for the custom model. May be bare or qualified as `<project_slug>/<model_name>`; a supplied project slug must match the project in the request path.
        type:
          type: string
          description: Volume type to create. Use `model` or `adapter`; plural `models` and `adapters` are also accepted.
        description:
          type: string
          description: Human-readable description of the model and its intended use.
        baseModelId:
          type: string
          description: ID of the supported base model from which this model was derived.
    DE.AccessEntry:
      type: object
      properties:
        principalType:
          type: string
          description: Principal type. Supported values are `project`, `api_key`, and `organization`.
        principalId:
          type: string
          description: Identifier of the principal.
      description: Project, API key, or organization allowed to call an endpoint.
      required:
        - principalType
        - principalId
    DE.ListFilesResponseFile:
      type: object
      properties:
        path:
          type: string
          description: File path within the model revision.
        hash:
          type: string
          description: Content hash for integrity verification and upload deduplication.
        sizeBytes:
          type: string
          description: File size in bytes.
      description: Metadata for one file in a model revision.
    DE.InferenceInstanceType:
      type: object
      required:
        - id
        - name
        - description
        - gpuType
        - gpuCount
        - gpuMemoryGib
        - priceCentsPerHour
        - regions
      properties:
        id:
          type: string
          description: Stable hardware instance type identifier used by deployment configs.
        name:
          type: string
          description: Human-readable instance type name.
        description:
          type: string
          description: Human-readable summary of the hardware configuration.
        gpuType:
          type: string
          description: GPU accelerator model, such as `H100` or `B200`.
        gpuCount:
          type: integer
          description: Number of GPUs in one replica of this instance type.
        gpuMemoryGib:
          type: integer
          description: Memory available on each GPU, in GiB.
        priceCentsPerHour:
          type: integer
          description: On-demand price for one running replica, in US cents per hour.
        regions:
          type: array
          items:
            $ref: '#/components/schemas/DE.Region'
          description: Regions where this instance type is offered.
      description: GPU hardware configuration on which one inference replica can run.
    DE.Region:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Region name where an instance type is offered.
        headroom:
          allOf:
            - $ref: '#/components/schemas/DE.Headroom'
          description: Best-effort replica headroom for this region. Omitted when unavailable.
      description: Region where an instance type is offered.
    DE.Headroom:
      type: object
      required:
        - relation
      properties:
        value:
          type: integer
          description: Capped count of replicas that currently fit.
        relation:
          enum:
            - RELATION_EQ
            - RELATION_GTE
          type: string
          description: Whether the value is exact or a lower bound.
      description: Best-effort estimate of how many additional replicas currently fit in a region.
    DE.AnalyticsData:
      type: object
      properties:
        endpointId:
          type: string
          description: ID of the endpoint summarized by these analytics.
        timeRange:
          $ref: '#/components/schemas/DE.MetricsTimeRange'
          description: Closed-open time range covered by the analytics.
        metrics:
          allOf:
            - $ref: '#/components/schemas/DE.EndpointMetrics'
          description: Aggregated metrics over the time range.
        timeSeries:
          type: array
          items:
            $ref: '#/components/schemas/DE.TimeSeriesDataPoint'
          description: Per-bucket metric samples, included only when `includeTimeSeries` is true.
        deploymentAnalytics:
          type: array
          items:
            $ref: '#/components/schemas/DE.DeploymentAnalyticsData'
          description: Per-deployment analytics.
      description: Endpoint-wide usage and performance analytics with optional time-series and per-deployment breakdowns.
    DE.RemoteUpload:
      type: object
      required: [id, projectId, modelId, remoteUrl, status, createdAt]
      properties:
        id:
          type: string
          description: Unique ID of the remote model import job.
        projectId:
          type: string
          description: ID of the project that owns the import job.
        modelId:
          type: string
          description: ID of the registered model receiving the imported files.
        remoteUrl:
          type: string
          description: Hugging Face repository or presigned URL being imported.
        status:
          enum:
            - REMOTE_UPLOAD_STATUS_PENDING
            - REMOTE_UPLOAD_STATUS_RUNNING
            - REMOTE_UPLOAD_STATUS_ERROR
            - REMOTE_UPLOAD_STATUS_SUCCEEDED
            - REMOTE_UPLOAD_STATUS_FAILED
          type: string
          description: Current lifecycle state of the asynchronous import job.
        statusMessage:
          type: string
          description: Human-readable progress or failure detail for the current status.
        restartCount:
          type: integer
          description: Number of times the import worker has restarted this job.
        maxRestarts:
          type: integer
          description: Maximum worker restarts allowed before the job fails permanently.
        createdAt:
          type: string
          format: date-time
          description: Time when the import job was created.
        updatedAt:
          type: string
          format: date-time
          description: Time when the import job was last updated.
      description: Asynchronous job that imports remote files into a registered model and creates a model revision.
    DE.ModelConfig:
      type: object
      required:
        - id
        - certifications
        - referenceModelId
        - selectors
        - projectId
        - referenceModel
      properties:
        id:
          type: string
          description: Config revision identifier.
        certifications:
          type: array
          items:
            $ref: '#/components/schemas/DE.Certification'
          description: Model, hardware, and runtime combinations certified for this config revision.
        referenceModelId:
          type: string
          description: Deprecated. Use `referenceModel`. Reference model identifier.
        selectors:
          type: array
          items:
            $ref: '#/components/schemas/DE.Selector'
          description: Hardware and runtime selectors used to place and configure replicas.
        projectId:
          type: string
          description: ID of the project that owns the config revision. Public configs may be owned by a different project than the deployment.
        referenceModel:
          type: string
          description: Resource name of the referenced model, using `projects/{modelProject}/models/{modelId}`.
        draftModel:
          type: string
          description: Resource name of the draft model, using `projects/{draftProject}/models/{modelId}`; empty when speculative decoding is not enabled.
      description: Immutable, user-facing configuration revision that defines how a compatible model runs, including engine and hardware selectors.
    DE.Model:
      description: Custom or derived model registered in a project and backed by versioned weight files.
      type: object
      required: [id, projectId, organizationId, name, weights, visibility]
      properties:
        id:
          type: string
          description: Unique model identifier.
        projectId:
          type: string
          description: ID of the project that owns the model.
        organizationId:
          type: string
          description: ID of the organization that owns the model's project.
        name:
          type: string
          description: Project-qualified model name in the form `<project_slug>/<model_name>`. Create and update requests may use the bare or qualified form.
        description:
          type: string
          description: Human-readable description of the model and its intended use.
        weights:
          $ref: '#/components/schemas/DE.ModelWeights'
          description: Architecture, size, precision, and speculative-decoding metadata derived from the model files.
        baseModelId:
          type: string
          description: ID of the supported or custom base model from which this model was derived.
        baseModel:
          type: string
          readOnly: true
          description: Resource name of the base model, using `projects/{baseProject}/models/{baseModelId}`; empty when the model has no base.
        visibility:
          default: VISIBILITY_PRIVATE
          enum:
            - VISIBILITY_PRIVATE
            - VISIBILITY_INTERNAL
          type: string
          description: Who can discover the model. `VISIBILITY_PRIVATE` restricts it to the project; `VISIBILITY_INTERNAL` shares it with the organization.
    DE.RemoteUploadEvent:
      type: object
      required:
        - id
        - createdAt
        - level
        - type
        - message
      properties:
        id:
          type: string
          description: Unique event identifier.
        createdAt:
          type: string
          format: date-time
          description: Time when the event was recorded.
        level:
          enum:
            - LEVEL_DEBUG
            - LEVEL_INFO
            - LEVEL_WARN
            - LEVEL_ERROR
          type: string
          description: Severity of the event.
        type:
          type: string
          description: Stable event type emitted by the importer, such as `download.started`.
        message:
          type: string
          description: Human-readable progress or diagnostic message.
      description: Progress or diagnostic event emitted while importing remote model files.
    DE.Autoscaling:
      type: object
      properties:
        minReplicas:
          type: integer
          description: Minimum number of replicas. Omit on update to preserve the current value. Set both `minReplicas` and `maxReplicas` to `0` to stop the deployment.
        maxReplicas:
          type: integer
          description: Maximum number of replicas. Defaults to `minReplicas`; omitting it on update preserves the current value.
        scaleDownWindow:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Time a lower replica recommendation must remain stable before scaling down. Defaults to `5m`.
        scaleUpWindow:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Stabilization window before scaling up.
        scaleToZeroWindow:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Idle period after which the deployment automatically stops and releases its replicas.
        scalingMetrics:
          type: array
          items:
            $ref: '#/components/schemas/DE.ScalingMetric'
          description: Metrics and targets that drive replica recommendations. When omitted, the platform uses concurrent in-flight requests per replica.
      description: Autoscaling configuration for a deployment.
    DE.AutoscalingResponse:
      description: Resolved autoscaling configuration returned for a deployment.
      allOf:
        - $ref: '#/components/schemas/DE.Autoscaling'
        - type: object
          required:
            - minReplicas
            - maxReplicas
    DE.DeploymentStatus:
      type: object
      required:
        - state
        - message
      properties:
        state:
          enum:
            - DEPLOYMENT_STATE_PROVISIONING
            - DEPLOYMENT_STATE_READY
            - DEPLOYMENT_STATE_SCALING
            - DEPLOYMENT_STATE_DEGRADED
            - DEPLOYMENT_STATE_FAILED
            - DEPLOYMENT_STATE_STOPPED
            - DEPLOYMENT_STATE_STOPPING
          type: string
          description: High-level lifecycle state.
        readyReplicas:
          type: integer
          description: Total replicas actively serving traffic across all clusters.
        message:
          type: string
          description: Human-readable explanation of the current state.
        scheduledReplicas:
          type: integer
          description: Replicas the scheduler has placed on clusters.
      description: Current status of a deployment, derived at read time from internal state.
    DE.RuntimeInfo:
      type: object
      properties:
        engineType:
          type: string
          description: Serving engine, such as `vllm`, `trtllm`, or `sglang`.
        engineVersion:
          type: string
          description: Version of the serving engine.
        functionCallingSupported:
          type: boolean
          description: Whether the runtime accepts tool and function-calling requests.
        structuredOutputSupported:
          type: boolean
          description: Whether the runtime can constrain generation to a structured output schema.
      description: Runtime information derived from the deployment's configuration.
    DE.EndpointEvent:
      type: object
      required:
        - id
        - createdAt
        - level
        - type
        - source
        - sourceKind
        - endpointId
      properties:
        id:
          type: string
          description: Output only. Unique event identifier.
        createdAt:
          type: string
          description: Output only. Event creation time.
          format: date-time
        level:
          enum:
            - LEVEL_DEBUG
            - LEVEL_INFO
            - LEVEL_WARN
            - LEVEL_ERROR
          type: string
          description: Output only. Severity level.
        type:
          type: string
          description: Output only. Stable event type, such as `endpoint.updated`, `deployment.created`, `deployment.scaled`, `condition.set`, or `pod.log`.
        message:
          type: string
          description: Output only. Human-readable description of the event. Short and stable; not structured data.
        source:
          type: string
          description: Output only. Service, cluster, or controller that emitted the event.
        sourceKind:
          enum:
            - SOURCE_KIND_ENDPOINT
            - SOURCE_KIND_DEPLOYMENT
          type: string
          description: Output only. Whether this row describes the endpoint or one of its deployments.
        endpointId:
          type: string
          description: Output only. The endpoint this event belongs to. Always set.
        deploymentId:
          type: string
          description: Output only. Deployment associated with the event when `sourceKind` is `SOURCE_KIND_DEPLOYMENT`.
        subjectId:
          type: string
          description: Output only. ID of the event's subject, such as a rollout, shadow target, or condition type.
        name:
          type: string
          description: 'Resource name at the time of the event. Populated by: deployment.created, deployment.deleted, endpoint.created, endpoint.deleted'
        paths:
          type: array
          items:
            type: string
          description: 'Field-mask paths that were modified. Populated by: deployment.updated, endpoint.updated'
        oldReplicas:
          type: integer
          description: 'Replica-count transition. Populated by: deployment.scaled'
        newReplicas:
          type: integer
          description: New replica count for a `deployment.scaled` event.
        version:
          type: integer
          description: 'Target version. Populated by `target.created`; the target ID is carried in `subjectId`.'
        status:
          type: string
          description: 'Condition status for `condition.set` and `cluster_condition.set`: `True`, `False`, or `Unknown`. The condition type is carried in `subjectId`.'
        reason:
          type: string
          description: Stable condition reason, such as `AllReplicasReady`, `ReplicasProgressing`, or `ApplySuccessful`.
        clusterId:
          type: string
          description: ID of the cluster associated with a cluster-scoped event.
        serviceType:
          type: string
          description: Deployment subservice associated with the event, such as `model-deployment` or `speculator-deployment`.
        replicaId:
          type: string
          description: Opaque replica identity associated with a `pod.*` event, stable for grouping events from the same replica.
        containerName:
          type: string
          description: Stable public component label associated with a replica event, such as `engine`, `model-download`, or `sidecar`.
        logExcerpt:
          type: string
          description: Short diagnostic log excerpt captured with a pod event, for example during a crash, out-of-memory termination, or image pull failure. This field is truncated and is not a streaming log API.
        nodeId:
          type: string
          description: Opaque node handle for correlating replica failures on the same node. Omitted when the replica is unscheduled or the node is unknown.
      description: One endpoint- or deployment-scoped entry in an endpoint's combined audit and lifecycle feed.
    DE.ListRevisionsResponseRevision:
      type: object
      required:
        - revisionId
        - createdAt
      properties:
        revisionId:
          type: string
          description: Revision identifier.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the revision was created.
        validationStatus:
          enum:
            - REVISION_VALIDATION_STATUS_PENDING
            - REVISION_VALIDATION_STATUS_SUCCESS
            - REVISION_VALIDATION_STATUS_FAILED
            - REVISION_VALIDATION_STATUS_ERROR
          type: string
          description: Current validation status for the revision.
        lastValidatedAt:
          type: string
          format: date-time
          description: Timestamp when validation most recently ran for the revision.
        validationErrors:
          type: array
          items:
            $ref: '#/components/schemas/DE.RevisionValidationError'
          description: Validation errors reported for the revision.
      description: Revision metadata for a volume object.
    DE.RevisionValidationError:
      type: object
      properties:
        rule:
          type: string
          description: Validation rule that produced the error.
        severity:
          type: string
          description: Severity level reported by the validation rule.
        message:
          type: string
          description: Human-readable validation error message.
      description: One validation error reported for a model revision.
    DE.DeploymentAnalyticsData:
      type: object
      properties:
        deploymentId:
          type: string
          description: ID of the deployment summarized by these analytics.
        endpointId:
          type: string
          description: ID of the deployment's parent endpoint.
        timeRange:
          $ref: '#/components/schemas/DE.MetricsTimeRange'
          description: Closed-open time range covered by the analytics.
        metrics:
          $ref: '#/components/schemas/DE.DeploymentMetrics'
          description: Aggregate operational metrics for the deployment.
        timeSeries:
          type: array
          items:
            $ref: '#/components/schemas/DE.TimeSeriesDataPoint'
          description: Per-bucket metric samples for the deployment.
      description: Usage and performance analytics for one deployment under an endpoint.
    DE.EndpointMetrics:
      type: object
      properties:
        endpointId:
          type: string
          description: The endpoint these metrics describe.
        timeRange:
          allOf:
            - $ref: '#/components/schemas/DE.MetricsTimeRange'
          description: Time range covered by the metrics.
        requestMetrics:
          $ref: '#/components/schemas/DE.RequestMetrics'
          description: Request counts and rates.
        latencyMetrics:
          $ref: '#/components/schemas/DE.LatencyMetrics'
          description: Time-to-first-token, end-to-end, and inter-token latency percentiles.
        throughputMetrics:
          $ref: '#/components/schemas/DE.ThroughputMetrics'
          description: Token, request, and batching throughput.
        errorMetrics:
          $ref: '#/components/schemas/DE.ErrorMetrics'
          description: Error rate and counts by error type.
        resourceUtilization:
          $ref: '#/components/schemas/DE.ResourceUtilization'
          description: Average CPU, GPU, memory, and network utilization.
        tokenMetrics:
          $ref: '#/components/schemas/DE.TokenMetrics'
          description: Input and output token totals and averages.
        deploymentMetrics:
          type: array
          items:
            $ref: '#/components/schemas/DE.DeploymentMetrics'
          description: Per-deployment breakdown, if the endpoint has multiple deployments.
      description: Operational metrics aggregated across all deployments receiving traffic for an endpoint.
    DE.MetricsTimeRange:
      type: object
      properties:
        startTime:
          type: string
          description: Inclusive start of the time range.
          format: date-time
        endTime:
          type: string
          description: Exclusive end of the time range.
          format: date-time
      description: Closed-open time range used by metrics and analytics responses.
    DE.TimeSeriesDataPoint:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Start time of the metric bucket.
        values:
          type: object
          additionalProperties:
            type: number
          description: Metric names mapped to their numeric values for this bucket.
      description: Timestamped bucket containing one or more named metric values.
    DE.Config:
      type: object
      properties:
        id:
          type: string
          description: Unique config revision identifier.
        engineType:
          enum:
            - ENGINE_TYPE_PULSAR
            - ENGINE_TYPE_VLLM
            - ENGINE_TYPE_SGLANG
            - ENGINE_TYPE_TGL
            - ENGINE_TYPE_TRTLLM
            - ENGINE_TYPE_SMG
          type: string
          description: Inference engine used to serve the model.
        deploymentFramework:
          enum:
            - DEPLOYMENT_FRAMEWORK_DEFAULT
            - DEPLOYMENT_FRAMEWORK_ROLLOUTS
            - DEPLOYMENT_FRAMEWORK_LWS
            - DEPLOYMENT_FRAMEWORK_DYNAMO
            - DEPLOYMENT_FRAMEWORK_GROVE
          type: string
          description: Orchestration framework used to run replicas for this config.
        selectors:
          type: array
          items:
            $ref: '#/components/schemas/DE.ConfigSelector'
          description: Hardware and runtime selectors resolved by the config.
        selectorsHash:
          type: string
          description: Stable hash of the resolved selectors, used to identify equivalent configs.
      description: Resolved inference engine, orchestration framework, and selectors for one config revision.
    DE.Certification:
      type: object
      required:
        - target
        - certificationType
        - certifiedAt
        - certifiedBy
        - model
        - modelRevisionId
      properties:
        target:
          enum:
            - CERTIFICATION_TARGET_DE_SERVERLESS
            - CERTIFICATION_TARGET_MRE
          type: string
          description: Product or serving environment for which the combination was evaluated.
        certificationType:
          enum:
            - CERTIFICATION_TYPE_CERTIFIED
            - CERTIFICATION_TYPE_UNCERTIFIED
          type: string
          description: Whether the model and config combination passed certification.
        certifiedAt:
          type: string
          format: date-time
          description: Time when the certification decision was recorded.
        certifiedBy:
          type: string
          description: Service or reviewer that recorded the certification.
        notes:
          type: string
          description: Human-readable certification notes or limitations.
        model:
          type: string
          description: Resource name of the certified model.
        modelRevisionId:
          type: string
          description: Revision identifier of the certified model.
        draftModel:
          type: string
          description: Resource name of the certified draft model.
        draftModelRevisionId:
          type: string
          description: Revision identifier of the certified draft model.
      description: Certification result for a model, config, and optional draft-model combination.
    DE.Selector:
      type: object
      required:
        - key
        - value
      properties:
        key:
          type: string
          description: Selector name, such as GPU type, GPU count, or optimization profile.
        value:
          type: string
          description: Required value for the selector.
      description: Hardware or runtime requirement expressed as a key-value pair.
    DE.ModelExternal:
      type: object
      properties:
        url:
          type: string
          description: Canonical external URL for the model, such as its Hugging Face repository.
      description: External source associated with a model.
    DE.ModelLicense:
      type: object
      properties:
        name:
          type: string
          description: License identifier or name reported by the model source.
      description: License metadata associated with a model.
    DE.ModelWeights:
      type: object
      properties:
        type:
          enum:
            - WEIGHTS_TYPE_DEFAULT
            - WEIGHTS_TYPE_SPECULATOR
            - WEIGHTS_TYPE_ADAPTER
          type: string
          description: 'Role of the weights: full model, speculative draft model, or LoRA adapter.'
        speculatorMechanism:
          enum:
            - SPECULATOR_MECHANISM_DRAFT
            - SPECULATOR_MECHANISM_LOOKAHEAD
            - SPECULATOR_MECHANISM_MTP
          type: string
          description: Speculative decoding mechanism for speculator weights.
        draftSpeculatorType:
          enum:
            - DRAFT_SPECULATOR_TYPE_EAGLE
            - DRAFT_SPECULATOR_TYPE_PHOENIX
          type: string
          description: Draft-model speculator family for draft speculative decoding.
        architecture:
          type: string
          description: Model architecture detected from the weight metadata.
        contextLength:
          type: string
          description: Maximum context length reported by the model metadata.
        parameters:
          $ref: '#/components/schemas/DE.ModelParameters'
          description: Total parameter count and breakdown by numerical data type.
      description: Architecture, size, precision, and speculative-decoding metadata for model weights.
    DE.ScalingMetric:
      type: object
      properties:
        name:
          type: string
          description: Metric name, such as `gpu_utilization`, `ttft`, `inflight_requests`, `e2e_latency`, `throughput_per_replica`, or `decoding_speed`.
        type:
          enum:
            - METRIC_TARGET_TYPE_VALUE
            - METRIC_TARGET_TYPE_UTILIZATION
            - METRIC_TARGET_TYPE_AVERAGE_VALUE
          type: string
          description: Whether `target` is an absolute value, a utilization percentage, or a per-replica average.
        target:
          type: number
          description: Target interpreted according to `type`. Utilization uses a percentage from 0 to 100, value uses an absolute measurement, and average value uses a per-replica measurement.
        percentile:
          type: string
          description: 'Percentile to evaluate for latency-based metrics: `p50`, `p90`, `p95`, or `p99`.'
      description: Metric and target used by the autoscaler to recommend a replica count.
      required:
        - name
        - type
        - target
    DE.DeploymentMetrics:
      type: object
      properties:
        deploymentId:
          type: string
          description: ID of the deployment summarized by these metrics.
        endpointId:
          type: string
          description: ID of the deployment's parent endpoint.
        timeRange:
          $ref: '#/components/schemas/DE.MetricsTimeRange'
          description: Closed-open time range covered by the metrics.
        requestMetrics:
          $ref: '#/components/schemas/DE.RequestMetrics'
          description: Request counts and rates.
        latencyMetrics:
          $ref: '#/components/schemas/DE.LatencyMetrics'
          description: Time-to-first-token, end-to-end, and inter-token latency percentiles.
        throughputMetrics:
          $ref: '#/components/schemas/DE.ThroughputMetrics'
          description: Token, request, and batching throughput.
        errorMetrics:
          $ref: '#/components/schemas/DE.ErrorMetrics'
          description: Error rate and counts by error type.
        resourceUtilization:
          $ref: '#/components/schemas/DE.ResourceUtilization'
          description: Average CPU, GPU, memory, and network utilization.
        tokenMetrics:
          $ref: '#/components/schemas/DE.TokenMetrics'
          description: Input and output token totals and averages.
      description: Operational metrics for one deployment under an endpoint.
    DE.ErrorMetrics:
      type: object
      properties:
        errorRate:
          type: number
          description: Percentage in [0, 100].
        errorsByType:
          type: object
          additionalProperties:
            type: string
          description: Counts of errors keyed by error type (e.g. HTTP status code or error kind).
      description: Error rate and aggregate counts by error type. Individual error samples are not included.
    DE.LatencyMetrics:
      type: object
      properties:
        ttftP50Ms:
          type: number
          description: 50th-percentile time to first token, in milliseconds.
        ttftP90Ms:
          type: number
          description: 90th-percentile time to first token, in milliseconds.
        ttftP99Ms:
          type: number
          description: 99th-percentile time to first token, in milliseconds.
        latencyP50Ms:
          type: number
          description: 50th-percentile end-to-end request latency, in milliseconds.
        latencyP90Ms:
          type: number
          description: 90th-percentile end-to-end request latency, in milliseconds.
        latencyP99Ms:
          type: number
          description: 99th-percentile end-to-end request latency, in milliseconds.
        itlP50Ms:
          type: number
          description: 50th-percentile inter-token latency, in milliseconds.
        itlP90Ms:
          type: number
          description: 90th-percentile inter-token latency, in milliseconds.
        itlP99Ms:
          type: number
          description: 99th-percentile inter-token latency, in milliseconds.
      description: Time-to-first-token, end-to-end, and inter-token latency percentiles in milliseconds.
    DE.RequestMetrics:
      type: object
      properties:
        totalRequests:
          type: string
          description: Total requests received during the time range.
        successfulRequests:
          type: string
          description: Requests completed successfully during the time range.
        failedRequests:
          type: string
          description: Requests that failed during the time range.
        requestsPerSecond:
          type: number
          description: Average requests per second over the time range.
        requestsByStatusCode:
          type: object
          additionalProperties:
            type: string
          description: Request counts keyed by HTTP status code.
      description: Request counts, rate, and status-code distribution over a time range.
    DE.ResourceUtilization:
      type: object
      properties:
        cpuUtilization:
          type: number
          description: Average CPU utilization across replicas, as a percentage.
        gpuUtilization:
          type: number
          description: Average GPU compute utilization across replicas, as a percentage.
        memoryUtilization:
          type: number
          description: Average system memory utilization across replicas, as a percentage.
        gpuMemoryUtilization:
          type: number
          description: Average GPU memory utilization across replicas, as a percentage.
        networkBandwidthMbps:
          type: number
          description: Average network throughput across replicas, in megabits per second.
      description: Average compute, memory, and network utilization for replicas over a time range.
    DE.ThroughputMetrics:
      type: object
      properties:
        tokensPerSecond:
          type: number
          description: Average generated tokens per second.
        requestsPerSecond:
          type: number
          description: Average completed requests per second.
        avgBatchSize:
          type: number
          description: Average number of requests processed in each runtime batch.
        avgBatchDepth:
          type: number
          description: Average number of batches queued or in flight in the serving engine.
      description: Token, request, and batching throughput over a time range.
    DE.TokenMetrics:
      type: object
      properties:
        totalInputTokens:
          type: string
          description: Total input tokens processed during the time range.
        totalOutputTokens:
          type: string
          description: Total output tokens generated during the time range.
        avgInputTokens:
          type: number
          description: Average input tokens per request.
        avgOutputTokens:
          type: number
          description: Average output tokens per request.
      description: Aggregate and per-request token usage over a time range.
    DE.ConfigSelector:
      type: object
      properties:
        id:
          type: string
          description: Unique selector identifier.
        key:
          type: string
          description: Selector name, such as GPU type, GPU count, or optimization profile.
        value:
          type: string
          description: Required value for the selector.
      description: Hardware or runtime requirement associated with a config revision.
    DE.ModelParameters:
      type: object
      required:
        - total
        - byDtype
      properties:
        total:
          type: string
          description: Total number of parameters in the model weights.
        byDtype:
          type: array
          items:
            $ref: '#/components/schemas/DE.ModelDTypeCount'
          description: Parameter counts grouped by numerical data type.
      description: Model parameter count and precision breakdown.
    DE.ModelDTypeCount:
      type: object
      required:
        - dtype
        - count
      properties:
        dtype:
          type: string
          description: Numerical data type, such as `float16`, `bfloat16`, or `int8`.
        count:
          type: string
          description: Number of model parameters stored with this data type.
      description: Number of model parameters stored in one numerical data type.

    RL.OptimStepBody:
      type: object
      description: Request body for an optimizer step.
      properties:
        adam_params:
          $ref: '#/components/schemas/RL.AdamParams'
          description: Adam optimizer overrides for this step.
        muon_params:
          $ref: '#/components/schemas/RL.MuonParams'
          description: Muon optimizer overrides for this step.
    RL.WeightsSyncBody:
      type: object
      description: Request body for publishing updated policy parameters for sampling.
      required:
        - weight_sync_type
      properties:
        weight_sync_type:
          $ref: '#/components/schemas/RL.WeightSyncType'
          description: How updated parameters are made available for sampling. See `WeightSyncType` for accepted values.
    RL.SampleBody:
      type: object
      required:
        - model_inputs
      properties:
        model_inputs:
          description: Model inputs to sample from
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.ModelInput'
        sampling_params:
          $ref: '#/components/schemas/RL.SamplingParams'
          description: Optional sampling parameters
        num_samples:
          type: integer

          example: 1
          default: "1"
          description: Number of completions to generate per prompt
        prompt_logprobs:
          type: boolean
          example: false
          default: "false"
          description: When true, also compute teacher-forced log-probabilities for the model input tokens and return them in `SampleResult.prompt_logprobs`.
        topk_prompt_logprobs:
          type: integer
          minimum: 0
          maximum: 20
          example: 0
          default: "0"
          description: Number of most likely alternative tokens to return per model input token in `SampleResult.topk_prompt_logprobs`. 0 disables top-k prompt log-probabilities. Maximum 20.
        return_routed_experts:
          type: boolean
          example: false
          default: "false"
          description: When true, capture the mixture-of-experts routing decisions made while generating and return them in `SampledSequence.routed_experts`, so training can reuse the same expert selection. Only available on mixture-of-experts models; ignored otherwise. The captured buffer scales with sequence length, so leave it off unless you replay routing during training.
    RL.ForwardBackwardBody:
      type: object
      required:
        - samples
        - loss
      properties:
        samples:
          description: Batch of training samples to process
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.TrainingSample'
        loss:
          description: Loss function configuration
          $ref: '#/components/schemas/RL.LossConfig'
    RL.ModelInput:
      type: object
      required:
        - chunks
      properties:
        chunks:
          description: Input chunks for the model
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.ModelInputChunk'
    RL.SamplingParams:
      type: object
      properties:
        max_tokens:
          type: integer
          example: 512
          default: "512"
          description: Maximum number of tokens to generate per completion
        temperature:
          type: number
          example: 1
          default: "1.0"
          description: Sampling temperature
        top_p:
          type: number
          example: 1
          default: "1.0"
          description: Nucleus sampling probability threshold
        top_k:
          type: integer
          example: -1
          default: "-1"
          description: Top-k sampling limit
        stop:
          type: array
          example:
            - "\n"
            - END
          items:
            type: string
          description: Generation stops when any of these strings is produced
        seed:
          oneOf:
            - type: string
            - type: integer
          example: "42"
          description: Random seed for reproducible sampling for the same prompt and model state. Per-completion seeds remain stable if the request is split across generator replicas.
    RL.ModelInputChunk:
      type: object
      description: A single chunk of model input content.
      required:
        - encoded_text
      properties:
        encoded_text:
          $ref: '#/components/schemas/RL.EncodedTextChunk'
          description: Pre-tokenized text content for this input chunk.
    RL.ListMeta:
      type: object
      description: Pagination metadata for list responses
      properties:
        limit:
          type: integer
          example: 20
          description: Maximum number of items returned per page
        has_more:
          type: boolean
          example: true
          description: Whether more items exist beyond this page
        next_cursor:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Cursor to use as the 'after' parameter for the next page. Empty when has_more is false.
    RL.ModelFullModeConfig:
      type: object
      description: Full-weight training config. If present, the model supports full-weight training.
      required:
        - max_batch_size
        - max_seq_length
      properties:
        max_batch_size:
          type: integer
          example: 512
          description: Maximum global batch size accepted by a forward-backward step
        max_seq_length:
          type: integer
          example: 40960
          description: Maximum sequence length in tokens
    RL.ModelLoraModeConfig:
      type: object
      description: LoRA training config. If present, the model supports LoRA training.
      required:
        - max_batch_size
        - max_seq_length
        - max_rank
      properties:
        max_batch_size:
          type: integer
          example: 512
          description: Maximum global batch size accepted by a forward-backward step
        max_seq_length:
          type: integer
          example: 40960
          description: Maximum sequence length in tokens
        max_rank:
          type: integer
          example: 64
          description: Maximum LoRA rank
    RL.ComputeConfig:
      type: object
      description: Compute layout for a model resource
      required:
        - num_generator_replicas
      properties:
        num_generator_replicas:
          type: integer
          format: int32
          example: 1
          description: Number of generator replicas. 0 means the resource runs the trainer only, with no generator.
    RL.ComputeConfigCreateRequest:
      type: object
      description: Compute layout to provision for a model resource
      properties:
        num_generator_replicas:
          type: integer
          format: int32
          example: 2
          default: "1"
          description: Number of generator replicas. 0 runs the trainer only, with no generator.
    RL.ModelResourcesStatus:
      description: Lifecycle status of a model resource
      type: string
      enum:
        - MODEL_RESOURCES_STATUS_PENDING
        - MODEL_RESOURCES_STATUS_CREATING
        - MODEL_RESOURCES_STATUS_READY
        - MODEL_RESOURCES_STATUS_ERROR
        - MODEL_RESOURCES_STATUS_STOPPED
        - MODEL_RESOURCES_STATUS_STOPPING
    RL.ModelResources:
      type: object
      description: Allocated GPU resources that training sessions attach to
      required:
        - id
        - status
        - base_model
        - compute_config
        - lora_enabled
        - created_at
        - updated_at
        - optimizer_config
        - created_by
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Unique identifier for the model resource
        status:
          $ref: '#/components/schemas/RL.ModelResourcesStatus'
          example: MODEL_RESOURCES_STATUS_READY
          description: Lifecycle status of the model resource
        error:
          $ref: '#/components/schemas/RL.ModelResourcesError'
          description: Structured detail for the model resource's current error. Set when the resource is in an error state.
        base_model:
          type: string
          example: Qwen/Qwen3-0.6B
          description: Base model the resource is provisioned for
        compute_config:
          $ref: '#/components/schemas/RL.ComputeConfig'
          description: Compute layout provisioned for the resource.
        lora_enabled:
          type: boolean
          example: true
          description: Whether the resource hosts LoRA sessions or a full-weight session
        created_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:00Z"
          description: Timestamp when the model resource was created
        updated_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:05Z"
          description: Timestamp when the model resource was last updated
        optimizer_config:
          $ref: '#/components/schemas/RL.OptimizerConfig'
          description: Optimizer configuration for this resource.
        created_by:
          type: string
          example: user_123
          description: ID of the user who created the model resource
    RL.ModelResourcesError:
      type: object
      description: Structured detail for the model resource's current error
      required:
        - code
        - message
        - occurred_at
      properties:
        code:
          $ref: '#/components/schemas/RL.ModelResourcesErrorCode'
          example: MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE
          description: Finite machine-readable reason code for UI branching
        message:
          type: string
          example: Capacity is currently unavailable. Try again later.
          description: User-safe human-readable detail for the current status
        occurred_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:05Z"
          description: Timestamp when this error was reported
    RL.ModelResourcesErrorCode:
      type: string
      description: Finite machine-readable model resource lifecycle error code
      enum:
        - MODEL_RESOURCES_ERROR_CODE_CAPACITY_UNAVAILABLE
        - MODEL_RESOURCES_ERROR_CODE_PROVISIONING_FAILED
    RL.CreateModelResourcesRequest:
      type: object
      description: Request to provision a standalone model resource
      required:
        - base_model
      properties:
        base_model:
          type: string
          example: Qwen/Qwen3-0.6B
          description: Base model to provision the resource for
        compute_config:
          $ref: '#/components/schemas/RL.ComputeConfigCreateRequest'
          description: Compute layout to provision.
        lora_enabled:
          type: boolean
          default: true
          example: true
          description: Whether the resource hosts LoRA sessions or a single full-weight session
        optimizer_config:
          $ref: '#/components/schemas/RL.OptimizerConfig'
          description: Optimizer configuration for this resource.
    RL.ModelResourcesEstimateCostResponse:
      type: object
      properties:
        price_per_hour:
          type: number
          format: double
          example: 56
          description: Estimated on-demand price per hour in the currency's major unit.
        currency:
          type: string
          example: USD
          description: ISO 4217 currency code.
      required:
        - price_per_hour
        - currency
    RL.ModelResourcesListResponse:
      type: object
      description: Paginated list of model resources
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RL.ModelResources'
          description: List of model resources
        meta:
          $ref: '#/components/schemas/RL.ListMeta'
          description: Pagination metadata
    RL.ModelTrainerConfig:
      type: object
      description: Training config. Each sub-mode is present only when the model supports that training mode.
      properties:
        full:
          $ref: '#/components/schemas/RL.ModelFullModeConfig'
          description: Full-weight training config. Set when the model supports full-weight training.
        lora:
          $ref: '#/components/schemas/RL.ModelLoraModeConfig'
          description: LoRA training config. Set when the model supports LoRA training.
    RL.ModelSamplingDefaults:
      type: object
      description: Default sampling parameters used for a Sample request.
      required:
        - "n"
        - max_tokens
        - temperature
        - logprobs
      properties:
        "n":
          type: integer
          example: 1
          description: Number of completions per prompt
        max_tokens:
          type: integer
          example: 512
          description: Maximum tokens generated per completion
        temperature:
          type: number
          example: 1
          description: Sampling temperature
        logprobs:
          type: integer
          example: 1
          description: Number of logprobs to return per token
    RL.ModelGeneratorConfig:
      type: object
      description: Inference config. If present, the model can be provisioned with one or more generator replicas.
      required:
        - context_length
        - sampling_defaults
      properties:
        context_length:
          type: integer
          example: 40960
          description: Maximum tokens in a single inference request (prompt + completion)
        sampling_defaults:
          $ref: '#/components/schemas/RL.ModelSamplingDefaults'
          description: Default sampling parameters used for sample requests.
    RL.SupportedModel:
      type: object
      description: A base model supported by the RL service. Per-mode configs are present only when the model supports that mode.
      required:
        - base_model
      properties:
        base_model:
          type: string
          example: Qwen/Qwen3-0.6B
          description: Base model identifier to pass as base_model when creating a model resource
        trainer_config:
          $ref: '#/components/schemas/RL.ModelTrainerConfig'
          description: Training config. Set when the model supports at least one training mode.
        generator_config:
          $ref: '#/components/schemas/RL.ModelGeneratorConfig'
          description: Inference config. Set when the model can be provisioned with generator replicas.
    RL.EncodedTextChunk:
      type: object
      description: Pre-tokenized text content for a model input chunk.
      required:
        - tokens
      properties:
        tokens:
          description: Pre-tokenized text input
          type: array
          example:
            - 123
            - 456
            - 789
          items:
            oneOf:
              - type: string
              - type: integer
    RL.DType:
      type: string
      enum:
        - D_TYPE_UNSPECIFIED
        - D_TYPE_INT64
        - D_TYPE_FLOAT32
        - D_TYPE_BFLOAT16
      default: D_TYPE_UNSPECIFIED
    RL.LossType:
      type: string
      description: Type of loss function used for RL training.
      enum:
        - LOSS_TYPE_UNSPECIFIED
        - LOSS_TYPE_CROSS_ENTROPY
        - LOSS_TYPE_GRPO
        - LOSS_TYPE_IMPORTANCE_SAMPLING
        - LOSS_TYPE_PPO
        - LOSS_TYPE_CISPO
        - LOSS_TYPE_DRO
      default: LOSS_TYPE_UNSPECIFIED
    RL.WeightSyncType:
      type: string
      description: How updated policy parameters are made available for sampling. SYNCHRONOUS waits for the policy update before returning; BACKGROUND_PUBLISH returns after scheduling the update; PIPELINE overlaps the update with in-flight sampling when possible.
      enum:
        - WEIGHT_SYNC_TYPE_SYNCHRONOUS
        - WEIGHT_SYNC_TYPE_BACKGROUND_PUBLISH
        - WEIGHT_SYNC_TYPE_PIPELINE
    RL.CrossEntropyLossParams:
      type: object
      description: Cross-entropy loss parameters (currently empty).
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    RL.GRPOLossParams:
      type: object
      properties:
        clip_low_threshold:
          type: number
          format: float
          example: 0.8
          default: "0.8"
          description: Lower clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be <= 1.
        clip_high_threshold:
          type: number
          format: float
          example: 1.2
          default: "1.2"
          description: Upper clip threshold for the importance-sampling ratio. The ratio is clamped to this bound; tighter clipping makes policy updates more conservative. Must be >= 1.
        beta:
          type: number
          example: 0.1
          default: "0.0"
          description: KL penalty coefficient
        agg_type:
          $ref: '#/components/schemas/RL.GRPOLossAggregationType'
          example: GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON
          default: "GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON"
          description: Aggregation type for loss computation
        ratio_type:
          $ref: '#/components/schemas/RL.GRPOLossRatioType'
          example: GRPO_LOSS_RATIO_TYPE_TOKEN
          default: "GRPO_LOSS_RATIO_TYPE_TOKEN"
          description: Controls how the importance-sampling ratio is computed in GRPO loss. Defaults to token-level ratios, which is the standard GRPO behavior. Use sequence-level ratios to enable GSPO-style loss calculation instead.
    RL.GRPOLossAggregationType:
      type: string
      enum:
        - GRPO_LOSS_AGGREGATION_TYPE_UNSPECIFIED
        - GRPO_LOSS_AGGREGATION_TYPE_FIXED_HORIZON
        - GRPO_LOSS_AGGREGATION_TYPE_TOKEN_MEAN
        - GRPO_LOSS_AGGREGATION_TYPE_SEQUENCE_MEAN
      default: GRPO_LOSS_AGGREGATION_TYPE_UNSPECIFIED
    RL.GRPOLossRatioType:
      type: string
      description: Controls whether GRPO loss uses token-level or sequence-level importance ratios.
      enum:
        - GRPO_LOSS_RATIO_TYPE_TOKEN
        - GRPO_LOSS_RATIO_TYPE_SEQUENCE
      default: GRPO_LOSS_RATIO_TYPE_TOKEN
    RL.PPOLossParams:
      type: object
      properties:
        clip_low_threshold:
          type: number
          format: float
          example: 0.8
          default: "0.8"
          description: Lower absolute bound for the importance ratio in the clipped surrogate. Must be <= 1.
        clip_high_threshold:
          type: number
          format: float
          example: 1.2
          default: "1.2"
          description: Upper absolute bound for the importance ratio in the clipped surrogate. Must be >= 1.
    RL.CISPOLossParams:
      type: object
      properties:
        clip_low_threshold:
          type: number
          format: float
          example: 0
          default: "0.0"
          description: Lower absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient
        clip_high_threshold:
          type: number
          format: float
          example: 4
          default: "4.0"
          description: Upper absolute bound for the importance ratio; the clipped ratio is applied as a detached coefficient
    RL.DROLossParams:
      type: object
      properties:
        beta:
          type: number
          format: float
          example: 0.05
          description: Coefficient on the quadratic log-ratio penalty. Required; there is no default.
      required:
        - beta
    RL.LossConfig:
      type: object
      required:
        - type
      properties:
        type:
          $ref: '#/components/schemas/RL.LossType'
          description: Type of loss function to use
          example: LOSS_TYPE_GRPO
        cross_entropy_params:
          $ref: '#/components/schemas/RL.CrossEntropyLossParams'
        grpo_params:
          $ref: '#/components/schemas/RL.GRPOLossParams'
        ppo_params:
          $ref: '#/components/schemas/RL.PPOLossParams'
        cispo_params:
          $ref: '#/components/schemas/RL.CISPOLossParams'
        dro_params:
          $ref: '#/components/schemas/RL.DROLossParams'
    RL.LossTargetTokens:
      type: object
      required:
        - data
      properties:
        data:
          description: Integer array of target tokens
          type: array
          example:
            - 123
            - 456
            - 789
          items:
            oneOf:
              - type: string
              - type: integer
        dtype:
          description: Data type of the integer array
          $ref: '#/components/schemas/RL.DType'
          example: D_TYPE_INT64
    RL.Weights:
      type: object
      required:
        - data
      properties:
        data:
          description: Per-token loss weights, one non-negative weight per target token. A weight of 0 excludes the token from loss; fractional weights are honored only by cross-entropy.
          type: array
          example:
            - 0
            - 0
            - 0.5
            - 1
          items:
            type: number
            minimum: 0
        dtype:
          description: Data type of the weights array (must be D_TYPE_FLOAT32).
          $ref: '#/components/schemas/RL.DType'
          example: D_TYPE_FLOAT32
    RL.LossAdvantages:
      type: object
      required:
        - data
      properties:
        data:
          description: Float array of per-token advantages
          type: array
          example:
            - 0.5
            - 0.5
          items:
            type: number
        dtype:
          description: Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16)
          $ref: '#/components/schemas/RL.DType'
          example: D_TYPE_FLOAT32
    RL.LossLogprobs:
      type: object
      required:
        - data
      properties:
        data:
          description: Float array of per-token log probabilities
          type: array
          example:
            - -1.2
            - -0.8
          items:
            type: number
        dtype:
          description: Data type of the float array (D_TYPE_FLOAT32 or D_TYPE_BFLOAT16)
          $ref: '#/components/schemas/RL.DType'
          example: D_TYPE_FLOAT32
    RL.GRPOLossInputs:
      type: object
      required:
        - advantages
        - logprobs
      properties:
        advantages:
          $ref: '#/components/schemas/RL.LossAdvantages'
          description: Per-token advantages for GRPO
        logprobs:
          $ref: '#/components/schemas/RL.LossLogprobs'
          description: Log probabilities for GRPO
        reference_logprobs:
          $ref: '#/components/schemas/RL.LossLogprobs'
          description: Reference model log probabilities (required if beta > 0)
    RL.ImportanceSamplingLossInputs:
      type: object
      description: Loss inputs for unclipped importance-sampling policy-gradient updates.
      required:
        - advantages
        - logprobs
      properties:
        advantages:
          $ref: '#/components/schemas/RL.LossAdvantages'
          description: Per-token advantages for importance sampling
        logprobs:
          $ref: '#/components/schemas/RL.LossLogprobs'
          description: Log probabilities for importance sampling
    RL.PPOLossInputs:
      type: object
      properties:
        advantages:
          $ref: '#/components/schemas/RL.LossAdvantages'
          description: Per-token advantages for PPO
        logprobs:
          $ref: '#/components/schemas/RL.LossLogprobs'
          description: Log probabilities for PPO
      required:
        - advantages
        - logprobs
    RL.CISPOLossInputs:
      type: object
      properties:
        advantages:
          $ref: '#/components/schemas/RL.LossAdvantages'
          description: Per-token advantages for CISPO
        logprobs:
          $ref: '#/components/schemas/RL.LossLogprobs'
          description: Log probabilities for CISPO
      required:
        - advantages
        - logprobs
    RL.DROLossInputs:
      type: object
      properties:
        advantages:
          $ref: '#/components/schemas/RL.LossAdvantages'
          description: Per-token advantages for DRO
        logprobs:
          $ref: '#/components/schemas/RL.LossLogprobs'
          description: Log probabilities for DRO
      required:
        - advantages
        - logprobs
    RL.LossInputs:
      type: object
      description: Token-level inputs used to compute the loss for one training sample.
      properties:
        target_tokens:
          $ref: '#/components/schemas/RL.LossTargetTokens'
          description: Target tokens for loss computation
        weights:
          $ref: '#/components/schemas/RL.Weights'
          description: 'Per-token loss weights (>= 0), one weight per target token. Required for cross-entropy, which honors fractional weights; other loss types treat weights as a 0/1 mask.'
        grpo_inputs:
          $ref: '#/components/schemas/RL.GRPOLossInputs'
          description: Inputs required when the loss type is GRPO
        importance_sampling_inputs:
          $ref: '#/components/schemas/RL.ImportanceSamplingLossInputs'
          description: Inputs required when the loss type is importance sampling
        ppo_inputs:
          $ref: '#/components/schemas/RL.PPOLossInputs'
        cispo_inputs:
          $ref: '#/components/schemas/RL.CISPOLossInputs'
        dro_inputs:
          $ref: '#/components/schemas/RL.DROLossInputs'
        routed_experts:
          $ref: '#/components/schemas/RL.RoutedExperts'
          description: Optional MoE per-token routing captured at sample time. Replayed on every training operation, so expert selection matches the one used at sample time. Must cover the whole sample, or all but its last token.
      required:
        - target_tokens
    RL.TrainingSample:
      type: object
      required:
        - model_input
        - loss_inputs
      properties:
        model_input:
          description: Model input
          $ref: '#/components/schemas/RL.ModelInput'
        loss_inputs:
          description: Loss function inputs
          $ref: '#/components/schemas/RL.LossInputs'
    RL.PolicyVersionSegment:
      type: object
      description: A (policy version, starting token) span within a sampled sequence. Version 0 is the initial model; each optim_step call increments the version by 1.
      required:
        - version
        - start_token
      properties:
        version:
          type: integer
          format: int32
          example: 5
          description: Model version under which this segment of tokens was generated
        start_token:
          type: integer
          format: int32
          example: 0
          description: Index of the first token of this segment within the sampled sequence. Always 0 for the first segment.
    RL.PromptTopLogprobs:
      type: object
      description: The most likely alternative tokens at a single prompt position, as two parallel arrays of equal length. Both are empty for a position with no conditioning context, such as position 0.
      properties:
        token_ids:
          type: array
          example:
            - 123
            - 456
          items:
            type: integer
            format: int32
          description: Token IDs of the alternatives, ordered by descending log-probability.
        logprobs:
          type: array
          example:
            - -0.5
            - -2.1
          items:
            type: number
            format: double
          description: Log-probability of each alternative in `token_ids`, at the same index.
    RL.RoutedExperts:
      type: object
      description: Mixture-of-experts routing decisions captured while generating, so training can reuse the same expert selection. A contiguous uint16 buffer of selected expert indices, reshaped by `shape`, which is always `[num_tokens, num_layers, topk]`.
      required:
        - data
        - shape
      properties:
        data:
          type: string
          format: byte
          description: Base64-encoded contiguous uint16 buffer of selected expert indices, row-major over (token, layer, k).
        shape:
          type: array
          example:
            - "512"
            - "64"
            - "8"
          items:
            oneOf:
              - type: string
              - type: integer
          description: Buffer shape as `[num_tokens, num_layers, topk]`.
    RL.OptimStepOperation:
      type: object
      description: Async optimizer step operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.OptimStepResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.WeightsSyncOperation:
      type: object
      description: Async weights-sync operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.WeightsSyncResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.SampleOperation:
      type: object
      description: Async sample operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          example: TRAINING_OPERATION_STATUS_PENDING
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.SampleBatchResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.OptimStepResult:
      type: object
      description: Result of an optimizer step operation
      required:
        - step
      properties:
        step:
          description: Step number
          oneOf:
            - type: string
            - type: integer
          example: "100"
    RL.WeightsSyncResult:
      type: object
      description: Result of a weights-sync operation
      required:
        - weights_version
      properties:
        weights_version:
          description: Policy version now available for sampling, or queued to become available for deferred sync modes. Comparable to `policy_segments[].version` on sample results.
          oneOf:
            - type: string
            - type: integer
          example: "100"
    RL.SampleBatchResult:
      type: object
      description: Batched result of a sample operation
      required:
        - results
      properties:
        results:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.SampleResult'
          description: One result per model input
    RL.SampleResult:
      type: object
      description: Completions generated for a single model input
      required:
        - sequences
        - policy_segments
      properties:
        sequences:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.SampledSequence'
          description: Generated completions
        prompt_logprobs:
          type: array
          example:
            - 0
            - -0.5
            - -1.2
          items:
            type: number
            format: double
          description: 'Teacher-forced log-probability of each model input token. Full prompt length; entry i corresponds to prompt token i. Entry 0 is always 0 as a placeholder: the first prompt token has no conditioning context, so it has no log-probability. Present only when prompt_logprobs was set on the request.'
        topk_prompt_logprobs:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.PromptTopLogprobs'
          description: The most likely alternative tokens at each model input token, up to `topk_prompt_logprobs` per position. Full prompt length; entry i corresponds to prompt token i, and entry 0 is empty. Present only when topk_prompt_logprobs was set on the request.
        policy_segments:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.PolicyVersionSegment'
          description: Policy versions that produced these completions
    RL.SampledSequence:
      type: object
      description: A single generated completion sequence with tokens and logprobs
      required:
        - tokens
        - stop_reason
        - prompt_cache_hit_tokens
      properties:
        tokens:
          type: array
          example:
            - "123"
            - "456"
            - "789"
          items:
            oneOf:
              - type: string
              - type: integer
          description: Generated token IDs
        logprobs:
          type: array
          example:
            - -0.5
            - -1.2
            - -0.3
          items:
            type: number
          description: Log probabilities for each generated token
        stop_reason:
          $ref: '#/components/schemas/RL.StopReason'
          example: STOP_REASON_LENGTH
          description: Reason for stopping generation
        prompt_cache_hit_tokens:
          type: integer
          format: int32
          example: 1024
          description: Number of model input tokens served from the prefix cache while generating this sequence.
        routed_experts:
          $ref: '#/components/schemas/RL.RoutedExperts'
          description: MoE per-token routing decisions captured during generation; absent for dense models or when capture is disabled.
    RL.StopReason:
      type: string
      description: Reason generation stopped.
      enum:
        - STOP_REASON_LENGTH
        - STOP_REASON_STOP
    RL.ForwardBackwardOperation:
      type: object
      description: Async forward-backward pass operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          example: TRAINING_OPERATION_STATUS_PENDING
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.ForwardBackwardResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.ForwardBackwardResult:
      type: object
      description: Result of a forward-backward pass operation
      required:
        - loss
      properties:
        loss:
          type: number
          example: 2.345
          description: Loss value
        metrics:
          type: object
          description: Loss-specific metrics (e.g., KL divergence, clip fraction for GRPO)
          example:
            loss/clip/high_fraction: 0.1
            loss/kl_ref/mean: 0.05
          additionalProperties:
            type: number
    RL.CustomForwardBackwardBody:
      type: object
      description: Request body for a custom forward-backward pass.
      required:
        - samples
        - gradients
      properties:
        samples:
          type: array
          description: Batch of training samples
          items:
            $ref: '#/components/schemas/RL.TrainingSample'
        gradients:
          type: array
          description: Per-sample per-token gradients of the loss with respect to log-probabilities
          items:
            $ref: '#/components/schemas/RL.TargetLogprobGradients'
    RL.CustomForwardBackwardOperation:
      type: object
      description: Async custom forward-backward pass operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          example: TRAINING_OPERATION_STATUS_PENDING
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.CustomForwardBackwardResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.CustomForwardBackwardResult:
      type: object
      description: Result of a custom forward-backward pass operation
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    RL.ForwardBody:
      type: object
      description: Request body for a forward pass.
      required:
        - samples
      properties:
        samples:
          type: array
          description: Batch of training samples for which to compute per-token log-probabilities
          items:
            $ref: '#/components/schemas/RL.TrainingSample'
    RL.ForwardOperation:
      type: object
      description: Async forward pass operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          example: TRAINING_OPERATION_STATUS_PENDING
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.ForwardResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.ForwardResult:
      type: object
      description: Result of a forward pass operation
      required:
        - logprobs
      properties:
        logprobs:
          type: array
          description: Per-sample per-token log-probabilities
          items:
            $ref: '#/components/schemas/RL.TargetLogprobs'
    RL.TargetLogprobs:
      type: object
      description: Per-token log-probabilities from the target model
      required:
        - data
      properties:
        data:
          type: array
          description: Float array of per-token log probabilities
          example: [-1.2, -0.8, -1.5, -0.9, -1.1]
          items:
            type: number
    RL.TargetLogprobGradients:
      type: object
      description: Per-token gradients of the loss with respect to target log-probabilities
      required:
        - data
      properties:
        data:
          type: array
          description: Float array of per-token gradients (d loss / d log p)
          example: [-0.1, 0.05, -0.08, 0.12, -0.03]
          items:
            type: number
        dtype:
          $ref: '#/components/schemas/RL.DType'
          example: D_TYPE_FLOAT32
          description: Data type of the float array
    RL.TrainingOperationError:
      type: object
      description: Error details for a failed training operation
      properties:
        code:
          description: Application error code
          $ref: '#/components/schemas/RL.TrainingOperationErrorCode'
          example: TRAINING_OPERATION_ERROR_CODE_TIMEOUT
        message:
          description: Human-readable error message
          type: string
          example: Operation timed out
    RL.TrainingOperationErrorCode:
      type: string
      description: Application error code for a failed training operation
      enum:
        - TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED
        - TRAINING_OPERATION_ERROR_CODE_RESOURCE_EXHAUSTED
        - TRAINING_OPERATION_ERROR_CODE_TIMEOUT
        - TRAINING_OPERATION_ERROR_CODE_INTERNAL_ERROR
        - TRAINING_OPERATION_ERROR_CODE_SESSION_NOT_ACTIVE
        - TRAINING_OPERATION_ERROR_CODE_INVALID_INPUT
        - TRAINING_OPERATION_ERROR_CODE_NON_FINITE_LOSS
      default: TRAINING_OPERATION_ERROR_CODE_UNSPECIFIED
    RL.TrainingOperationStatus:
      type: string
      enum:
        - TRAINING_OPERATION_STATUS_UNSPECIFIED
        - TRAINING_OPERATION_STATUS_PENDING
        - TRAINING_OPERATION_STATUS_RUNNING
        - TRAINING_OPERATION_STATUS_COMPLETED
        - TRAINING_OPERATION_STATUS_FAILED
      default: TRAINING_OPERATION_STATUS_UNSPECIFIED
    RL.StartTrainingSessionRequest:
      type: object
      required:
        - model_resources_id
      properties:
        resume_from_checkpoint_id:
          description: Checkpoint ID to resume from
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        resume_from_hf_checkpoint:
          description: HuggingFace repo (or hf://) to resume model weights from. Accepts either a full model or a PEFT adapter directory. Mutually exclusive with resume_from_checkpoint_id.
          type: string
          example: your-org/llama-3-8b-finetuned
        lora_config:
          $ref: '#/components/schemas/RL.LoraConfig'
          description: LoRA adapter configuration for the session
        model_resources_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Model resource to attach the session to. The session runs on that resource's GPU pods.
        display_name:
          type: string
          maxLength: 128
          example: gsm8k-experiment-2
          description: Optional display name used to identify the training session
        metadata:
          $ref: '#/components/schemas/RL.TrainingSessionMetadata'
          description: Optional auxiliary metadata to associate with the training session
    RL.UpdateTrainingSessionRequest:
      type: object
      description: Fields to update on a training session
      properties:
        display_name:
          type: string
          maxLength: 128
          description: Display name to update. An empty string clears the existing display name.
        metadata:
          $ref: '#/components/schemas/RL.TrainingSessionMetadata'
          description: Metadata fields to update. Omitted fields remain unchanged, and empty strings clear existing values.
    RL.TrainingSessionStatus:
      description: Status of the training session
      default: TRAINING_SESSION_STATUS_UNSPECIFIED
      type: string
      enum:
        - TRAINING_SESSION_STATUS_UNSPECIFIED
        - TRAINING_SESSION_STATUS_CREATING
        - TRAINING_SESSION_STATUS_RUNNING
        - TRAINING_SESSION_STATUS_STOPPED
        - TRAINING_SESSION_STATUS_STOPPING
        - TRAINING_SESSION_STATUS_ERROR
        - TRAINING_SESSION_STATUS_EXPIRED
    RL.TrainingSessionError:
      type: object
      description: Structured detail for the training session's current error
      required:
        - code
        - message
        - occurred_at
      properties:
        code:
          $ref: '#/components/schemas/RL.TrainingSessionErrorCode'
          example: TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY
          description: Finite machine-readable reason code for UI branching
        message:
          type: string
          example: The session could not start because the selected resource has no available capacity.
          description: User-safe human-readable detail for the current status
        occurred_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:05Z"
          description: Timestamp when this error was reported
    RL.TrainingSessionErrorCode:
      type: string
      description: Finite machine-readable training session lifecycle error code
      enum:
        - TRAINING_SESSION_ERROR_CODE_RESOURCE_UNAVAILABLE
        - TRAINING_SESSION_ERROR_CODE_RESOURCE_AT_CAPACITY
        - TRAINING_SESSION_ERROR_CODE_TIMED_OUT
        - TRAINING_SESSION_ERROR_CODE_SESSION_FAILED
    RL.WandbMetadata:
      type: object
      description: Details that associate a training session with a Weights & Biases run
      properties:
        entity:
          type: string
          maxLength: 256
          example: example-org
          description: Weights & Biases username or team that owns the project
        project:
          type: string
          maxLength: 256
          example: grpo-gsm8k
          description: Weights & Biases project containing the run
        group:
          type: string
          maxLength: 256
          example: gsm8k-35b-sweep
          description: Weights & Biases group used to organize related runs
        run_name:
          type: string
          maxLength: 256
          example: exp2-thinking-4k-ctx
          description: Human-readable name of the Weights & Biases run
        run_id:
          type: string
          maxLength: 256
          example: abc123
          description: Unique identifier assigned to the run by Weights & Biases
        url:
          type: string
          maxLength: 2048
          example: https://wandb.ai/example-org/example-project/runs/run-id
          description: HTTPS URL for the Weights & Biases run
    RL.TrainingSessionMetadata:
      type: object
      description: Auxiliary metadata associated with a training session
      properties:
        wandb:
          $ref: '#/components/schemas/RL.WandbMetadata'
          description: Weights & Biases details associated with the training session
    RL.TrainingSession:
      type: object
      description: A training session and its current state
      required:
        - id
        - metadata
        - status
        - inference_checkpoints
        - training_checkpoints
        - step
        - created_at
        - updated_at
        - model_resources_id
        - created_by
        - base_model
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: ID of the training session
        display_name:
          type: string
          maxLength: 128
          example: gsm8k-experiment-2
          description: Display name used to identify the training session
        metadata:
          $ref: '#/components/schemas/RL.TrainingSessionMetadata'
          description: Auxiliary metadata associated with the training session
        status:
          $ref: '#/components/schemas/RL.TrainingSessionStatus'
          example: TRAINING_SESSION_STATUS_RUNNING
          description: Status of the training session
        error:
          $ref: '#/components/schemas/RL.TrainingSessionError'
          description: Structured detail for the training session's current error. Set when the session is in an error state.
        inference_checkpoints:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.InferenceCheckpoint'
          description: List of saved inference checkpoints for this session
        training_checkpoints:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.TrainingCheckpoint'
          description: List of saved training checkpoints for this session
        resume_from_checkpoint_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Checkpoint ID this session was resumed from
        step:
          description: Current training step
          oneOf:
            - type: string
            - type: integer
          example: "100"
          default: "0"
        created_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:00Z"
          description: Timestamp when the training session was created
        updated_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:05Z"
          description: Timestamp when the training session was last updated
        lora_config:
          $ref: '#/components/schemas/RL.LoraConfig'
          description: LoRA adapter configuration. Present only for sessions running on a LoRA-enabled model resource.
        model_resources_id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Model resource this session is attached to. The session runs on that resource's GPU pods.
        base_model:
          type: string
          example: Qwen/Qwen3-0.6B
          description: Base model the session trains, taken from the model resource it is attached to
        created_by:
          type: string
          example: user_123
          description: ID of the user who created the training session
    RL.TrainingSessionsListResponse:
      type: object
      description: Paginated list of training sessions
      properties:
        data:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.TrainingSession'
          description: List of training sessions
        meta:
          $ref: '#/components/schemas/RL.ListMeta'
          description: Pagination metadata
    RL.SupportedModelsListResponse:
      type: object
      description: List of base models supported by the RL service
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/RL.SupportedModel'
          description: Supported base models for RL
    RL.LoraConfig:
      type: object
      description: LoRA adapter configuration
      properties:
        rank:
          type: integer

          example: 32
          default: "32"
          description: Rank of the LoRA adapter
        alpha:
          type: integer

          example: 64
          default: "64"
          description: Alpha of the LoRA adapter
        dropout:
          type: number
          example: 0
          default: "0.0"
          description: Dropout of the LoRA adapter
        seed:
          oneOf:
            - type: string
            - type: integer
          example: "59"
          description: Random seed for initializing LoRA adapter weights. Ignored when LoRA is disabled or the session resumes from a checkpoint.
    RL.OptimizerConfig:
      type: object
      description: Optimizer configuration
      properties:
        adamw:
          $ref: '#/components/schemas/RL.AdamWOptimizerConfig'
          description: Use the AdamW optimizer.
        muon:
          $ref: '#/components/schemas/RL.MuonOptimizerConfig'
          description: Use the Muon optimizer.
    RL.AdamWOptimizerConfig:
      type: object
      description: AdamW optimizer configuration
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    RL.MuonOptimizerConfig:
      type: object
      description: Advanced configuration for the Muon optimizer.
      properties:
        scaling_strategy:
          $ref: '#/components/schemas/RL.MuonScalingStrategy'
          example: MUON_SCALING_STRATEGY_ORIGINAL
          default: MUON_SCALING_STRATEGY_MATCH_ADAMW
          description: Scaling strategy for the Muon optimizer.
    RL.MuonScalingStrategy:
      type: string
      enum:
        - MUON_SCALING_STRATEGY_UNSPECIFIED
        - MUON_SCALING_STRATEGY_MATCH_ADAMW
        - MUON_SCALING_STRATEGY_ORIGINAL
      default: MUON_SCALING_STRATEGY_UNSPECIFIED
    RL.AdamParams:
      description: Per-step Adam optimizer overrides.
      type: object
      properties:
        learning_rate:
          description: Learning rate for the Adam-tuned parameters
          type: number
          example: 0.0001
        beta1:
          description: Exponential decay rate for the first-moment estimate
          type: number
          example: 0.9
          default: "0.9"
        beta2:
          description: Exponential decay rate for the second-moment estimate
          type: number
          example: 0.95
          default: "0.95"
        eps:
          description: Epsilon for numerical stability
          type: number
          example: 1e-8
          default: "1e-8"
        weight_decay:
          description: Weight decay coefficient
          type: number
          example: 0.1
          default: "0"
        grad_clip_norm:
          description: Maximum gradient norm for this step, gradients across all model parameters are clipped to this value. Set to 0 to disable gradient clipping. When unset, gradients are clipped to the session default (1.0).
          type: number
          example: 10
          default: "1.0"
    RL.MuonParams:
      type: object
      description: Per-step Muon optimizer overrides
      properties:
        learning_rate:
          type: number
          example: 0.02
          description: Learning rate for this Muon optimizer step.
        momentum:
          type: number
          example: 0.95
          default: "0.95"
          description: Momentum coefficient
        newton_schulz_steps:
          type: integer

          example: 5
          default: "5"
          description: Number of Newton-Schulz iterations
        weight_decay:
          type: number
          example: 0
          default: "0.0"
          description: Weight decay coefficient
        grad_clip_norm:
          type: number
          example: 10
          default: "1.0"
          description: Maximum gradient norm for this step, gradients across all model parameters are clipped to this value. Set to 0 to disable gradient clipping. When unset, gradients are clipped to the session default (1.0).
        adam:
          $ref: '#/components/schemas/RL.AdamParams'
          description: Per-step Adam optimizer overrides for the Adam-tuned parameters in a Muon-tuned optimizer session.
    RL.InferenceCheckpointOperation:
      type: object
      description: Async inference checkpoint operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          example: TRAINING_OPERATION_STATUS_PENDING
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.InferenceCheckpointResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.InferenceCheckpointResult:
      type: object
      description: Result of an inference checkpoint operation
      required:
        - model_name
      properties:
        model_name:
          type: string
          example: username/Meta-Llama-3-8B-rl-step-42-20260216
          description: Registered model name for downloading the checkpoint
    RL.InferenceCheckpoint:
      type: object
      description: Saved inference checkpoint
      required:
        - id
        - step
        - created_at
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Unique identifier for the checkpoint
        step:
          oneOf:
            - type: string
            - type: integer
          example: "42"
          description: Training step at time of save
        created_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:00Z"
          description: Timestamp when the checkpoint was created
        registration:
          $ref: '#/components/schemas/RL.InferenceCheckpointRegistration'
          description: Model registration details
    RL.InferenceCheckpointRegistration:
      type: object
      description: Model registration details for an inference checkpoint
      required:
        - model_name
        - registered_at
      properties:
        model_name:
          type: string
          example: username/Meta-Llama-3-8B-rl-step-42-20260216
          description: Registered model name for downloading the checkpoint
        registered_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:00Z"
          description: Timestamp when the model was registered
    RL.TrainingCheckpoint:
      type: object
      description: Saved training checkpoint
      required:
        - id
        - step
        - created_at
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Unique identifier for the checkpoint
        step:
          oneOf:
            - type: string
            - type: integer
          example: "42"
          description: Training step at time of save
        created_at:
          type: string
          format: date-time
          example: "2026-01-02T00:00:00Z"
          description: Timestamp when the checkpoint was created
    RL.TrainingCheckpointResult:
      type: object
      description: Result of a save training checkpoint operation
      required:
        - checkpoint_id
      properties:
        checkpoint_id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: ID of the saved training checkpoint (use for resume via Start)
    RL.TrainingCheckpointOperation:
      type: object
      description: Async save training checkpoint operation
      required:
        - id
        - status
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Operation ID
        status:
          $ref: '#/components/schemas/RL.TrainingOperationStatus'
          example: TRAINING_OPERATION_STATUS_PENDING
          description: Operation status
        output:
          $ref: '#/components/schemas/RL.TrainingCheckpointResult'
          description: Result on success
        error:
          $ref: '#/components/schemas/RL.TrainingOperationError'
          description: Error details on failure
    RL.CheckpointVariant:
      type: string
      enum:
        - CHECKPOINT_VARIANT_UNSPECIFIED
        - CHECKPOINT_VARIANT_MERGED
        - CHECKPOINT_VARIANT_ADAPTER
      default: CHECKPOINT_VARIANT_UNSPECIFIED
      description: "Checkpoint variant: merged (full model) or adapter (LoRA weights only)"
    RL.CheckpointFile:
      type: object
      description: A downloadable file within a checkpoint
      required:
        - filename
        - url
        - size
      properties:
        filename:
          type: string
          example: model-00001-of-00002.safetensors
          description: Name of the file
        url:
          type: string
          example: "https://..."
          description: Presigned URL for downloading the file
        size:
          oneOf:
            - type: string
            - type: integer
          example: "123456789"
          description: File size in bytes
    RL.CheckpointDownloadResponse:
      type: object
      description: Presigned download URLs for a checkpoint's files
      required:
        - data
      properties:
        data:
          type: array
          items:
            type: object
            $ref: '#/components/schemas/RL.CheckpointFile'
          description: List of files with presigned download URLs
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
    GPUClusterControlPlaneNode:
      type: object
      required:
        - node_id
        - status
        - host_name
        - num_cpu_cores
        - memory_gib
        - network
        - phase_transitions
      properties:
        node_id:
          type: string
        status:
          type: string
        host_name:
          type: string
        num_cpu_cores:
          type: integer
        memory_gib:
          type: number
        network:
          type: string
        phase_transitions:
          type: array
          items:
            $ref: '#/components/schemas/NodePhaseTransition'
          description: Phase transition history for this control plane node.
        public_ipv4:
          type: string
          description: Public IPv4 address of the control plane node.
    GPUClusterCreateRequest:
      description: GPU Cluster create request
      required:
        - region
        - gpu_type
        - num_gpus
        - cluster_name
        - billing_type
      anyOf:
        - required:
            - nvidia_version_id
          not:
            anyOf:
              - required:
                  - cuda_version
              - required:
                  - nvidia_driver_version
        - required:
            - cuda_version
            - nvidia_driver_version
      type: object
      properties:
        cluster_type:
          description: Type of cluster to create.
          type: string
          enum: [KUBERNETES, SLURM]
        region:
          description: Region to create the GPU cluster in. Usable regions can be found from `client.clusters.list_regions()`
          type: string
        gpu_type:
          description: Type of GPU to use in the cluster
          type: string
          enum:
            - H100_SXM
            - H200_SXM
            - RTX_6000_PCI
            - L40_PCIE
            - B200_SXM
            - H100_SXM_INF
            - B300_SXM
        num_gpus:
          description: Number of GPUs to allocate in the cluster. This must be multiple of 8. For example, 8, 16 or 24
          type: integer
        cluster_name:
          description: Name of the GPU cluster.
          type: string
        duration_days:
          x-stainless-terraform-configurability: computed
          description: Duration in days to keep the cluster running.
          type: integer
        shared_volume:
          x-stainless-terraform-configurability: computed
          $ref: '#/components/schemas/GPUClustersSharedVolumeCreateRequest'
          description: Inline configuration to create a shared volume with the cluster creation.
        volume_id:
          description: ID of an existing volume to use with the cluster creation.
          type: string
        billing_type:
          description: |
            RESERVED billing types allow you to specify the duration of the cluster reservation via the duration_days field.
            ON_DEMAND billing types will give you ownership of the cluster until you delete it.
            SCHEDULED_CAPACITY billing types allow you to reserve capacity for a scheduled time window. You must specify the reservation_start_time and reservation_end_time with this request.
          x-stainless-terraform-configurability: computed
          type: string
          enum:
            - RESERVED
            - ON_DEMAND
            - SCHEDULED_CAPACITY
        auto_scaled:
          deprecated: true
          type: boolean
          default: false
          description: Whether GPU cluster should be auto-scaled based on the workload. By default, it is not auto-scaled.
        auto_scale_max_gpus:
          type: integer
          description: Maximum number of GPUs to which the cluster can be auto-scaled up. This field is required if auto_scaled is true.
        slurm_shm_size_gib:
          type: integer
          description: Shared memory size in GiB for Slurm cluster. This field is required if cluster_type is SLURM.
        capacity_pool_id:
          type: string
          description: ID of the capacity pool to use for the cluster. This field is optional and only applicable if the cluster is created from a capacity pool.
        reservation_start_time:
          type: string
          description: Reservation start time of the cluster. This field is required for SCHEDULED billing to specify the reservation start time for the cluster. If not provided, the cluster provisions immediately.
          format: date-time
        reservation_end_time:
          type: string
          description: Reservation end time of the cluster. This field is required for SCHEDULED billing to specify the reservation end time for the cluster.
          format: date-time
        install_traefik:
          type: boolean
          default: false
          description: Whether to install Traefik ingress controller in the cluster. This field is only applicable for Kubernetes clusters and is false by default.
        cuda_version:
          type: string
          description: Legacy CUDA selector for this cluster. Bare semantic values such as 12.5 select ubuntu-22.04; existing OS-suffixed values remain accepted for compatibility. Must be paired with nvidia_driver_version. Prefer nvidia_version_id for new integrations.
        nvidia_driver_version:
          type: string
          description: Legacy NVIDIA driver selector for this cluster. For example, 550. Must be paired with cuda_version. Prefer nvidia_version_id for new integrations.
        nvidia_version_id:
          type: string
          description: Canonical region-specific NVIDIA version ID. If cuda_version and nvidia_driver_version are also set, they must resolve to the same catalog entry.
        slurm_image:
          type: string
          description: Custom Slurm image for Slurm clusters.
        oidc_config:
          $ref: '#/components/schemas/OIDCConfig'
        project_id:
          type: string
          description: Project ID for the cluster. If not set, the project from the request context is used.
        acceptance_tests_params:
          $ref: '#/components/schemas/AcceptanceTestsParams'
        cluster_config:
          $ref: '#/components/schemas/InstanceClusterConfig'
        num_capacity_pool_gpus:
          type: integer
          description: Number of GPUs to allocate from the capacity pool. Must be a multiple of 8 and not exceed num_gpus.
        auto_scale:
          type: boolean
          description: Whether to enable auto-scaling for the cluster. If true, the cluster will automatically scale the number of GPU worker nodes between num_gpus and auto_scale_max_gpus based on the workload.
        num_preemptible_gpus:
          type: integer
          description: Number of preemptible GPUs to request alongside on-demand capacity. Must be a multiple of 8. Preemptible nodes are cheaper but may be reclaimed when on-demand capacity is needed elsewhere; the system fulfills this asynchronously and surfaces the actual count in allocated_preemptible_gpus.
        num_reserved_gpus:
          type: integer
          description: Number of prepaid (PLG) reserved GPUs for this cluster. When omitted for RESERVED billing on create, the server defaults this to num_gpus.
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/AddOnCreateRequest'
          description: Add-ons to enable on the cluster at creation time.
    GPUClusterGPUWorkerNode:
      type: object
      required:
        - node_id
        - status
        - host_name
        - num_cpu_cores
        - num_gpus
        - memory_gib
        - networks
        - phase_transitions
      properties:
        node_id:
          type: string
        status:
          type: string
        host_name:
          type: string
        num_cpu_cores:
          type: integer
        num_gpus:
          type: integer
        memory_gib:
          type: number
        networks:
          type: array
          items:
            type: string
        instance_id:
          type: string
        latest_remediation:
          $ref: '#/components/schemas/Remediation'
        slurm_worker_hostname:
          type: string
        phase_transitions:
          type: array
          items:
            $ref: '#/components/schemas/NodePhaseTransition'
          description: Phase transition history for this GPU worker node.
        marked_for_deletion:
          type: boolean
          description: Whether this node is marked for deletion by the operator.
        public_ipv4:
          type: string
          description: Public IPv4 address of the GPU worker node.
        ib_hca_type:
          type: string
          description: InfiniBand HCA type.
        ib_hca_count:
          type: integer
          description: Number of InfiniBand HCAs.
        nvswitch_count:
          type: integer
          description: Number of NVSwitches.
        nvswitch_type:
          type: string
          description: NVSwitch type.
        ephemeral_storage:
          type: string
          description: Ephemeral storage size, such as 1Ti.
        auto_remediation_enabled:
          type: boolean
          description: Whether auto-remediation is enabled for this node's instance.
        deleted_at:
          type: string
          description: Timestamp when the node left the live data plane. Only set for deleted_gpu_worker_nodes.
          format: date-time
    GPUClusterInfo:
      type: object
      required:
        - cluster_id
        - cluster_type
        - region
        - gpu_type
        - cluster_name
        - cuda_version
        - nvidia_driver_version
        - volumes
        - status
        - control_plane_nodes
        - gpu_worker_nodes
        - kube_config
        - num_gpus
        - project_id
        - num_cpu_workers
        - phase_transitions
        - desired_preemptible_gpus
        - allocated_preemptible_gpus
        - num_capacity_pool_gpus
        - num_reserved_gpus
        - billing_type
        - add_ons
      properties:
        cluster_id:
          type: string
        cluster_type:
          description: Type of cluster.
          enum: [KUBERNETES, SLURM]
        region:
          type: string
        gpu_type:
          enum:
            - H100_SXM
            - H200_SXM
            - RTX_6000_PCI
            - L40_PCIE
            - B200_SXM
            - H100_SXM_INF
            - B300_SXM
        cluster_name:
          type: string
        duration_hours:
          type: integer
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/GPUClusterVolume'
        status:
          description: Current status of the GPU cluster.
          enum:
            - WaitingForControlPlaneNodes
            - WaitingForDataPlaneNodes
            - WaitingForSubnet
            - WaitingForSharedVolume
            - InstallingDrivers
            - RunningAcceptanceTests
            - Paused
            - OnDemandComputePaused
            - Ready
            - Degraded
            - Deleting
        control_plane_nodes:
          type: array
          items:
            $ref: '#/components/schemas/GPUClusterControlPlaneNode'
        gpu_worker_nodes:
          type: array
          items:
            $ref: '#/components/schemas/GPUClusterGPUWorkerNode'
        kube_config:
          type: string
        num_gpus:
          type: integer
        slurm_shm_size_gib:
          type: integer
        capacity_pool_id:
          type: string
        reservation_start_time:
          type: string
          format: date-time
        reservation_end_time:
          type: string
          format: date-time
        install_traefik:
          type: boolean
        cuda_version:
          type: string
        nvidia_driver_version:
          type: string
        created_at:
          type: string
          format: date-time
        oidc_config:
          $ref: '#/components/schemas/OIDCConfig'
        project_id:
          type: string
        cluster_config:
          $ref: '#/components/schemas/InstanceClusterConfig'
        num_cpu_workers:
          type: integer
          description: Number of CPU-only worker nodes in the cluster.
        phase_transitions:
          type: array
          items:
            $ref: '#/components/schemas/ClusterPhaseTransition'
          description: Cluster-level phase transition history.
        desired_preemptible_gpus:
          type: integer
          description: Customer's requested number of preemptible GPUs. Set on cluster create or update; persists until changed.
        allocated_preemptible_gpus:
          type: integer
          description: Actual number of preemptible GPUs currently allocated to the cluster. Updated asynchronously by the fulfillment and reclamation workers; may be less than desired_preemptible_gpus when capacity is constrained.
        billing_type:
          enum:
            - RESERVED
            - ON_DEMAND
            - SCHEDULED_CAPACITY
          type: string
          description: Billing type for the cluster (RESERVED, ON_DEMAND, or SCHEDULED_CAPACITY).
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/AddOnInfo'
          description: Enabled add-ons on this cluster. Only add-ons with enabled=true in their config are returned.
        machine_cluster_id:
          type: string
          description: ID of the machine cluster backing this GPU cluster.
        first_ready_at:
          type: string
          description: Timestamp when the cluster first reached the Ready phase.
          format: date-time
        is_in_substrate:
          type: boolean
          description: Whether the cluster is managed inside a substrate environment.
        control_plane_ready:
          type: boolean
          description: Whether the control plane is currently ready.
        ums_project_id:
          type: string
          description: UMS project ID associated with this cluster.
        ums_org_id:
          type: string
          description: UMS organization ID associated with this cluster.
        os_image:
          type: string
          description: Data-volume image name for GPU worker nodes.
        nvidia_driver_version_id:
          type: string
          description: Internal NVIDIA version ID for this cluster's driver and CUDA combination.
        num_capacity_pool_gpus:
          type: integer
          description: Number of GPUs to draw from a capacity pool. A component of the overall num_gpus, alongside num_reserved_gpus.
          format: int32
        num_reserved_gpus:
          type: integer
          description: Number of prepaid reserved GPUs for this cluster. A component of the overall num_gpus, alongside num_capacity_pool_gpus.
          format: int32
        deleted_gpu_worker_nodes:
          type: array
          items:
            $ref: '#/components/schemas/GPUClusterGPUWorkerNode'
          description: GPU worker nodes retained after they left the live data plane. These are separate from gpu_worker_nodes and must not be counted as live capacity.
        node_lifecycle_events:
          type: array
          items:
            $ref: '#/components/schemas/GPUClusterNodeLifecycleEvent'
          description: Recent node lifecycle events such as scale-up, scale-down, and preemption. Combine these with live and deleted node lists to render the cluster timeline.
    GPUClusterNodeLifecycleEvent:
      type: object
      description: Node lifecycle event included in a GPU cluster timeline.
      required:
        - node_id
        - reason
        - message
        - timestamp
      properties:
        node_id:
          type: string
          description: Tenant node name this lifecycle event applies to.
        reason:
          type: string
          description: Lifecycle event reason, for example TogetherScaledUp, TogetherScaledDown, or TogetherPreempted.
        message:
          type: string
          description: Human-readable lifecycle event message.
        timestamp:
          type: string
          description: Event timestamp.
          format: date-time
    GPUClusterUpdateRequest:
      type: object
      properties:
        cluster_type:
          description: Type of cluster to update.
          enum: [KUBERNETES, SLURM]
        num_gpus:
          description: Target GPU count for the cluster. When omitted, the server keeps the current GPU count from cluster metadata (use for config-only or decommission-time-only updates).
          type: integer
        reservation_end_time:
          type: string
          description: Timestamp at which the cluster should be decommissioned. Only accepted for prepaid clusters.
          format: date-time
        cluster_config:
          $ref: '#/components/schemas/InstanceClusterConfig'
        num_reserved_gpus:
          type: integer
          description: Number of reserved GPUs to update to. This field is only applicable for clusters with RESERVED billing type.
        num_preemptible_gpus:
          type: integer
          description: Updated desired number of preemptible GPUs for the cluster. When omitted, the current value is preserved. Must be a multiple of 8.
        num_capacity_pool_gpus:
          type: integer
          description: Number of GPUs to draw from the cluster's capacity pool. Only valid for clusters created with a capacity_pool_id. Must be a multiple of 8 and not exceed num_gpus. When omitted, the current value is preserved.
          format: int32
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/AddOnUpdateRequest'
          description: Add-ons to update on the cluster. Each entry identifies an existing add-on by name and provides the new external config to merge.
    GPUClusterVolume:
      type: object
      required:
        - volume_id
        - volume_name
        - size_tib
        - status
      properties:
        volume_id:
          description: ID of the volume.
          type: string
        volume_name:
          type: string
          description: User provided name of the volume.
        size_tib:
          type: integer
          description: Size of the volume in TiB.
        status:
          type: string
          description: Current status of the volume.
    GPUClusters:
      type: object
      required: [clusters]
      properties:
        clusters:
          type: array
          items:
            $ref: '#/components/schemas/GPUClusterInfo'
    InstanceTypesResponse:
      type: object
      properties:
        types:
          type: array
          items:
            enum:
              - H100_SXM
              - H200_SXM
              - RTX_6000_PCI
              - L40_PCIE
              - B200_SXM
              - H100_SXM_INF
              - B300_SXM
          error:
            $ref: '#/components/schemas/ErrorResponse'
    RegionListResponse:
      type: object
      required: [regions]
      properties:
        regions:
          type: array
          items:
            type: object
            required:
              - name
              - supported_instance_types
              - driver_versions
            properties:
              name:
                description: Identifiable name of the region.
                type: string
              driver_versions:
                description: List of supported identifiable cuda/nvidia driver versions pairs available in the region.
                type: array
                items:
                  $ref: '#/components/schemas/ClusterDriverVersionInfo'
              supported_instance_types:
                description: List of supported identifiable gpus available in the region.
                type: array
                items:
                  type: string
    ClusterDriverVersionInfo:
      type: object
      description: NVIDIA software configuration available in the region.
      required:
        - cuda_version
        - nvidia_driver_version
        - id
        - os
      properties:
        cuda_version:
          description: Semantic CUDA version without operating system text.
          type: string
        nvidia_driver_version:
          description: NVIDIA driver version.
          type: string
        id:
          description: Region-specific NVIDIA catalog ID to send as nvidia_version_id when creating a cluster.
          type: string
        os:
          description: Operating system image family for this catalog entry.
          type: string
    AcceptanceTestsParams:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether to run GPU acceptance tests during cluster bring-up.
        dcgm_diag_level:
          enum:
            - DCGM_DIAG_LEVEL_SHORT
            - DCGM_DIAG_LEVEL_MEDIUM
            - DCGM_DIAG_LEVEL_LONG
            - DCGM_DIAG_LEVEL_EXTENDED
          type: string
          description: DCGM diagnostic depth. SHORT = readiness; MEDIUM = default; LONG = system validation; EXTENDED = memtest. An omitted value selects MEDIUM when enabled.
        gpu_burn_duration:
          type: integer
          description: GPU burn duration in seconds; 0 means use the default when enabled.
        nccl_single_node_skipped:
          type: boolean
          description: Skip NCCL single-node acceptance test.
        gpu_burn_skipped:
          type: boolean
          description: Skip GPU burn acceptance test.
        dcgm_diag_skipped:
          type: boolean
          description: Skip DCGM diagnostics acceptance test.
        nccl_multi_node_skipped:
          type: boolean
          description: Skip NCCL multi-node acceptance test.
        storage_skipped:
          type: boolean
          description: Skip storage-performance acceptance test.
      description: AcceptanceTestsParams groups all GPU acceptance test options when enabled is true.
    AddOnConfig:
      type: object
      properties:
        dashboard:
          $ref: '#/components/schemas/DashboardConfig'
        ingress:
          $ref: '#/components/schemas/IngressConfig'
        torchpass:
          description: Configuration for the Model Aware TorchPass add-on.
          $ref: '#/components/schemas/TorchpassConfig'
        slurm_web:
          description: Configuration for the Slurm Web add-on.
          $ref: '#/components/schemas/SlurmWebConfig'
        headlamp:
          description: Configuration for the Headlamp Kubernetes dashboard add-on.
          $ref: '#/components/schemas/HeadlampConfig'
      description: Configuration for a cluster add-on.
    AddOnCreateRequest:
      type: object
      required:
        - name
        - add_on_type
      properties:
        name:
          type: string
          description: Human-readable name for this add-on instance.
        add_on_type:
          type: string
          description: 'Type of add-on. Valid values: ''dashboard'', ''ingress'', ''torchpass''.'
        config:
          $ref: '#/components/schemas/AddOnConfig'
    AddOnInfo:
      type: object
      required:
        - name
        - add_on_type
        - config
        - state
      properties:
        name:
          type: string
        add_on_type:
          type: string
        config:
          $ref: '#/components/schemas/AddOnConfig'
        state:
          $ref: '#/components/schemas/AddOnState'
      description: AddOnInfo is returned in cluster responses and add-on CRUD operations.
    AddOnState:
      type: object
      properties:
        dashboard:
          $ref: '#/components/schemas/DashboardState'
        ingress:
          $ref: '#/components/schemas/IngressState'
        torchpass:
          description: State for the Model Aware TorchPass add-on.
          $ref: '#/components/schemas/TorchpassState'
        slurm_web:
          description: State for the Slurm Web add-on.
          $ref: '#/components/schemas/SlurmWebState'
        headlamp:
          description: State for the Headlamp Kubernetes dashboard add-on.
          $ref: '#/components/schemas/HeadlampState'
      description: State for a cluster add-on.
    AddOnUpdateRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the add-on to update. Must match an existing add-on on the cluster.
        config:
          $ref: '#/components/schemas/AddOnConfig'
    CommentBody:
      type: object
      properties:
        comment:
          type: string
          description: Comment explaining the action.
    ApproveRemediationRequest:
      type: object
      description: Request body for approving a pending remediation.
      properties:
        comment:
          type: string
          description: Approval comment explaining the decision.
        mode:
          enum:
            - REMEDIATION_MODE_VM_ONLY
            - REMEDIATION_MODE_HOST_AWARE
            - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT
            - REMEDIATION_MODE_REBOOT_VM
            - REMEDIATION_MODE_HOST_POWER_CYCLE
          type: string
          description: |
            Remediation mode to use after approval. When omitted, the remediation keeps its existing mode.

            - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
            - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
            - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
            - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
            - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Power-cycles the bare-metal host after cordoning it. This mode cannot be set as an approval override; create a host power-cycle remediation directly.
    ClusterAddOnCreateRequest:
      type: object
      required:
        - name
        - add_on_type
      properties:
        name:
          type: string
          description: Human-readable name for this add-on instance.
        add_on_type:
          type: string
          description: 'Type of add-on. Valid values: ''dashboard'', ''ingress'', ''torchpass'', ''headlamp''.'
        config:
          $ref: '#/components/schemas/AddOnConfig'
    ClusterAddOnDeleteResponse:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    ClusterAddOnUpdateRequest:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/AddOnConfig'
    ClusterAddOnsListResponse:
      type: object
      required:
        - add_ons
      properties:
        add_ons:
          type: array
          items:
            $ref: '#/components/schemas/AddOnInfo'
    ClusterIngressConfig:
      type: object
      properties:
        enabled:
          type: boolean
    ClusterPhaseTransition:
      type: object
      required:
        - phase
        - transition_time
      properties:
        phase:
          enum:
            - CLUSTER_PHASE_QUEUED
            - CLUSTER_PHASE_SCHEDULED
            - CLUSTER_PHASE_WAITING_FOR_CONTROL_PLANE_NODES
            - CLUSTER_PHASE_WAITING_FOR_DATA_PLANE_NODES
            - CLUSTER_PHASE_WAITING_FOR_SUBNET
            - CLUSTER_PHASE_WAITING_FOR_SHARED_VOLUME
            - CLUSTER_PHASE_WAITING_FOR_AUTO_SCALER
            - CLUSTER_PHASE_INSTALLING_DRIVERS
            - CLUSTER_PHASE_RUNNING_ACCEPTANCE_TESTS
            - CLUSTER_PHASE_ACCEPTANCE_TESTS_FAILED
            - CLUSTER_PHASE_RUNNING_NCCL_TESTS
            - CLUSTER_PHASE_NCCL_TESTS_FAILED
            - CLUSTER_PHASE_READY
            - CLUSTER_PHASE_PAUSED
            - CLUSTER_PHASE_ON_DEMAND_COMPUTE_PAUSED
            - CLUSTER_PHASE_DEGRADED
            - CLUSTER_PHASE_DELETING
          type: string
          description: Cluster phase.
        transition_time:
          type: string
          description: Timestamp when the phase transition occurred.
          format: date-time
    DashboardConfig:
      type: object
      properties:
        enabled:
          type: boolean
    DashboardState:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    HeadlampConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether to enable the Headlamp Kubernetes dashboard add-on.
      description: Configuration for the Headlamp Kubernetes dashboard cluster add-on.
    HeadlampState:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Runtime state for the Headlamp Kubernetes dashboard cluster add-on.
    GPUClusterDeleteResponse:
      type: object
      required:
        - cluster_id
      properties:
        cluster_id:
          type: string
    IngressConfig:
      type: object
      properties:
        enabled:
          type: boolean
    IngressState:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
    TorchpassConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether to enable the Model Aware TorchPass add-on.
      description: Configuration for the Model Aware TorchPass cluster add-on.
    TorchpassState:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Runtime state for the Model Aware TorchPass cluster add-on.
    SlurmWebConfig:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether to enable the Slurm Web add-on.
      description: Configuration for the Slurm Web cluster add-on.
    SlurmWebState:
      type: object
      properties: {}
      additionalProperties: false
      x-stainless-empty-object: true
      description: Runtime state for the Slurm Web cluster add-on.
    InstanceClusterConfig:
      type: object
      required:
        - load_balancer
      properties:
        load_balancer:
          enum:
            - NONE
            - TRAEFIK
            - NGINX
            - ISTIO
          type: string
        kubernetes_dashboard_enabled:
          type: boolean
        jumphost_enabled:
          type: boolean
        slurm_startup_scripts:
          $ref: '#/components/schemas/SlurmStartupScripts'
        ingress:
          $ref: '#/components/schemas/ClusterIngressConfig'
        observability:
          $ref: '#/components/schemas/ObservabilityConfig'
        gpu_operator_version:
          type: string
          description: NVIDIA GPU Operator chart/version for the tenant cluster (e.g. v24.6.2). When omitted, a service default is applied.
        network_operator_version:
          type: string
          description: NVIDIA Network Operator chart/version for the tenant cluster (e.g. v24.7.0). When omitted, a service default is applied.
        ssh_ca_enabled:
          type: boolean
          description: Whether this cluster uses a per-cluster SSH certificate authority for OIDC-signed SSH access.
    ListRemediationsResponse:
      type: object
      required:
        - remediations
        - next_page_token
        - has_next
      properties:
        remediations:
          type: array
          items:
            $ref: '#/components/schemas/Remediation'
          description: The list of remediations.
        next_page_token:
          type: string
          description: Token for the next page.
        has_next:
          type: boolean
          description: Indicates if there are more results available.
      description: ListRemediationsResponse is the response for ListRemediations.
    NodePhaseTransition:
      type: object
      required:
        - phase
        - transition_time
      properties:
        phase:
          enum:
            - NODE_PHASE_PENDING
            - NODE_PHASE_SCHEDULING
            - NODE_PHASE_BOOTING
            - NODE_PHASE_BOOTSTRAPPING
            - NODE_PHASE_RUNNING
            - NODE_PHASE_SUCCEEDED
            - NODE_PHASE_FAILED
            - NODE_PHASE_PAUSED
          type: string
          description: Node phase.
        transition_time:
          type: string
          description: Timestamp when the phase transition occurred.
          format: date-time
    OIDCConfig:
      type: object
      required:
        - issuer_url
        - client_id
        - username_claim
        - username_prefix
        - group_claim
        - group_prefix
      properties:
        issuer_url:
          type: string
          description: OIDC issuer URL for authentication. For example, https://accounts.google.com
        client_id:
          type: string
          description: OIDC client ID for authentication.
        username_claim:
          type: string
          description: JWT claim to use as the username. For example, 'sub' or 'email'
        username_prefix:
          type: string
          description: Prefix to add to the username claim to form the final username. For example, 'oidc:'
        group_claim:
          type: string
          description: JWT claim to use for user groups. For example, 'groups'
        group_prefix:
          type: string
          description: Prefix to add to the group claim to form the final group name. For example, 'oidc:'
        ca_cert:
          type: string
          description: CA certificate in PEM format to validate the OIDC issuer's TLS certificate. This field is optional but recommended if the issuer uses a private CA or self-signed certificate.
    ObservabilityConfig:
      type: object
      properties:
        enabled:
          type: boolean
    ListPassiveHealthCheckAlertsResponse:
      type: object
      required:
        - alerts
        - next_page_token
      properties:
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/PassiveHealthCheckAlert'
          description: Alerts on the current page, ordered by the request sort order.
        next_page_token:
          type: string
          description: Opaque token for the next page. Empty means there are no more pages.
      description: Response returned when listing passive health check alerts.
    PassiveHealthCheckAlert:
      type: object
      required:
        - passive_health_check_alert_id
        - cluster_id
        - target_vm
        - alert_name
        - severity
        - annotations
        - started_at
      properties:
        passive_health_check_alert_id:
          readOnly: true
          type: string
          description: Primary key UUID for the passive health check alert.
        instance_id:
          readOnly: true
          type: string
          description: Resolved instance UUID. Empty until the alert is joined to an instance.
        cluster_id:
          readOnly: true
          type: string
          description: Cluster UUID the alert was raised against.
        target_vm:
          readOnly: true
          type: string
          description: VM name extracted from the Alertmanager labels.
        alert_name:
          readOnly: true
          type: string
          description: Alertmanager alert name.
        severity:
          readOnly: true
          enum:
            - PHC_SEVERITY_INFO
            - PHC_SEVERITY_WARNING
            - PHC_SEVERITY_CRITICAL
          type: string
          description: Canonical severity tier for the alert.
        annotations:
          readOnly: true
          type: object
          additionalProperties:
            type: string
          description: Alertmanager annotations as key-value strings.
        started_at:
          readOnly: true
          type: string
          description: Time when the underlying alert first fired.
          format: date-time
        resolved_at:
          readOnly: true
          type: string
          description: Time when the underlying alert resolved. Empty while the alert is firing.
          format: date-time
        node_remediation_intent_id:
          readOnly: true
          type: string
          description: Remediation intent UUID attached to this alert, if any.
      description: Passive health check alert returned by the health check API.
    Remediation:
      type: object
      required:
        - id
        - cluster_id
        - instance_id
        - mode
        - trigger
        - state
      properties:
        id:
          readOnly: true
          type: string
        cluster_id:
          readOnly: true
          type: string
        instance_id:
          readOnly: true
          type: string
        mode:
          enum:
            - REMEDIATION_MODE_VM_ONLY
            - REMEDIATION_MODE_HOST_AWARE
            - REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT
            - REMEDIATION_MODE_REBOOT_VM
            - REMEDIATION_MODE_HOST_POWER_CYCLE
          type: string
          description: |
            Remediation mode specifies how the remediation should be performed.

            - `REMEDIATION_MODE_VM_ONLY`: Deletes the VM and provisions a new one on any available host.
            - `REMEDIATION_MODE_HOST_AWARE`: Cordons the host, deletes the VM, and provisions a new one on a different host.
            - `REMEDIATION_MODE_EVICT_WITHOUT_REPLACEMENT`: Evicts the VM without provisioning a replacement.
            - `REMEDIATION_MODE_REBOOT_VM`: Reboots the VM in place.
            - `REMEDIATION_MODE_HOST_POWER_CYCLE`: Cordons and power-cycles the bare-metal host while preserving host and node identity.
        trigger:
          readOnly: true
          enum:
            - REMEDIATION_TRIGGER_MANUAL
            - REMEDIATION_TRIGGER_AUTOMATED
          type: string
          description: |
            RemediationTrigger specifies how the remediation was triggered.

            - `REMEDIATION_TRIGGER_MANUAL`: A user-initiated remediation (either via web UI or API call).
            - `REMEDIATION_TRIGGER_AUTOMATED`: A system-initiated remediation that requires approval.
        state:
          readOnly: true
          enum:
            - PENDING_APPROVAL
            - PENDING
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELLED
            - AUTO_RESOLVED
            - QUARANTINING
            - QUARANTINED
          type: string
          description: |
            RemediationState represents the lifecycle state of a remediation.

            - `PENDING_APPROVAL`: Awaiting approval before processing can begin.
            - `PENDING`: Approved and queued for processing.
            - `RUNNING`: Actively being processed.
            - `SUCCEEDED`: Successfully completed.
            - `FAILED`: Failed with an error.
            - `CANCELLED`: Cancelled by user or system.
            - `AUTO_RESOLVED`: The underlying issue was automatically resolved before processing.
            - `QUARANTINING`: Cordoning or preparing the host before remediation.
            - `QUARANTINED`: Host has been cordoned or isolated for remediation.
        reason:
          type: string
          description: User-provided reason for the remediation.
        active_health_check_run_id:
          type: string
          description: Active health check run ID (UUID) that triggered this remediation.
          readOnly: true
        passive_health_check_event_id:
          type: string
          description: Passive health check event ID that triggered this remediation.
          readOnly: true
        requested_by:
          readOnly: true
          type: string
          description: Who requested the remediation.
        create_time:
          type: string
          description: When the remediation was created.
          format: date-time
          readOnly: true
        reviewed_by:
          type: string
          description: Who reviewed the remediation.
          readOnly: true
        review_time:
          type: string
          format: date-time
          description: When the remediation was reviewed.
          readOnly: true
        review_comment:
          readOnly: true
          type: string
          description: Review comment.
        start_time:
          type: string
          format: date-time
          description: When processing started.
          readOnly: true
        end_time:
          readOnly: true
          type: string
          description: When the remediation completed.
          format: date-time
        error_message:
          readOnly: true
          type: string
          description: Error message if the remediation failed.
        update_time:
          readOnly: true
          type: string
          description: When the remediation was last updated.
          format: date-time
        instance_name:
          readOnly: true
          type: string
          description: Display name of the targeted instance.
        linked_alerts:
          readOnly: true
          type: array
          items:
            $ref: '#/components/schemas/PassiveHealthCheckAlert'
          description: Passive health check alerts linked to this remediation, including resolved alerts.
      description: |-
        Remediation represents a node remediation request for an instance.
        An instance can have multiple remediations over time (e.g., failed attempts followed by retries).
    GPUClustersSharedVolumeCreateRequest:
      type: object
      required:
        - volume_name
        - size_tib
        - region
      properties:
        volume_name:
          type: string
          description: User provided name of the volume.
        size_tib:
          type: integer
          description: Volume size in whole tebibytes (TiB).
        region:
          type: string
          description: Region name. Usable regions can be found from `clusters.list_regions()`
        is_lifecycle_independent:
          type: boolean
          description: When true, the shared volume is not deleted when the cluster is decommissioned.
        project_id:
          type: string
          description: Project ID that will own the volume. When omitted, the caller's default project is used.
    GPUClustersSharedVolumeDeleteResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
    GPUClustersSharedVolume:
      type: object
      required:
        - volume_id
        - volume_name
        - size_tib
        - status
      properties:
        volume_id:
          description: ID of the volume.
          type: string
        volume_name:
          type: string
          description: User provided name of the volume.
        size_tib:
          type: integer
          description: Size of the volume in TiB.
        status:
          enum:
            - scheduled
            - available
            - bound
            - provisioning
            - deleting
            - failed
            - access_revoked
            - unknown
          type: string
          description: Current status of the shared volume.
    GPUClustersSharedVolumeUpdateRequest:
      type: object
      required:
        - volume_id
      properties:
        volume_id:
          type: string
          description: ID of the volume.
        size_tib:
          type: integer
          description: Size of the volume in TiB.
    GPUClustersSharedVolumes:
      type: object
      required:
        - volumes
      properties:
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/GPUClustersSharedVolume'
    SlurmStartupScripts:
      type: object
      properties:
        worker_prolog:
          type: string
          description: Slurm worker node prolog script.
        worker_epilog:
          type: string
          description: Slurm worker node epilog script.
        controller_prolog:
          type: string
          description: Slurm controller prolog script.
        controller_epilog:
          type: string
          description: Slurm controller epilog script.
        login_init_script:
          type: string
          description: Script run on Slurm login node init.
        nodeset_init_script:
          type: string
          description: Script run on Slurm nodeset init.
        extra_slurm_conf:
          type: string
          description: Additional slurm.conf fragments.
      description: SlurmStartupScripts carries optional Slurm lifecycle scripts (prolog/epilog, init, extra conf).
    ListVoicesResponse:
      description: Response containing a list of models and their available voices.
      type: object
      required: ['data']
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/ModelVoices'

    ModelVoices:
      description: Represents a model with its available voices.
      type: object
      required: ['model', 'voices']
      properties:
        model:
          description: Model name.
          type: string

        voices:
          description: List of available voices for the model.
          type: array
          items:
            type: object
            required: ['id', 'name']
            properties:
              id:
                type: string
              name:
                description: Voice name to be used for audio inference.
                type: string

    ListAvailibilityZonesResponse:
      description: List of unique availability zones
      type: object
      required: ['avzones']
      properties:
        avzones:
          type: array
          items:
            type: string

    RerankRequest:
      type: object
      properties:
        model:
          type: string
          description: >
            The model to be used for the rerank request.<br> <br> [See all of Together AI's rerank models](https://docs.together.ai/docs/serverless-models#rerank-models)
          example: Salesforce/Llama-Rank-V1
          anyOf:
            - type: string
              enum:
                - Salesforce/Llama-Rank-v1
            - type: string

        query:
          type: string
          description: The search query to be used for ranking.
          example: What animals can I find near Peru?
        documents:
          description: List of documents, which can be either strings or objects.
          oneOf:
            - type: array
              items:
                type: object
                additionalProperties: true
            - type: array
              items:
                type: string
                example: Our solar system orbits the Milky Way galaxy at about 515,000 mph
          example:
            - {'title': 'Llama', 'text': 'The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era.'}
            - {'title': 'Panda', 'text': 'The giant panda (Ailuropoda melanoleuca), also known as the panda bear or simply panda, is a bear species endemic to China.'}
            - {'title': 'Guanaco', 'text': 'The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations.'}
            - {'title': 'Wild Bactrian camel', 'text': 'The wild Bactrian camel (Camelus ferus) is an endangered species of camel endemic to Northwest China and southwestern Mongolia.'}
        top_n:
          type: integer
          description: The number of top results to return.
          example: 2
        return_documents:
          type: boolean
          description: Whether to return supplied documents with the response.
          example: true
        rank_fields:
          type: array
          items:
            type: string
          description: List of keys in the JSON Object document to rank by. Defaults to use all supplied keys for ranking.
          example: ['title', 'text']
      required:
        - model
        - query
        - documents
      additionalProperties: false

    RerankResponse:
      type: object
      required:
        - object
        - model
        - results
      properties:
        object:
          description: The object type, which is always `rerank`.
          const: rerank
        id:
          type: string
          description: Request ID
          example: 9dfa1a09-5ebc-4a40-970f-586cb8f4ae47
        model:
          type: string
          description: The model to be used for the rerank request.
          example: salesforce/turboranker-0.8-3778-6328
        results:
          type: array
          items:
            type: object
            required: [index, relevance_score, document]
            properties:
              index:
                type: integer
              relevance_score:
                type: number
              document:
                type: object
                properties:
                  text:
                    type: string
                    nullable: true
          example:
            - {'index': 0, 'relevance_score': 0.29980177813003117, 'document': {'text': '{"title":"Llama","text":"The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."}'}}
            - {'index': 2, 'relevance_score': 0.2752447527354349, 'document': {'text': '{"title":"Guanaco","text":"The guanaco is a camelid native to South America, closely related to the llama. Guanacos are one of two wild South American camelids; the other species is the vicuña, which lives at higher elevations."}'}}
        usage:
          $ref: '#/components/schemas/UsageData'
          example: {'prompt_tokens': 1837, 'completion_tokens': 0, 'total_tokens': 1837}

    ErrorData:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              nullable: false
            type:
              type: string
              nullable: false
            param:
              type: string
              nullable: true
              default: null
            code:
              type: string
              nullable: true
              default: null
          required:
            - type
            - message

    FinishReason:
      type: string
      enum:
        - stop
        - eos
        - length
        - tool_calls
        - function_call

    TopLogprobs:
      description: Top log probabilities for the tokens.
      type: object
      additionalProperties:
        type: number

    LogprobsPart:
      type: object
      properties:
        token_ids:
          type: array
          items:
            type: number
          description: List of token IDs corresponding to the logprobs
        tokens:
          type: array
          items:
            type: string
          description: List of token strings
        token_logprobs:
          type: array
          items:
            type: number
          description: List of token log probabilities
        top_logprobs:
          $ref: '#/components/schemas/TopLogprobs'

    PromptPart:
      type: array
      items:
        type: object
        properties:
          text:
            type: string
            example: <s>[INST] What is the capital of France? [/INST]
          logprobs:
            $ref: '#/components/schemas/LogprobsPart'

    InferenceWarning:
      type: object
      required:
        - message
      properties:
        message:
          type: string

    UsageData:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      nullable: true

    CompletionChoicesData:
      type: array
      items:
        type: object
        properties:
          text:
            type: string
            example: The capital of France is Paris. It's located in the north-central part of the country and is one of the most populous and visited cities in the world, known for its iconic landmarks like the Eiffel Tower, Louvre Museum, Notre-Dame Cathedral, and more. Paris is also the capital of the Île-de-France region and is a major global center for art, fashion, gastronomy, and culture.
          seed:
            type: integer
          finish_reason:
            $ref: '#/components/schemas/FinishReason'
          logprobs:
            $ref: '#/components/schemas/LogprobsPart'

    CompletionRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        prompt:
          type: string
          description: A string providing context for the model to complete.
          example: <s>[INST] What is the capital of France? [/INST]
        model:
          type: string
          description: >
            The name of the model to query.<br> <br> [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
          example: mistralai/Mixtral-8x7B-Instruct-v0.1
          anyOf:
            - type: string
              enum:
                - meta-llama/Llama-2-70b-hf
                - mistralai/Mistral-7B-v0.1
                - mistralai/Mixtral-8x7B-v0.1
                - Meta-Llama/Llama-Guard-7b
            - type: string
        max_tokens:
          type: integer
          description: The maximum number of tokens to generate.
        stop:
          type: array
          description: A list of string sequences that truncate (stop) inference text output. For example, "</s>" stops generation as soon as the model generates the given token.
          items:
            type: string
        temperature:
          type: number
          description: A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output.
        top_p:
          type: number
          description: A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text.
        top_k:
          type: integer
          description: An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options.
        repetition_penalty:
          type: number
          description: A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition.
        stream:
          type: boolean
          description: 'If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. The stream terminates with `data: [DONE]`. If false, return a single JSON object containing the results.'
        logprobs:
          type: integer
          minimum: 0
          maximum: 20
          description: An integer between 0 and 20 of the top k tokens to return log probabilities for at each generation step, instead of only the sampled token. Log probabilities help assess model confidence in token predictions.
        echo:
          type: boolean
          description: If true, the response contains the prompt. Can be used with `logprobs` to return prompt logprobs.
        n:
          type: integer
          description: The number of completions to generate for each prompt.
          minimum: 1
          maximum: 128
        safety_model:
          type: string
          description: The name of the moderation model used to validate tokens. Choose from the available moderation models found [here](https://docs.together.ai/docs/inference-models#moderation-models).
          example: 'safety_model_name'
          anyOf:
            - type: string
              enum:
                - Meta-Llama/Llama-Guard-7b
            - type: string
        min_p:
          type: number
          description: A number between 0 and 1 that can be used as an alternative to top-p and top-k.
        presence_penalty:
          type: number
          description: A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics.
        frequency_penalty:
          type: number
          description: A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned.
        logit_bias:
          type: object
          additionalProperties:
            type: number
          description: Adjusts the likelihood of specific tokens appearing in the generated output.
          example: {'1024': -10.5, '105': 21.4}
        seed:
          type: integer
          description: Seed value for reproducibility.
          example: 42
    CompletionResponse:
      type: object
      properties:
        id:
          type: string
        choices:
          $ref: '#/components/schemas/CompletionChoicesData'
        prompt:
          description: When `echo` is true, the prompt is included in the response. Additionally, when `logprobs` is also provided, log probability information is provided on the prompt.
          $ref: '#/components/schemas/PromptPart'
        usage:
          $ref: '#/components/schemas/UsageData'
        created:
          type: integer
        model:
          type: string
        object:
          description: The object type, which is always `text.completion`.
          const: text.completion
      required:
        - id
        - choices
        - usage
        - created
        - prompt
        - model
        - object

    CompletionStream:
      oneOf:
        - $ref: '#/components/schemas/CompletionEvent'
        - $ref: '#/components/schemas/StreamSentinel'

    CompletionEvent:
      type: object
      required: [data]
      properties:
        data:
          $ref: '#/components/schemas/CompletionChunk'

    CompletionChunk:
      type: object
      required: [id, token, choices, usage, finish_reason]
      properties:
        id:
          type: string
        token:
          $ref: '#/components/schemas/CompletionToken'
        created:
          type: integer
        object:
          description: The object type, which is always `completion.chunk`.
          const: completion.chunk
        choices:
          title: CompletionChoices
          type: array
          items:
            $ref: '#/components/schemas/CompletionChoice'
        usage:
          allOf:
            - $ref: '#/components/schemas/UsageData'
            - nullable: true
        seed:
          type: integer
        finish_reason:
          allOf:
            - $ref: '#/components/schemas/FinishReason'
            - nullable: true

    CompletionChoice:
      type: object
      required: [index]
      properties:
        text:
          type: string
        index:
          type: integer
        delta:
          title: CompletionChoiceDelta
          type: object
          required: [role]
          properties:
            token_id:
              type: integer
            role:
              type: string
              enum: ['system', 'user', 'assistant', 'function', 'tool']
            content:
              type: string
              nullable: true
            reasoning:
              type: string
              nullable: true
            reasoning_content:
              type: string
              nullable: true
            tool_calls:
              type: array
              items:
                $ref: '#/components/schemas/ToolChoice'
            function_call:
              type: object
              deprecated: true
              nullable: true
              properties:
                arguments:
                  type: string
                name:
                  type: string
              required:
                - arguments
                - name

    CompletionToken:
      type: object
      required: [id, text, logprob, special]
      properties:
        id:
          type: integer
        text:
          type: string
        logprob:
          type: number
        special:
          type: boolean

    ChatCompletionChoicesData:
      type: array
      items:
        type: object
        properties:
          text:
            type: string
          index:
            type: integer
          seed:
            type: integer
          finish_reason:
            $ref: '#/components/schemas/FinishReason'
          message:
            $ref: '#/components/schemas/ChatCompletionMessage'
          logprobs:
            allOf:
              - nullable: true
              - $ref: '#/components/schemas/LogprobsPart'
          top_logprobs:
            $ref: '#/components/schemas/TopLogprobs'
    ChatCompletionMessage:
      type: object
      required: [role, content]
      properties:
        content:
          type: string
          nullable: true
        role:
          type: string
          enum: [assistant]
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolChoice'
        function_call:
          type: object
          deprecated: true
          required: [arguments, name]
          properties:
            arguments:
              type: string
            name:
              type: string
        reasoning:
          type: string
          nullable: true
        reasoning_content:
          type: string
          nullable: true
    ChatCompletionTool:
      type: object
      required: [type, function]
      properties:
        type:
          type: string
          enum: ['function']
        function:
          type: object
          required: [name]
          properties:
            description:
              type: string
            name:
              type: string
            parameters:
              type: object
              additionalProperties: true

    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        messages:
          type: array
          description: A list of messages comprising the conversation so far.
          items:
            $ref: '#/components/schemas/ChatCompletionMessageParam'
        model:
          type: string
          description: >
            The name of the model to query.<br> <br> [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#chat-models)
        max_tokens:
          type: integer
          description: The maximum number of tokens to generate.
        stop:
          type: array
          description: A list of string sequences that truncate (stop) inference text output. For example, "</s>" stops generation as soon as the model generates the given token.
          items:
            type: string
        temperature:
          type: number
          description: A decimal number from 0-1 that determines the degree of randomness in the response. A temperature less than 1 favors more correctness and is appropriate for question answering or summarization. A value closer to 1 introduces more randomness in the output.
        top_p:
          type: number
          description: A percentage (also called the nucleus parameter) that's used to dynamically adjust the number of choices for each predicted token based on the cumulative probabilities. It specifies a probability threshold below which all less likely tokens are filtered out. This technique helps maintain diversity and generate more fluent and natural-sounding text.
        top_k:
          type: integer
          description: An integer that's used to limit the number of choices for the next predicted word or token. It specifies the maximum number of tokens to consider at each step, based on their probability of occurrence. This technique helps to speed up the generation process and can improve the quality of the generated text by focusing on the most likely options.
        context_length_exceeded_behavior:
          type: string
          enum: ['truncate', 'error']
          default: 'error'
          description: Defines the behavior of the API when max_tokens exceed the maximum context length of the model. When set to 'error', the API returns 400 with an appropriate error message. When set to 'truncate', overrides max_tokens with the maximum context length of the model.
        repetition_penalty:
          type: number
          description: A number that controls the diversity of generated text by reducing the likelihood of repeated sequences. Higher values decrease repetition.
        stream:
          type: boolean
          description: 'If true, stream tokens as Server-Sent Events as the model generates them instead of waiting for the full model response. The stream terminates with `data: [DONE]`. If false, return a single JSON object containing the results.'
        logprobs:
          type: integer
          minimum: 0
          maximum: 20
          description: An integer between 0 and 20 of the top k tokens to return log probabilities for at each generation step, instead of only the sampled token. Log probabilities help assess model confidence in token predictions.
        echo:
          type: boolean
          description: If true, the response contains the prompt. Can be used with `logprobs` to return prompt logprobs.
        n:
          type: integer
          description: The number of completions to generate for each prompt.
          minimum: 1
          maximum: 128
        min_p:
          type: number
          description: A number between 0 and 1 that can be used as an alternative to top_p and top-k.
        presence_penalty:
          type: number
          description: A number between -2.0 and 2.0 where a positive value increases the likelihood of a model talking about new topics.
        frequency_penalty:
          type: number
          description: A number between -2.0 and 2.0 where a positive value decreases the likelihood of repeating tokens that have already been mentioned.
        logit_bias:
          type: object
          additionalProperties:
            type: number
          description: Adjusts the likelihood of specific tokens appearing in the generated output.
          example: {'1024': -10.5, '105': 21.4}
        seed:
          type: integer
          description: Seed value for reproducibility.
          example: 42
        function_call:
          oneOf:
            - type: string
              enum: [none, auto]
            - type: object
              required: [name]
              properties:
                name:
                  type: string
        response_format:
          description: |
            An object specifying the format that the model must output.

            Setting to `{ "type": "json_schema", "json_schema": {...} }` enables
            Structured Outputs which ensures the model will match your supplied JSON
            schema. Learn more in the [Structured Outputs
            guide](https://docs.together.ai/docs/json-mode).

            Setting to `{ "type": "json_object" }` enables the older JSON mode, which
            ensures the message the model generates is valid JSON. Using `json_schema`
            is preferred for models that support it.
          discriminator:
            propertyName: type
          anyOf:
            - $ref: '#/components/schemas/ResponseFormatText'
            - $ref: '#/components/schemas/ResponseFormatJsonSchema'
            - $ref: '#/components/schemas/ResponseFormatJsonObject'
        tools:
          type: array
          description: A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
          items:
            $ref: '#/components/schemas/ToolsPart'
        tool_choice:
          description: Controls which (if any) function is called by the model. By default uses `auto`, which lets the model pick between generating a message or calling a function.
          oneOf:
            - type: string
              example: 'tool_name'
            - $ref: '#/components/schemas/ToolChoice'
        compliance:
          const: hipaa
        chat_template_kwargs:
          description: Additional configuration to pass to model engine.
          type: object
          additional_properties: true
        safety_model:
          type: string
          description: The name of the moderation model used to validate tokens. Choose from the available moderation models found [here](https://docs.together.ai/docs/inference-models#moderation-models).
          example: 'safety_model_name'
        reasoning_effort:
          type: string
          enum: ['low', 'medium', 'high']
          description: Controls the level of reasoning effort the model should apply when generating responses. Higher values may result in more thoughtful and detailed responses but may take longer to generate.
          example: 'medium'
        reasoning:
          description: For models that support toggling reasoning functionality, this object can be used to control that functionality.
          type: object
          properties:
            enabled:
              type: boolean

    ResponseFormatText:
      type: object
      title: Text
      description: |
        Default response format. Used to generate text responses.
      properties:
        type:
          type: string
          description: The type of response format being defined. Always `text`.
          enum:
            - text
          x-stainless-const: true
      required:
        - type
    ResponseFormatJsonObject:
      type: object
      title: JSON object
      description: |
        JSON object response format. An older method of generating JSON responses.
        Using `json_schema` is recommended for models that support it. Note that the
        model will not generate JSON without a system or user message instructing it
        to do so.
      properties:
        type:
          type: string
          description: The type of response format being defined. Always `json_object`.
          enum:
            - json_object
          x-stainless-const: true
      required:
        - type
    ResponseFormatJsonSchema:
      type: object
      title: JSON schema
      description: |
        JSON Schema response format. Used to generate structured JSON responses.
        Learn more about [Structured Outputs](https://docs.together.ai/docs/json-mode).
      properties:
        type:
          type: string
          description: The type of response format being defined. Always `json_schema`.
          enum:
            - json_schema
          x-stainless-const: true
        json_schema:
          type: object
          title: JSON schema
          description: |
            Structured Outputs configuration options, including a JSON Schema.
          properties:
            description:
              type: string
              description: |
                A description of what the response format is for, used by the model to
                determine how to respond in the format.
            name:
              type: string
              description: |
                The name of the response format. Must be a-z, A-Z, 0-9, or contain
                underscores and dashes, with a maximum length of 64.
            schema:
              $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema'
            strict:
              anyOf:
                - type: boolean
                  default: false
                  description: |
                    Whether to enable strict schema adherence when generating the output.
                    If set to true, the model will always follow the exact schema defined
                    in the `schema` field. Only a subset of JSON Schema is supported when
                    `strict` is `true`. To learn more, read the [Structured Outputs
                    guide](https://docs.together.ai/docs/json-mode).
                - type: 'null'
          required:
            - name
      required:
        - type
        - json_schema
    ResponseFormatJsonSchemaSchema:
      type: object
      title: JSON schema
      description: |
        The schema for the response format, described as a JSON Schema object.
        Learn how to build JSON schemas [here](https://json-schema.org/).
      additionalProperties: true

    ChatCompletionMessageParam:
      oneOf:
        - $ref: '#/components/schemas/ChatCompletionSystemMessageParam'
        - $ref: '#/components/schemas/ChatCompletionUserMessageParam'
        - $ref: '#/components/schemas/ChatCompletionAssistantMessageParam'
        - $ref: '#/components/schemas/ChatCompletionToolMessageParam'
        - $ref: '#/components/schemas/ChatCompletionFunctionMessageParam'

    # Start Message Params

    ChatCompletionSystemMessageParam:
      type: object
      required: [content, role]
      properties:
        content:
          type: string
        role:
          type: string
          enum: ['system']
        name:
          type: string

    ChatCompletionUserMessageParam:
      type: object
      required: [content, role]
      properties:
        content:
          $ref: '#/components/schemas/ChatCompletionUserMessageContent'
        role:
          type: string
          enum: ['user']
        name:
          type: string

    ChatCompletionUserMessageContentString:
      type: string
      description: A plain text message.

    ChatCompletionUserMessageContentMultimodal:
      type: array
      description: A structured message with mixed content types.
      items:
        type: object
        oneOf:
          - type: object
            properties:
              type:
                type: string
                enum:
                  - text
              text:
                type: string
            required:
              - type
              - text
          - type: object
            properties:
              type:
                type: string
                enum:
                  - image_url
              image_url:
                type: object
                properties:
                  url:
                    type: string
                    description: The URL of the image
                required:
                  - url
          - type: object
            title: Video
            properties:
              type:
                type: string
                enum:
                  - video_url
              video_url:
                type: object
                properties:
                  url:
                    type: string
                    description: The URL of the video
                required:
                  - url
            required:
              - type
              - video_url
          - type: object
            title: Audio
            properties:
              type:
                type: string
                enum:
                  - audio_url
              audio_url:
                type: object
                properties:
                  url:
                    type: string
                    description: The URL of the audio
                required:
                  - url
            required:
              - type
              - audio_url
          - type: object
            title: Input Audio
            properties:
              type:
                type: string
                enum:
                  - input_audio
              input_audio:
                type: object
                properties:
                  data:
                    type: string
                    description: The base64 encoded audio data
                  format:
                    type: string
                    description: The format of the audio data
                    enum:
                      - wav
                required:
                  - data
                  - format
            required:
              - type
              - input_audio

    ChatCompletionUserMessageContent:
      description: The content of the message, which can either be a simple string or a structured format.
      oneOf:
        - $ref: '#/components/schemas/ChatCompletionUserMessageContentString'
        - $ref: '#/components/schemas/ChatCompletionUserMessageContentMultimodal'

    ChatCompletionAssistantMessageParam:
      type: object
      required: [role]
      properties:
        content:
          type: string
          nullable: true
        role:
          type: string
          enum: ['assistant']
        name:
          type: string
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolChoice'
        function_call:
          type: object
          deprecated: true
          properties:
            arguments:
              type: string
            name:
              type: string
          required: [arguments, name]
        reasoning:
          type: string
          nullable: true
        reasoning_content:
          type: string
          nullable: true

    ChatCompletionFunctionMessageParam:
      type: object
      deprecated: true
      required: [content, role, name]
      properties:
        role:
          type: string
          enum: ['function']
        content:
          type: string
        name:
          type: string

    ChatCompletionToolMessageParam:
      type: object
      properties:
        name:
          type: string
        role:
          type: string
          enum: ['tool']
        content:
          type: string
        tool_call_id:
          type: string
      required: [role, content, tool_call_id]

    # End Message Params

    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        choices:
          $ref: '#/components/schemas/ChatCompletionChoicesData'
        usage:
          $ref: '#/components/schemas/UsageData'
        created:
          type: integer
        model:
          type: string
        prompt:
          description: When `echo` is true, the prompt is included in the response. Additionally, when `logprobs` is also provided, log probability information is provided on the prompt.
          $ref: '#/components/schemas/PromptPart'
        object:
          description: The object type, which is always `chat.completion`.
          const: chat.completion
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/InferenceWarning'
      required: [choices, id, created, model, object, prompt]

    ChatCompletionStream:
      oneOf:
        - $ref: '#/components/schemas/ChatCompletionEvent'
        - $ref: '#/components/schemas/StreamSentinel'

    ChatCompletionEvent:
      type: object
      required: [data]
      properties:
        data:
          $ref: '#/components/schemas/ChatCompletionChunk'

    ChatCompletionChunk:
      type: object
      required: [id, object, created, choices, model]
      properties:
        id:
          type: string
        object:
          description: The object type, which is always `chat.completion.chunk`.
          const: chat.completion.chunk
        created:
          type: integer
        system_fingerprint:
          type: string
        model:
          type: string
          example: mistralai/Mixtral-8x7B-Instruct-v0.1
        choices:
          title: ChatCompletionChoices
          type: array
          items:
            type: object
            required: [index, delta, finish_reason]
            properties:
              index:
                type: integer
              finish_reason:
                $ref: '#/components/schemas/FinishReason'
                nullable: true
              logprobs:
                type: number
                nullable: true
              top_logprobs:
                $ref: '#/components/schemas/TopLogprobs'
              seed:
                type: integer
                nullable: true
              delta:
                title: ChatCompletionChoiceDelta
                type: object
                required: [role]
                properties:
                  token_id:
                    type: integer
                  role:
                    type: string
                    enum: ['system', 'user', 'assistant', 'function', 'tool']
                  content:
                    type: string
                    nullable: true
                  reasoning:
                    type: string
                    nullable: true
                  reasoning_content:
                    type: string
                    nullable: true
                  tool_calls:
                    type: array
                    items:
                      $ref: '#/components/schemas/ToolChoice'
                  function_call:
                    type: object
                    deprecated: true
                    nullable: true
                    properties:
                      arguments:
                        type: string
                      name:
                        type: string
                    required:
                      - arguments
                      - name
        usage:
          allOf:
            - $ref: '#/components/schemas/UsageData'
            - nullable: true
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/InferenceWarning'
    AudioSpeechRequest:
      type: object
      required:
        - model
        - input
        - voice
      properties:
        model:
          description: >
            The name of the model to query.<br> <br> [See all of Together AI's chat models](https://docs.together.ai/docs/serverless-models#audio-models) The current supported tts models are: - cartesia/sonic - hexgrad/Kokoro-82M - canopylabs/orpheus-3b-0.1-ft
          example: canopylabs/orpheus-3b-0.1-ft
          anyOf:
            - type: string
              enum:
                - cartesia/sonic
                - hexgrad/Kokoro-82M
                - canopylabs/orpheus-3b-0.1-ft
            - type: string
        input:
          type: string
          description: Input text to generate the audio for
        voice:
          description: >
            The voice to use for generating the audio. The voices supported are different for each model. For eg - for canopylabs/orpheus-3b-0.1-ft, one of the voices supported is tara, for hexgrad/Kokoro-82M, one of the voices supported is af_alloy and for cartesia/sonic, one of the voices supported is "friendly sidekick". <br> <br> You can view the voices supported for each model using the /v1/voices endpoint sending the model name as the query parameter. [View all supported voices here](https://docs.together.ai/docs/text-to-speech#supported-voices). <br> <br> `hexgrad/Kokoro-82M` additionally supports voice mixing, where two or more voices are combined into a single blended voice by joining their names with `+` (e.g. `af_bella+af_heart`). Optional per-voice weights can be provided in parentheses (e.g. `af_bella(2)+af_heart(1)`). Other models require a single voice name.
          type: string
        response_format:
          type: string
          description: The format of audio output. Supported formats are mp3, wav, raw if streaming is false. If streaming is true, the only supported format is raw.
          default: wav
          enum:
            - mp3
            - wav
            - raw
        language:
          type: string
          description: |
            Language or locale of input text. Accepts ISO 639-1 language codes (e.g., `en`, `fr`, `es`, `zh`) as well as locale codes for region-specific variants. Locale codes must be lowercase (e.g., `zh-hk` for Cantonese).
          default: en
          example: en
        response_encoding:
          type: string
          description: Audio encoding of response. Only applicable when response_format is raw or pcm. Cartesia models respect this parameter and support all values. Orpheus, Kokoro, and Minimax models always return pcm_s16le regardless of this setting.
          default: pcm_f32le
          enum:
            - pcm_f32le
            - pcm_s16le
            - pcm_mulaw
            - pcm_alaw
        sample_rate:
          type: integer
          default: 44100
          description: Sampling rate in Hz for the output audio. Cartesia and Minimax models respect this parameter. Orpheus and Kokoro models always output at 24000 Hz regardless of this setting.
        bit_rate:
          type: integer
          description: Bitrate of the MP3 audio output in bits per second. Only applicable when response_format is mp3. Higher values produce better audio quality at larger file sizes. Default is 128000. Currently supported on Cartesia models.
          default: 128000
          enum:
            - 32000
            - 64000
            - 96000
            - 128000
            - 192000
        stream:
          type: boolean
          default: false
          description: 'If true, output is streamed for several characters at a time instead of waiting for the full response. The stream terminates with `data: [DONE]`. If false, return the encoded audio as octet stream'
        extra_params:
          type: object
          description: Additional model-specific parameters that fine-tune speech generation behavior.
          properties:
            pronunciation_dict:
              type: array
              items:
                type: string
              description: A list of pronunciation rules for specific characters or symbols. Each entry uses the format `"<source>/<replacement>"` (e.g., `["omg/oh my god"]`) to override how the model pronounces matching tokens.
              example: ["omg/oh my god"]

    AudioTranscriptionRequest:
      type: object
      required:
        - file
      properties:
        file:
          oneOf:
            - $ref: '#/components/schemas/AudioFileBinary'
            - $ref: '#/components/schemas/AudioFileUrl'
          description: >-
            Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 80 MB (HTTP 413); URL-fetched audio is capped at 1 GB.
        model:
          type: string
          description: Model to use for transcription
          default: openai/whisper-large-v3
          enum:
            - openai/whisper-large-v3
        language:
          type: string
          description: Optional ISO 639-1 language code. If `auto` is provided, language is auto-detected.
          default: en
          example: en
        prompt:
          type: string
          description: >-
            Optional text to bias decoding. Supported only on Whisper-family models (e.g. `openai/whisper-large-v3`). Other STT models (e.g. `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore it.
        response_format:
          type: string
          description: The format of the response
          default: json
          enum:
            - json
            - verbose_json
        temperature:
          type: number
          description: Sampling temperature between 0.0 and 1.0
          default: 0.0
          minimum: 0.0
          maximum: 1.0
        timestamp_granularities:
          oneOf:
            - type: string
              enum:
                - segment
                - word
            - type: array
              items:
                type: string
                enum:
                  - segment
                  - word
              uniqueItems: true
              minItems: 1
              maxItems: 2
          description: Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
          default: segment
          example: ['word', 'segment']
        diarize:
          type: boolean
          description: >
            Whether to enable speaker diarization. When enabled, you will get the speaker id for each word in the transcription. In the response, in the words array, you will get the speaker id for each word. In addition, we also return the speaker_segments array which contains the speaker id for each speaker segment along with the start and end time of the segment along with all the words in the segment. <br> <br> For eg - ... "speaker_segments": [
              "speaker_id": "SPEAKER_00",
              "start": 0,
              "end": 30.02,
              "words": [
                {
                  "id": 0,
                  "word": "Tijana",
                  "start": 0,
                  "end": 11.475,
                  "speaker_id": "SPEAKER_00"
                },
                ...
          default: false
        min_speakers:
          type: integer
          description: Minimum number of speakers expected in the audio. Used to improve diarization accuracy when the approximate number of speakers is known.
        max_speakers:
          type: integer
          description: Maximum number of speakers expected in the audio. Used to improve diarization accuracy when the approximate number of speakers is known.

    AudioTranscriptionResponse:
      oneOf:
        - $ref: '#/components/schemas/AudioTranscriptionJsonResponse'
        - $ref: '#/components/schemas/AudioTranscriptionVerboseJsonResponse'

    AudioTranscriptionJsonResponse:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          description: The transcribed text
          example: Hello, world!

    AudioTranscriptionVerboseJsonResponse:
      type: object
      required:
        - language
        - duration
        - text
        - segments
      properties:
        language:
          type: string
          description: The language of the audio
          example: english
        duration:
          type: number
          description: The duration of the audio in seconds
          example: 3.5
        text:
          type: string
          description: The transcribed text
          example: Hello, world!
        segments:
          type: array
          items:
            $ref: '#/components/schemas/AudioTranscriptionSegment'
          description: Array of transcription segments
        words:
          type: array
          items:
            $ref: '#/components/schemas/AudioTranscriptionWord'
          description: Array of transcription words (only when timestamp_granularities includes 'word')
        speaker_segments:
          type: array
          items:
            $ref: '#/components/schemas/AudioTranscriptionSpeakerSegment'
          description: Array of transcription speaker segments (only when diarize is enabled)

    AudioTranscriptionSegment:
      type: object
      required:
        - id
        - start
        - end
        - text
      properties:
        id:
          type: integer
          description: Unique identifier for the segment
          example: 0
        start:
          type: number
          description: Start time of the segment in seconds
          example: 0.0
        end:
          type: number
          description: End time of the segment in seconds
          example: 3.5
        text:
          type: string
          description: The text content of the segment
          example: Hello, world!

    AudioTranscriptionWord:
      type: object
      required:
        - word
        - start
        - end
      properties:
        word:
          type: string
          description: The word
          example: Hello
        start:
          type: number
          description: Start time of the word in seconds
          example: 0.0
        end:
          type: number
          description: End time of the word in seconds
          example: 0.5
        speaker_id:
          type: string
          description: The speaker id for the word (only when diarize is enabled)
          example: SPEAKER_00

    AudioTranscriptionSpeakerSegment:
      type: object
      required:
        - speaker_id
        - start
        - end
        - words
        - text
        - id
      properties:
        speaker_id:
          type: string
          description: The speaker identifier
          example: SPEAKER_00
        start:
          type: number
          description: Start time of the speaker segment in seconds
          example: 0.0
        end:
          type: number
          description: End time of the speaker segment in seconds
          example: 30.02
        words:
          type: array
          items:
            $ref: '#/components/schemas/AudioTranscriptionWord'
          description: Array of words spoken by this speaker in this segment
        text:
          type: string
          description: The full text spoken by this speaker in this segment
          example: "Hello, how are you doing today?"
        id:
          type: integer
          description: Unique identifier for the speaker segment
          example: 1

    AudioTranslationRequest:
      type: object
      required:
        - file
      properties:
        file:
          oneOf:
            - type: string
              format: binary
              description: >-
                Audio file uploaded as binary. Maximum upload size 80 MB (requests above this are rejected with HTTP 413). For larger payloads, host the file and submit a URL instead.
            - type: string
              format: uri
              description: >-
                Public HTTPS URL the server fetches the audio from. Server-side fetch limit is 1 GB; downloads exceeding the cap fail with `file_too_large`.
          description: >-
            Audio file upload or public HTTP/HTTPS URL. Supported formats: .wav, .mp3, .m4a, .webm, .flac, .ogg, .opus, .aac. Maximum duration 4 hours; longer audio is rejected with `audio_too_long`. Binary uploads are additionally capped at 80 MB (HTTP 413); URL-fetched audio is capped at 1 GB.
        model:
          type: string
          description: Model to use for translation
          default: openai/whisper-large-v3
          enum:
            - openai/whisper-large-v3
        language:
          type: string
          description: Target output language. Optional ISO 639-1 language code. If omitted, language is set to English.
          default: en
          example: en
        prompt:
          type: string
          description: >-
            Optional text to bias decoding. Supported only on Whisper-family models (e.g. `openai/whisper-large-v3`). Other STT models (e.g. `nvidia/parakeet-tdt-0.6b-v3`) accept the field for API compatibility but ignore it.
        response_format:
          type: string
          description: The format of the response
          default: json
          enum:
            - json
            - verbose_json
        temperature:
          type: number
          description: Sampling temperature between 0.0 and 1.0
          default: 0.0
          minimum: 0.0
          maximum: 1.0
        timestamp_granularities:
          oneOf:
            - type: string
              enum:
                - segment
                - word
            - type: array
              items:
                type: string
                enum:
                  - segment
                  - word
              uniqueItems: true
              minItems: 1
              maxItems: 2
          description: Controls level of timestamp detail in verbose_json. Only used when response_format is verbose_json. Can be a single granularity or an array to get multiple levels.
          default: segment
          example: ['word', 'segment']

    AudioTranslationResponse:
      oneOf:
        - $ref: '#/components/schemas/AudioTranslationJsonResponse'
        - $ref: '#/components/schemas/AudioTranslationVerboseJsonResponse'

    AudioTranslationJsonResponse:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          description: The translated text
          example: Hello, world!

    AudioTranslationVerboseJsonResponse:
      type: object
      required:
        - language
        - duration
        - text
        - segments
      properties:
        language:
          type: string
          description: The target language of the translation
          example: english
        duration:
          type: number
          description: The duration of the audio in seconds
          example: 3.5
        text:
          type: string
          description: The translated text
          example: Hello, world!
        segments:
          type: array
          items:
            $ref: '#/components/schemas/AudioTranscriptionSegment'
          description: Array of translation segments
        words:
          type: array
          items:
            $ref: '#/components/schemas/AudioTranscriptionWord'
          description: Array of translation words (only when timestamp_granularities includes 'word')

    AudioSpeechStreamResponse:
      oneOf:
        - $ref: '#/components/schemas/AudioSpeechStreamEvent'
        - $ref: '#/components/schemas/StreamSentinel'

    AudioSpeechStreamEvent:
      type: object
      required: [data]
      properties:
        data:
          $ref: '#/components/schemas/AudioSpeechStreamChunk'

    AudioSpeechStreamChunk:
      type: object
      required: [object, model, b64]
      properties:
        object:
          description: The object type, which is always `audio.tts.chunk`.
          const: audio.tts.chunk
        model:
          type: string
          example: cartesia/sonic
        b64:
          type: string
          description: base64 encoded audio stream

    StreamSentinel:
      type: object
      required: [data]
      properties:
        data:
          title: stream_signal
          type: string
          enum:
            - '[DONE]'

    ChatCompletionToken:
      type: object
      required: [id, text, logprob, special]
      properties:
        id:
          type: integer
        text:
          type: string
        logprob:
          type: number
        special:
          type: boolean

    ChatCompletionChoice:
      type: object
      required: [index, delta, finish_reason]
      properties:
        index:
          type: integer
        finish_reason:
          $ref: '#/components/schemas/FinishReason'
        logprobs:
          $ref: '#/components/schemas/LogprobsPart'
        delta:
          title: ChatCompletionChoiceDelta
          type: object
          required: [role]
          properties:
            token_id:
              type: integer
            role:
              type: string
              enum: ['system', 'user', 'assistant', 'function', 'tool']
            content:
              type: string
              nullable: true
            tool_calls:
              type: array
              items:
                $ref: '#/components/schemas/ToolChoice'
            function_call:
              type: object
              deprecated: true
              nullable: true
              properties:
                arguments:
                  type: string
                name:
                  type: string
              required:
                - arguments
                - name
            reasoning:
              type: string
              nullable: true

    EmbeddingsRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: >
            The name of the embedding model to use.<br> <br> [See all of Together AI's embedding models](https://docs.together.ai/docs/serverless-models#embedding-models)
          example: togethercomputer/m2-bert-80M-8k-retrieval
          anyOf:
            - type: string
              enum:
                - WhereIsAI/UAE-Large-V1
                - BAAI/bge-large-en-v1.5
                - BAAI/bge-base-en-v1.5
                - togethercomputer/m2-bert-80M-8k-retrieval
            - type: string
        input:
          oneOf:
            - type: string
              description: A string providing the text for the model to embed.
              example: Our solar system orbits the Milky Way galaxy at about 515,000 mph
            - type: array
              items:
                type: string
                description: A string providing the text for the model to embed.
                example: Our solar system orbits the Milky Way galaxy at about 515,000 mph
          example: Our solar system orbits the Milky Way galaxy at about 515,000 mph

    EmbeddingsResponse:
      type: object
      required:
        - object
        - model
        - data
      properties:
        object:
          description: The object type, which is always `list`.
          const: list
        model:
          type: string
        data:
          type: array
          items:
            type: object
            required: [index, object, embedding]
            properties:
              object:
                description: The object type, which is always `embedding`.
                const: embedding
              embedding:
                type: array
                items:
                  type: number
              index:
                type: integer

    ModelInfoList:
      type: array
      items:
        $ref: '#/components/schemas/ModelInfo'
    ModelInfo:
      type: object
      required: [id, object, created, type]
      properties:
        id:
          type: string
          example: 'Austism/chronos-hermes-13b'
        object:
          description: The object type, which is always `model`.
          const: model
        created:
          type: integer
          example: 1692896905
        type:
          enum:
            - chat
            - language
            - code
            - image
            - embedding
            - moderation
            - rerank
          example: 'chat'
        display_name:
          type: string
          example: 'Chronos Hermes (13B)'
        organization:
          type: string
          example: 'Austism'
        link:
          type: string
        license:
          type: string
          example: 'other'
        context_length:
          type: integer
          example: 2048
        pricing:
          $ref: '#/components/schemas/Pricing'

    ModelUploadRequest:
      type: object
      required:
        - model_name
        - model_source
      properties:
        model_name:
          type: string
          description: The name to give to your uploaded model
          example: 'Qwen2.5-72B-Instruct'
        model_source:
          type: string
          description: The source location of the model (Hugging Face repo or S3 path)
          example: 'unsloth/Qwen2.5-72B-Instruct'
        model_type:
          type: string
          description: Whether the model is a full model or an adapter
          default: 'model'
          enum:
            - model
            - adapter
          example: 'model'
        hf_token:
          type: string
          description: Hugging Face token (if uploading from Hugging Face)
          example: 'hf_examplehuggingfacetoken'
        description:
          type: string
          description: A description of your model
          example: 'Finetuned Qwen2.5-72B-Instruct by Unsloth'
        base_model:
          type: string
          description: The base model to use for an adapter if setting it to run against a serverless pool.  Only used for model_type `adapter`.
          example: 'Qwen/Qwen2.5-72B-Instruct'
        lora_model:
          type: string
          description: The lora pool to use for an adapter if setting it to run against, say, a dedicated pool.  Only used for model_type `adapter`.
          example: 'my_username/Qwen2.5-72B-Instruct-lora'

    ModelUploadSuccessResponse:
      type: object
      required:
        - data
        - message
      properties:
        data:
          type: object
          required:
            - job_id
            - model_name
            - model_id
            - model_source
          properties:
            job_id:
              type: string
              example: 'job-a15dad11-8d8e-4007-97c5-a211304de284'
            model_name:
              type: string
              example: 'necolinehubner/Qwen2.5-72B-Instruct'
            model_id:
              type: string
              example: 'model-c0e32dfc-637e-47b2-bf4e-e9b2e58c9da7'
            model_source:
              type: string
              example: 'huggingface'
        message:
          type: string
          example: 'Processing model weights. Job created.'

    ImageResponse:
      type: object
      properties:
        id:
          type: string
        model:
          type: string
        object:
          description: The object type, which is always `list`.
          const: list
        data:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/ImageResponseDataB64'
              - $ref: '#/components/schemas/ImageResponseDataUrl'
            discriminator:
              propertyName: type
      required:
        - id
        - model
        - object
        - data

    ImageResponseDataB64:
      type: object
      required: [index, b64_json, type]
      properties:
        index:
          type: integer
        b64_json:
          type: string
        type:
          type: string
          enum: [b64_json]

    ImageResponseDataUrl:
      type: object
      required: [index, url, type]
      properties:
        index:
          type: integer
        url:
          type: string
        type:
          type: string
          enum: [url]

    JobInfoSuccessResponse:
      type: object
      required:
        - type
        - job_id
        - status
        - status_updates
        - args
        - created_at
        - updated_at
      properties:
        type:
          type: string
          example: 'model_upload'
        job_id:
          type: string
          example: 'job-a15dad11-8d8e-4007-97c5-a211304de284'
        status:
          type: string
          enum: ['Queued', 'Running', 'Complete', 'Failed']
          example: 'Complete'
        status_updates:
          type: array
          items:
            type: object
            required:
              - status
              - message
              - timestamp
            properties:
              status:
                type: string
                example: 'Complete'
              message:
                type: string
                example: 'Job is Complete'
              timestamp:
                type: string
                format: date-time
                example: '2025-03-11T22:36:12Z'
        args:
          type: object
          properties:
            description:
              type: string
              example: 'Finetuned Qwen2.5-72B-Instruct by Unsloth'
            modelName:
              type: string
              example: 'necolinehubner/Qwen2.5-72B-Instruct'
            modelSource:
              type: string
              example: 'unsloth/Qwen2.5-72B-Instruct'
        created_at:
          type: string
          format: date-time
          example: '2025-03-11T22:05:43Z'
        updated_at:
          type: string
          format: date-time
          example: '2025-03-11T22:36:12Z'

    JobsInfoSuccessResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/JobInfoSuccessResponse'

    Pricing:
      type: object
      required: [hourly, input, output, base, finetune]
      properties:
        base:
          type: number
          example: 0
        finetune:
          type: number
          example: 0
        hourly:
          type: number
          example: 0
        input:
          type: number
          example: 0.3
        output:
          type: number
          example: 0.3
        cached_input:
          type: number
          example: 0.2

    ToolsPart:
      type: object
      properties:
        type:
          type: string
          example: 'tool_type'
        function:
          type: object
          properties:
            description:
              type: string
              example: 'A description of the function.'
            name:
              type: string
              example: 'function_name'
            parameters:
              type: object
              additionalProperties: true
              description: 'A map of parameter names to their values.'
    ToolChoice:
      type: object
      required: [id, type, function, index]
      properties:
        # TODO: is this the right place for index?
        index:
          type: number
        id:
          type: string
        type:
          type: string
          enum: ['function']
        function:
          type: object
          required: [name, arguments]
          properties:
            name:
              type: string
              example: 'function_name'
            arguments:
              type: string

    FileResponse:
      description: Structured information describing a file uploaded to Together.
      type: object
      required:
        - id
        - object
        - created_at
        - filename
        - bytes
        - purpose
        - FileType
        - Processed
      properties:
        id:
          description: ID of the file.
          type: string
        object:
          description: The object type, which is always `file`.
          const: file
        created_at:
          description: The timestamp when the file was created.
          type: integer
        filename:
          description: The name of the file as it was uploaded.
          type: string
          example: 'my_file.jsonl'
        bytes:
          description: The number of bytes in the file.
          type: integer
        purpose:
          description: The purpose of the file as it was uploaded.
          $ref: '#/components/schemas/FilePurpose'
        Processed:
          description: |
            Deprecated. Whether file has been fully uploaded.
          type: boolean
          deprecated: true
        FileType:
          description: The type of the file such as `jsonl`, `csv`, or `parquet`.
          $ref: '#/components/schemas/FileType'
        processing_status:
          description: |
            Lifecycle state of the file validation pipeline. Files for
            non-`fine-tune` purposes skip validation.
          $ref: '#/components/schemas/FileProcessingStatus'
        validation_report:
          description: |
            Report produced by the file validation pipeline. Present once
            validation has run; absent on files that bypassed validation
            (non-`fine-tune` purposes) or have not yet been validated.
          $ref: '#/components/schemas/FileValidationReport'
    FileProcessingStatus:
      description: |
        Lifecycle state of a file in the validation pipeline. The typical
        progression is `PENDING` → `QUEUED` → `RUNNING` → `COMPLETED` /
        `FAILED`. `INVALID_FORMAT` is a terminal state for files whose
        contents failed validation in a user-correctable way.
      type: string
      enum:
        - PENDING
        - QUEUED
        - RUNNING
        - COMPLETED
        - FAILED
        - INVALID_FORMAT
    FileValidationReport:
      description: |
        Validation outcome for a fine-tune training file, produced by the
        file validation pipeline.
      type: object
      required:
        - valid
      properties:
        valid:
          description: Whether the file passed validation.
          type: boolean
        dataset_format:
          description: Detected dataset format (e.g. `CONVERSATION`, `INSTRUCTION`).
          type: string
        dataset_has_sample_weights:
          description: Whether the dataset carries per-sample weights.
          type: boolean
        dataset_has_message_weights:
          description: Whether the dataset carries per-message weights (only possible for `CONVERSATION` format).
          type: boolean
        dataset_is_multimodal:
          description: Whether the dataset contains multimodal content.
          type: boolean
        dataset_has_tools:
          description: Whether the dataset contains tool-use messages.
          type: boolean
        dataset_has_parallel_tool_calls:
          description: Whether the dataset contains parallel tool-use messages.
          type: boolean
        dataset_has_reasoning:
          description: Whether the dataset contains reasoning content.
          type: boolean
        nlines:
          description: Number of lines (records) in the dataset.
          type: integer

        file_id:
          description: ID of the file this report describes.
          type: string
        error_type:
          description: |
            Category of validation failure.
          type: string
          enum:
            - INVALID_FORMAT
        error:
          description: |
            Human-readable validation error message. Only present when
            `error_type` is set (i.e. user-correctable failures).
          type: string
    FileList:
      required:
        - data
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FileResponse'
    FilePurpose:
      type: string
      description: The purpose of the file
      example: 'fine-tune'
      enum:
        - fine-tune
        - eval
        - batch-api
    FileType:
      type: string
      description: The type of the file
      default: 'jsonl'
      example: 'jsonl'
      enum:
        - 'csv'
        - 'jsonl'
        - 'parquet'
    FileDeleteResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
    FinetuneResponse:
      type: object
      required:
        - id
        - status
        - user_id
      properties:
        id:
          type: string
          format: uuid
        training_file:
          type: string
        validation_file:
          type: string
        model:
          type: string
        model_output_name:
          type: string
        model_output_path:
          type: string
        tokenized_dataset_path:
          type: string
          description: Storage path for the tokenized dataset archive generated for this fine-tune job.
        tokenized_dataset_uploaded_at:
          type: string
          format: date-time
          description: Timestamp when the tokenized dataset archive was uploaded.
        model_object_id:
          type: string
          description: Together model registry object ID for the final model weights (e.g. `ml_...`).
        model_object_name:
          type: string
          description: Together model registry name for the final model weights, formatted as `<project_slug>/<model_name>`.
        model_object_revision_id:
          type: string
          description: Together model registry revision ID for the final model weights (e.g. `rv_...`).
        adapter_object_id:
          type: string
          description: Together model registry object ID for the final adapter weights on LoRA jobs.
        adapter_object_name:
          type: string
          description: Together model registry name for the final adapter weights on LoRA jobs, formatted as `<project_slug>/<model_name>-adapter`.
        adapter_object_revision_id:
          type: string
          description: Together model registry revision ID for the final adapter weights on LoRA jobs.
        user_id:
          type: string
          description: ID of the user who created the fine-tune job.
        trainingfile_numlines:
          type: integer
        trainingfile_size:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        started_at:
          type: string
          format: date-time
        n_epochs:
          type: integer
        n_checkpoints:
          type: integer
        n_evals:
          type: integer
        batch_size:
          oneOf:
            - type: integer
            - type: string
              enum:
                - max
          default: 'max'
        learning_rate:
          type: number
        lr_scheduler:
          type: object
          $ref: '#/components/schemas/LRScheduler'
        warmup_ratio:
          type: number
        max_grad_norm:
          type: number
        weight_decay:
          type: number
        eval_steps:
          type: integer
        train_on_inputs:
          oneOf:
            - type: boolean
            - type: string
              enum:
                - auto
          default: auto
        training_method:
          type: object
          oneOf:
            - $ref: '#/components/schemas/TrainingMethodSFT'
            - $ref: '#/components/schemas/TrainingMethodDPO'
        training_type:
          type: object
          oneOf:
            - $ref: '#/components/schemas/FullTrainingType'
            - $ref: '#/components/schemas/LoRATrainingType'
        multimodal_params:
          $ref: '#/components/schemas/MultimodalParams'
        status:
          $ref: '#/components/schemas/FinetuneJobStatus'
        job_id:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/FineTuneEvent'
        token_count:
          type: integer
        param_count:
          type: integer
        total_price:
          type: integer
        epochs_completed:
          type: integer
        queue_depth:
          type: integer
        wandb_project_name:
          type: string
        wandb_url:
          type: string
        from_checkpoint:
          type: string
        from_hf_model:
          type: string
        hf_model_revision:
          type: string
        progress:
          $ref: '#/components/schemas/FineTuneProgress'
        early_stopped:
          type: boolean
          description: Whether the early-stopping criterion triggered.
        early_stopping_best_step:
          type: integer
          description: >
            Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step.
        early_stopping_best_metric:
          type: number
          nullable: true
          description: Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded (for example, a non-finite first evaluation).

    FinetuneResponseTruncated:
      type: object
      description: A truncated version of the fine-tune response, used for POST /fine-tunes, GET /fine-tunes and POST /fine-tunes/{id}/cancel endpoints
      required:
        - id
        - status
        - created_at
        - updated_at
        - user_id
      example:
        id: ft-01234567890123456789
        status: completed
        created_at: '2023-05-17T17:35:45.123Z'
        updated_at: '2023-05-17T18:46:23.456Z'
        user_id: user_789xyz012
        owner_address: 'user@example.com'
        total_price: 1500
        token_count: 850000
        events: [] # FineTuneTruncated object has no events
        model: 'meta-llama/Llama-2-7b-hf'
        model_output_name: 'mynamespace/meta-llama/Llama-2-7b-hf-32162631'
        n_epochs: 3
        training_file: 'file-01234567890123456789'
        wandb_project_name: 'my-finetune-project'
      properties:
        id:
          type: string
          description: Unique identifier for the fine-tune job
        status:
          $ref: '#/components/schemas/FinetuneJobStatus'
        created_at:
          type: string
          format: date-time
          description: Creation timestamp of the fine-tune job
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp of the fine-tune job
        started_at:
          type: string
          format: date-time
          description: Start timestamp of the current stage of the fine-tune job
        user_id:
          type: string
          description: ID of the user who created the fine-tune job.
        owner_address:
          type: string
          description: Owner address information
        total_price:
          type: integer
          description: Total price for the fine-tuning job
        token_count:
          type: integer
          description: Count of tokens processed
        events:
          type: array
          items:
            $ref: '#/components/schemas/FineTuneEvent'
          description: Events related to this fine-tune job
        # FineTuneUserParams fields
        training_file:
          type: string
          description: File-ID of the training file
        validation_file:
          type: string
          description: File-ID of the validation file
        packing:
          type: boolean
          description: Whether sequence packing is being used for training.
        max_seq_length:
          type: integer
          description: Maximum sequence length to use for training. If not specified, uses the maximum allowed for the model and training method.
        model:
          type: string
          description: Base model used for fine-tuning
        model_output_name:
          type: string
        suffix:
          type: string
          description: Suffix added to the fine-tuned model name
        n_epochs:
          type: integer
          description: Number of training epochs
        n_evals:
          type: integer
          description: Number of evaluations during training
        n_checkpoints:
          type: integer
          description: Number of checkpoints saved during training
        batch_size:
          type: integer
          description: Batch size used for training
        training_type:
          oneOf:
            - $ref: '#/components/schemas/FullTrainingType'
            - $ref: '#/components/schemas/LoRATrainingType'
          description: Type of training used (full or LoRA)
        training_method:
          oneOf:
            - $ref: '#/components/schemas/TrainingMethodSFT'
            - $ref: '#/components/schemas/TrainingMethodDPO'
          description: Method of training used
        learning_rate:
          type: number
          description: Learning rate used for training
        lr_scheduler:
          $ref: '#/components/schemas/LRScheduler'
          description: Learning rate scheduler configuration
        warmup_ratio:
          type: number
          description: Ratio of warmup steps
        max_grad_norm:
          type: number
          description: Maximum gradient norm for clipping
        weight_decay:
          type: number
          description: Weight decay value used
        random_seed:
          type: integer
          nullable: true
          description: >
            Random seed used for training. Integer when set; null if not stored (e.g. legacy jobs) or no explicit seed was recorded.
        wandb_project_name:
          type: string
          description: Weights & Biases project name
        wandb_name:
          type: string
          description: Weights & Biases run name
        from_checkpoint:
          type: string
          description: Checkpoint used to continue training
        from_hf_model:
          type: string
          description: Hugging Face Hub repo to start training from
        hf_model_revision:
          type: string
          description: The revision of the Hugging Face Hub model to continue training from
        progress:
          $ref: '#/components/schemas/FineTuneProgress'
          description: Progress information for the fine-tuning job
        early_stopped:
          type: boolean
          description: Whether the early-stopping criterion triggered.
        early_stopping_best_step:
          type: integer
          description: >
            Step associated with the selected early-stopping artifact. When early_stopping_best_metric is null, no finite best metric was recorded; this is the halt step, not a best-checkpoint step.
        early_stopping_best_metric:
          type: number
          nullable: true
          description: Best validation loss observed, corresponding to early_stopping_best_step. Null if no improving evaluation was recorded.
    FinetuneDeleteResponse:
      type: object
      properties:
        message:
          type: string
          description: Message indicating the result of the deletion
    FineTunePreviewRequest:
      type: object
      description: Request body for previewing tokenized fine-tuning data.
      required:
        - model
        - training_file
      properties:
        model:
          type: string
          description: Name of the base model whose tokenizer and chat template will be used.
        training_file:
          type: string
          description: File-ID of the uploaded JSONL training file to sample for preview.
        training_method:
          type: string
          default: sft
          enum: ['sft']
          description: Fine-tuning method to preview. Only supervised fine-tuning is currently supported.
        train_on_inputs:
          type: boolean
          default: false
          description: Whether prompt or user-message tokens should contribute to training loss in the preview.
        top_k:
          type: integer
          default: 5
          minimum: 1
          maximum: 50
          description: Maximum number of rows from the start of the training file to tokenize.
    FineTunePreviewResponse:
      type: object
      description: Tokenized preview for sampled rows from a fine-tuning training file.
      required:
        - model
        - dataset_format
        - max_seq_length
        - train_on_inputs
        - rows
      properties:
        model:
          type: string
          description: Name of the base model used to tokenize the sampled rows.
        dataset_format:
          type: string
          enum: ['general', 'conversation', 'instruction']
          description: Detected SFT dataset format for the sampled rows.
        max_seq_length:
          type: integer
          description: Maximum sequence length configured for the requested model.
        train_on_inputs:
          type: boolean
          description: Whether prompt or user-message tokens contribute to training loss.
        rows:
          type: array
          description: Tokenized preview rows, in the same order as the sampled training file rows.
          items:
            $ref: '#/components/schemas/FineTunePreviewRow'
    FineTunePreviewRow:
      type: object
      description: Tokenized representation of one sampled fine-tuning row.
      required:
        - input_ids
        - tokens
        - labels
        - trained_spans
        - num_tokens
        - num_trained_tokens
        - truncated
      properties:
        input_ids:
          type: array
          description: Token IDs produced for the sampled row.
          items:
            type: integer
            description: Token ID from the model tokenizer.
        tokens:
          type: array
          description: Raw token strings produced for the sampled row.
          items:
            type: string
            description: Token text from the model tokenizer.
        labels:
          type: array
          description: Training labels for each token; masked tokens use -100.
          items:
            type: integer
            description: Label value for the token at the same position.
        trained_spans:
          type: array
          description: Half-open token index ranges that contribute to training loss.
          items:
            type: array
            minItems: 2
            maxItems: 2
            description: Start and end token indexes for one trained span.
            items:
              type: integer
              description: Token index in the row.
        num_tokens:
          type: integer
          description: Total number of tokens in the preview row after truncation.
        num_trained_tokens:
          type: integer
          description: Number of tokens in the row that contribute to training loss.
        truncated:
          type: boolean
          description: Whether the row was truncated to the model maximum sequence length.
    FineTunePreviewMessageError:
      type: object
      description: Error response with a message field returned by the fine-tuning API layer.
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message.
    FineTunePreviewDetailError:
      type: object
      description: Error response with a detail field returned by the preview tokenization service.
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error detail.
    FineTuneModelLimits:
      type: object
      description: Model limits for fine-tuning.
      required:
        - model_name
        - lora_training
        - max_num_epochs
        - max_num_evals
        - max_num_checkpoints
        - max_learning_rate
        - min_learning_rate
        - supports_full_training
        - supports_vision
        - supports_tools
        - supports_reasoning
        - merge_output_lora
        - min_max_seq_length
        - max_seq_length_sft
        - max_seq_length_dpo
        - default_gradient_accumulation_steps
      properties:
        model_name:
          type: string
          description: The name of the model.
        full_training:
          type: object
          description: Limits for full training.
          required:
            - max_batch_size
            - max_batch_size_dpo
            - min_batch_size
          properties:
            max_batch_size:
              type: integer
              description: Maximum batch size for SFT full training.
            max_batch_size_dpo:
              type: integer
              description: Maximum batch size for DPO full training.
            min_batch_size:
              type: integer
              description: Minimum batch size for full training.
        lora_training:
          type: object
          description: Limits for LoRA training.
          required:
            - max_batch_size
            - max_batch_size_dpo
            - min_batch_size
            - max_rank
            - target_modules
          properties:
            max_batch_size:
              type: integer
              description: Maximum batch size for SFT LoRA training.
            max_batch_size_dpo:
              type: integer
              description: Maximum batch size for DPO LoRA training.
            min_batch_size:
              type: integer
              description: Minimum batch size for LoRA training.
            max_rank:
              type: integer
              description: Maximum LoRA rank.
            target_modules:
              type: array
              items:
                type: string
              description: Available target modules for LoRA.
        max_num_epochs:
          type: integer
          description: Maximum number of training epochs.
        max_num_evals:
          type: integer
          description: Maximum number of evaluations.
        max_learning_rate:
          type: number
          description: Maximum learning rate.
        min_learning_rate:
          type: number
          description: Minimum learning rate.
        supports_full_training:
          type: boolean
          description: Whether the model supports full (non-LoRA) fine-tuning. When false, only LoRA fine-tuning is available and the full_training limits are reported as zero.
        supports_vision:
          type: boolean
          description: Whether the model supports vision/multimodal inputs.
        supports_tools:
          type: boolean
          description: Whether the model supports tool/function calling.
        supports_reasoning:
          type: boolean
          description: Whether the model supports reasoning.
        merge_output_lora:
          type: boolean
          description: Whether a merged checkpoint (the base model with the trained LoRA adapter fused in) is produced for LoRA fine-tunes of this model, in addition to the standalone adapter.
        default_gradient_accumulation_steps:
          type: integer
          description: Default gradient accumulation steps used when a fine-tune request omits the value or sets it to 0.
        max_num_checkpoints:
          type: integer
          description: Maximum number of checkpoints that can be saved during a fine-tuning job.
        min_max_seq_length:
          type: integer
          description: Minimum value allowed for the max_seq_length hyperparameter.
        max_seq_length_sft:
          type: integer
          description: Maximum sequence length supported for SFT training.
        max_seq_length_dpo:
          type: integer
          description: Maximum sequence length supported for DPO training.
    FinetuneJobStatus:
      type: string
      enum:
        - pending
        - queued
        - running
        - compressing
        - uploading
        - cancel_requested
        - cancelled
        - error
        - completed

    FinetuneEventLevels:
      type: string
      enum:
        - null
        - info
        - warning
        - error
        - legacy_info
        - legacy_iwarning
        - legacy_ierror
    FinetuneEventType:
      type: string
      enum:
        - job_pending
        - job_start
        - job_stopped
        - model_downloading
        - model_download_complete
        - training_data_downloading
        - training_data_download_complete
        - validation_data_downloading
        - validation_data_download_complete
        - wandb_init
        - training_start
        - checkpoint_save
        - billing_limit
        - epoch_complete
        - training_complete
        - model_compressing
        - model_compression_complete
        - model_uploading
        - model_upload_complete
        - job_complete
        - job_error
        - cancel_requested
        - job_restarted
        - refund
        - warning
        - early_stopped
        - tokenized_dataset_upload_complete

    FinetuneTruncatedList:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FinetuneResponseTruncated'
    FinetuneListEvents:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FineTuneEvent'
    FineTuneEvent:
      type: object
      required:
        - object
        - created_at
        - message
        - type
      properties:
        object:
          description: The object type, which is always `fine-tune-event`.
          const: fine-tune-event
        created_at:
          type: string
        level:
          anyOf:
            - $ref: '#/components/schemas/FinetuneEventLevels'
        message:
          type: string
        type:
          $ref: '#/components/schemas/FinetuneEventType'
        param_count:
          type: integer
        token_count:
          type: integer
        total_steps:
          type: integer
        wandb_url:
          type: string
        step:
          type: integer
        checkpoint_path:
          type: string
        model_path:
          type: string
        tokenized_dataset_path:
          type: string
          description: Storage path for the tokenized dataset archive associated with this event.
        early_stopping_best_step:
          type: integer
          nullable: true
          description: >
            For early_stopped events, the selected best-checkpoint step when a finite best metric exists. If early_stopping_best_metric_value is null, this is the halt step.
        early_stopping_best_metric_value:
          type: number
          nullable: true
          description: For early_stopped events, the best validation loss observed. Null if no improving evaluation was recorded.
    FineTuneTokenizedDatasetRetrieveResponse:
      type: object
      description: Presigned download metadata for a fine-tune tokenized dataset archive.
      required:
        - url
        - filename
        - size
        - content_type
        - expires_at
      properties:
        url:
          type: string
          format: uri
          description: Presigned URL for downloading the tokenized dataset archive.
        filename:
          type: string
          description: Archive filename to use when saving the downloaded tokenized dataset.
        size:
          type: integer
          description: Archive size in bytes.
        content_type:
          type: string
          description: MIME type for the tokenized dataset archive.
        expires_at:
          type: string
          format: date-time
          description: Time when the presigned download URL expires.
    FineTuneProgress:
      type: object
      description: Progress information for a fine-tuning job
      required:
        - estimate_available
        - seconds_remaining
      properties:
        estimate_available:
          type: boolean
          description: Whether time estimate is available
        seconds_remaining:
          type: integer
          description: Estimated time remaining in seconds for the fine-tuning job to next state
    FinetuneListCheckpoints:
      type: object
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FineTuneCheckpoint'
    FineTuneCheckpoint:
      type: object
      description: A checkpoint available for a fine-tuning job.
      required:
        - step
        - path
        - created_at
        - checkpoint_type
      properties:
        step:
          type: integer
          description: Step represented by the checkpoint; final checkpoints use the shipped model step.
        created_at:
          type: string
          description: Timestamp when the checkpoint was created.
        path:
          type: string
          description: Storage path for the checkpoint artifact.
        checkpoint_type:
          type: string
          description: Display label for the checkpoint, including the final or intermediate checkpoint step.
        checkpoint:
          type: string
          enum: [model, adapter]
          description: Canonical artifact selector for checkpoint download requests.
        object_id:
          type: string
          description: Together model registry object ID for the checkpoint artifact (e.g. `ml_...`).
        object_name:
          type: string
          description: Together model registry name for the checkpoint artifact, formatted as `<project_slug>/<checkpoint_name>`.
        object_revision_id:
          type: string
          description: Together model registry revision ID for the checkpoint artifact (e.g. `rv_...`).

    FullTrainingType:
      type: object
      properties:
        type:
          type: string
          enum: ['Full']
      required:
        - type
    LoRATrainingType:
      type: object
      description: LoRA training configuration for a fine-tuning job.
      properties:
        type:
          type: string
          enum: ['Lora']
          description: Identifies this request as a LoRA fine-tune.
        lora_r:
          type: integer
          description: Rank of the LoRA adapter matrices.
        lora_alpha:
          type: integer
          description: Scaling factor applied to the LoRA adapter weights.
        lora_dropout:
          type: number
          default: 0.0
          description: Dropout probability applied to LoRA adapter inputs.
        lora_trainable_modules:
          type: string
          default: 'all-linear'
          description: Comma-separated LoRA target modules. Use `all-linear` for model defaults; MoE expert modules (`w_up`, `w_gate`, `w_down`) can be combined with attention modules on compatible models. Fine-tunes that target any expert module produce adapter-only output.
      required:
        - type
        - lora_r
        - lora_alpha

    TrainingMethodSFT:
      type: object
      properties:
        method:
          type: string
          enum: ['sft']
        train_on_inputs:
          oneOf:
            - type: boolean
            - type: string
              enum:
                - auto
          type: boolean
          default: auto
          description: Whether to mask user messages in conversational data or prompts in instruction data.
      required:
        - method
        - train_on_inputs
    TrainingMethodDPO:
      type: object
      properties:
        method:
          type: string
          enum: ['dpo']
        dpo_beta:
          type: number
          default: 0.1
        rpo_alpha:
          type: number
          default: 0.0
        dpo_normalize_logratios_by_length:
          type: boolean
          default: false
        dpo_reference_free:
          type: boolean
          default: false
        simpo_gamma:
          type: number
          default: 0.0
      required:
        - method

    MultimodalParams:
      type: object
      properties:
        train_vision:
          type: boolean
          description: Whether to train the vision encoder of the model. Only available for multimodal models.

    LRScheduler:
      type: object
      properties:
        lr_scheduler_type:
          type: string
          enum:
            - linear
            - cosine
        lr_scheduler_args:
          oneOf:
            - $ref: '#/components/schemas/LinearLRSchedulerArgs'
            - $ref: '#/components/schemas/CosineLRSchedulerArgs'
      required:
        - lr_scheduler_type
    CosineLRSchedulerArgs:
      type: object
      properties:
        min_lr_ratio:
          type: number
          default: 0.0
          description: The ratio of the final learning rate to the peak learning rate
        num_cycles:
          type: number
          default: 0.5
          description: Number or fraction of cycles for the cosine learning rate scheduler
      required:
        - min_lr_ratio
        - num_cycles
    LinearLRSchedulerArgs:
      type: object
      properties:
        min_lr_ratio:
          type: number
          default: 0.0
          description: The ratio of the final learning rate to the peak learning rate

    Autoscaling:
      type: object
      description: Configuration for automatic scaling of replicas based on demand.
      required:
        - min_replicas
        - max_replicas
      properties:
        min_replicas:
          type: integer
          description: The minimum number of replicas to maintain, even when there is no load
          examples:
            - 2
        max_replicas:
          type: integer
          description: The maximum number of replicas to scale up to under load
          examples:
            - 5

    HardwareSpec:
      type: object
      description: Detailed specifications of a hardware configuration
      required:
        - gpu_type
        - gpu_link
        - gpu_memory
        - gpu_count
      properties:
        gpu_type:
          type: string
          description: The type/model of GPU
          examples:
            - a100-80gb
        gpu_link:
          type: string
          description: The GPU interconnect technology
          examples:
            - sxm
        gpu_memory:
          type: number
          description: Amount of GPU memory in GB
          examples:
            - 80
        gpu_count:
          type: integer
          description: Number of GPUs in this configuration
          examples:
            - 2

    EndpointPricing:
      type: object
      description: Pricing details for using an endpoint
      required:
        - cents_per_minute
      properties:
        cents_per_minute:
          type: number
          description: Cost per minute of endpoint uptime in cents
          examples:
            - 5.42

    HardwareAvailability:
      type: object
      description: Indicates the current availability status of a hardware configuration
      required:
        - status
      properties:
        status:
          type: string
          description: The availability status of the hardware configuration
          enum:
            - available
            - unavailable
            - insufficient

    HardwareWithStatus:
      type: object
      description: Hardware configuration details with optional availability status
      required:
        - object
        - id
        - pricing
        - specs
        - updated_at
      properties:
        object:
          description: The object type, which is always `hardware`.
          const: hardware
        id:
          type: string
          description: Unique identifier for the hardware configuration
          examples:
            - 2x_nvidia_a100_80gb_sxm
        pricing:
          $ref: '#/components/schemas/EndpointPricing'
        specs:
          $ref: '#/components/schemas/HardwareSpec'
        availability:
          $ref: '#/components/schemas/HardwareAvailability'
        updated_at:
          type: string
          format: date-time
          description: Timestamp of when the hardware status was last updated

    CreateEndpointRequest:
      type: object
      required:
        - model
        - hardware
        - autoscaling
      properties:
        display_name:
          type: string
          description: A human-readable name for the endpoint
          example: My Llama3 70b endpoint
        model:
          type: string
          description: The model to deploy on this endpoint
          example: deepseek-ai/DeepSeek-R1
        hardware:
          type: string
          description: The hardware configuration to use for this endpoint
          example: 1x_nvidia_a100_80gb_sxm
        autoscaling:
          $ref: '#/components/schemas/Autoscaling'
          description: Configuration for automatic scaling of the endpoint
        disable_prompt_cache:
          deprecated: true
          type: boolean
          description: This parameter is deprecated and no longer has any effect.
          default: false
        disable_speculative_decoding:
          type: boolean
          description: Whether to disable speculative decoding for this endpoint
          default: false
        state:
          type: string
          description: The desired state of the endpoint
          enum:
            - STARTED
            - STOPPED
          default: STARTED
          example: STARTED
        inactive_timeout:
          type: integer
          description: The number of minutes of inactivity after which the endpoint stops automatically. Set to null, omit, or set to 0 to disable automatic timeout.
          nullable: true
          example: 60
        availability_zone:
          type: string
          description: Create the endpoint in a specified availability zone (e.g., us-central-4b)

    DedicatedEndpoint:
      type: object
      description: Details about a dedicated endpoint deployment
      required:
        - object
        - id
        - name
        - display_name
        - model
        - hardware
        - type
        - owner
        - state
        - autoscaling
        - created_at
      properties:
        object:
          description: The object type, which is always `endpoint`.
          const: endpoint
        id:
          type: string
          description: Unique identifier for the endpoint
          example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7
        name:
          type: string
          description: System name for the endpoint
          example: devuser/deepseek-ai/DeepSeek-R1-a32b82a1
        display_name:
          type: string
          description: Human-readable name for the endpoint
          example: My DeepSeek R1 endpoint
        model:
          type: string
          description: The model deployed on this endpoint
          example: deepseek-ai/DeepSeek-R1
        hardware:
          type: string
          description: The hardware configuration used for this endpoint
          example: 8x_nvidia_h200_140gb_sxm
        type:
          type: string
          enum:
            - dedicated
          description: The type of endpoint
          example: dedicated
        owner:
          type: string
          description: The owner of this endpoint
          example: devuser
        state:
          type: string
          enum:
            - PENDING
            - STARTING
            - STARTED
            - STOPPING
            - STOPPED
            - ERROR
          description: Current state of the endpoint
          example: STARTED
        autoscaling:
          $ref: '#/components/schemas/Autoscaling'
          description: Configuration for automatic scaling of the endpoint
        created_at:
          type: string
          format: date-time
          description: Timestamp when the endpoint was created
          example: 2025-02-04T10:43:55.405Z

    ListEndpoint:
      type: object
      description: Details about an endpoint when listed via the list endpoint
      required:
        - id
        - object
        - name
        - model
        - type
        - owner
        - state
        - created_at
      properties:
        object:
          description: The object type, which is always `endpoint`.
          const: endpoint
        id:
          type: string
          description: Unique identifier for the endpoint
          example: endpoint-d23901de-ef8f-44bf-b3e7-de9c1ca8f2d7
        name:
          type: string
          description: System name for the endpoint
          example: allenai/OLMo-7B
        model:
          type: string
          description: The model deployed on this endpoint
          example: allenai/OLMo-7B
        type:
          type: string
          enum:
            - serverless
            - dedicated
          description: The type of endpoint
          example: serverless
        owner:
          type: string
          description: The owner of this endpoint
          example: together
        state:
          type: string
          enum:
            - PENDING
            - STARTING
            - STARTED
            - STOPPING
            - STOPPED
            - ERROR
          description: Current state of the endpoint
          example: STARTED
        created_at:
          type: string
          format: date-time
          description: Timestamp when the endpoint was created
          example: 2024-02-28T21:34:35.444Z

    DisplayorExecuteOutput:
      properties:
        data:
          properties:
            application/geo+json:
              type: object
            application/javascript:
              type: string
            application/json:
              type: object
            application/pdf:
              format: byte
              type: string
            application/vnd.vega.v5+json:
              type: object
            application/vnd.vegalite.v4+json:
              type: object
            image/gif:
              format: byte
              type: string
            image/jpeg:
              format: byte
              type: string
            image/png:
              format: byte
              type: string
            image/svg+xml:
              type: string
            text/html:
              type: string
            text/latex:
              type: string
            text/markdown:
              type: string
            text/plain:
              type: string
          type: object
        type:
          enum:
            - display_data
            - execute_result
          type: string
      required:
        - type
        - data
      title: DisplayorExecuteOutput

    Error:
      oneOf:
        - type: string
        - additionalProperties: true
          type: object
      title: Error

    ErrorOutput:
      title: ErrorOutput
      description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully.
      properties:
        data:
          type: string
        type:
          enum:
            - error
          type: string
      required:
        - type
        - data

    ExecuteRequest:
      title: ExecuteRequest
      required:
        - language
        - code
      properties:
        code:
          description: 'Code snippet to execute.'
          example: "print('Hello, world!')"
          type: string
        files:
          description: Files to upload to the session. If present, files are uploaded before executing the given code.
          items:
            properties:
              content:
                type: string
              encoding:
                description: Encoding of the file content. Use `string` for text files such as code, and `base64` for binary files, such as images.
                enum:
                  - string
                  - base64
                type: string
              name:
                type: string
            required:
              - name
              - encoding
              - content
            type: object
          type: array
        language:
          default: python
          description: Programming language for the code to execute. Currently only supports Python.
          enum:
            - python
        session_id:
          description: Identifier of the current session. Used to make follow-up calls. Returns an error if the session does not belong to the caller or has expired.
          example: ses_abcDEF123
          nullable: false
          type: string

    ExecuteResponse:
      title: ExecuteResponse
      type: object
      description: 'The result of the execution. If successful, `data` contains the result and `errors` is null. If unsuccessful, `data` is null and `errors` contains the errors.'
      oneOf:
        - title: SuccessfulExecution
          type: object
          required: [data, errors]
          properties:
            errors:
              type: 'null'
            data:
              type: object
              nullable: false
              required: [session_id, outputs]
              properties:
                outputs:
                  type: array
                  items:
                    discriminator:
                      propertyName: type
                    oneOf:
                      - title: StreamOutput
                        description: Outputs that were printed to stdout or stderr
                        type: object
                        required: [type, data]
                        properties:
                          type:
                            enum:
                              - stdout
                              - stderr
                            type: string
                          data:
                            type: string
                      - description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully.
                        properties:
                          data:
                            type: string
                          type:
                            enum:
                              - error
                            type: string
                        required:
                          - type
                          - data
                        title: ErrorOutput
                      - properties:
                          data:
                            properties:
                              application/geo+json:
                                type: object
                                additionalProperties: true
                              application/javascript:
                                type: string
                              application/json:
                                type: object
                                additionalProperties: true
                              application/pdf:
                                format: byte
                                type: string
                              application/vnd.vega.v5+json:
                                type: object
                                additionalProperties: true
                              application/vnd.vegalite.v4+json:
                                type: object
                                additionalProperties: true
                              image/gif:
                                format: byte
                                type: string
                              image/jpeg:
                                format: byte
                                type: string
                              image/png:
                                format: byte
                                type: string
                              image/svg+xml:
                                type: string
                              text/html:
                                type: string
                              text/latex:
                                type: string
                              text/markdown:
                                type: string
                              text/plain:
                                type: string
                            type: object
                          type:
                            enum:
                              - display_data
                              - execute_result
                            type: string
                        required:
                          - type
                          - data
                        title: DisplayorExecuteOutput
                    title: InterpreterOutput
                session_id:
                  type: string
                  description: Identifier of the current session. Used to make follow-up calls.
                  example: ses_abcDEF123
                  nullable: false
                status:
                  type: string
                  enum:
                    - success
                  description: Status of the execution. Currently only supports success.
        - title: FailedExecution
          type: object
          required: [data, errors]
          properties:
            data:
              type: 'null'
            errors:
              type: array
              items:
                title: Error
                oneOf:
                  - type: string
                  - type: object
                    additionalProperties: true

    InterpreterOutput:
      discriminator:
        propertyName: type
      oneOf:
        - description: Outputs that were printed to stdout or stderr
          properties:
            data:
              type: string
            type:
              enum:
                - stdout
                - stderr
              type: string
          required:
            - type
            - data
          title: StreamOutput
        - description: Errors and exceptions that occurred. If this output type is present, your code did not execute successfully.
          properties:
            data:
              type: string
            type:
              enum:
                - error
              type: string
          required:
            - type
            - data
          title: ErrorOutput
        - properties:
            data:
              properties:
                application/geo+json:
                  type: object
                application/javascript:
                  type: string
                application/json:
                  type: object
                application/pdf:
                  format: byte
                  type: string
                application/vnd.vega.v5+json:
                  type: object
                application/vnd.vegalite.v4+json:
                  type: object
                image/gif:
                  format: byte
                  type: string
                image/jpeg:
                  format: byte
                  type: string
                image/png:
                  format: byte
                  type: string
                image/svg+xml:
                  type: string
                text/html:
                  type: string
                text/latex:
                  type: string
                text/markdown:
                  type: string
                text/plain:
                  type: string
              type: object
            type:
              enum:
                - display_data
                - execute_result
              type: string
          required:
            - type
            - data
          title: DisplayorExecuteOutput
      title: InterpreterOutput

    Response:
      properties:
        errors:
          items:
            oneOf:
              - type: string
              - additionalProperties: true
                type: object
            title: Error
          type: array
      title: Response
      type: object

    SessionListResponse:
      allOf:
        - properties:
            errors:
              items:
                oneOf:
                  - type: string
                  - additionalProperties: true
                    type: object
                title: Error
              type: array
          title: Response
          type: object
        - properties:
            data:
              properties:
                sessions:
                  items:
                    properties:
                      execute_count:
                        type: integer
                      expires_at:
                        format: date-time
                        type: string
                      id:
                        description: Session Identifier. Used to make follow-up calls.
                        example: ses_abcDEF123
                        type: string
                      last_execute_at:
                        format: date-time
                        type: string
                      started_at:
                        format: date-time
                        type: string
                    required:
                      - execute_count
                      - expires_at
                      - id
                      - last_execute_at
                      - started_at
                    type: object
                  type: array
              required:
                - sessions
          type: object
      title: SessionListResponse
      type: object

    StreamOutput:
      description: Outputs that were printed to stdout or stderr
      properties:
        data:
          type: string
        type:
          enum:
            - stdout
            - stderr
          type: string
      required:
        - type
        - data
      title: StreamOutput

    CreateBatchRequest:
      type: object
      required: [endpoint, input_file_id]
      properties:
        endpoint:
          type: string
          enum:
            - /v1/chat/completions
            - /v1/audio/transcriptions
            - /v1/audio/translations
          description: |
            The endpoint to use for batch processing. Each line of the uploaded input file is dispatched against this endpoint.
            - `/v1/chat/completions` — chat completion batches
            - `/v1/audio/transcriptions` — audio transcription batches (e.g. `openai/whisper-large-v3`)
            - `/v1/audio/translations` — audio translation batches
          example: '/v1/chat/completions'
        input_file_id:
          type: string
          description: ID of the uploaded input file containing batch requests
          example: 'file-abc123def456ghi789'
        completion_window:
          type: string
          description: Time window for batch completion (optional)
          example: '24h'
        priority:
          type: integer
          description: Priority for batch processing (optional)
          example: 1
        model_id:
          type: string
          description: 'Model to use for processing batch requests'
          example: 'Qwen/Qwen3.5-9B'
    BatchErrorResponse:
      type: object
      properties:
        error:
          type: string
    BatchJobWithWarning:
      type: object
      properties:
        job:
          $ref: '#/components/schemas/BatchJob'
        warning:
          type: string
    BatchJob:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: '01234567-8901-2345-6789-012345678901'
        user_id:
          type: string
          example: 'user_789xyz012'
        input_file_id:
          type: string
          example: 'file-input123abc456def'
        file_size_bytes:
          type: integer

          example: 1048576
          description: 'Size of input file in bytes'
        status:
          $ref: '#/components/schemas/BatchJobStatus'
        job_deadline:
          type: string
          format: date-time
          example: '2024-01-15T15:30:00Z'
        created_at:
          type: string
          format: date-time
          example: '2024-01-15T14:30:00Z'
        endpoint:
          type: string
          example: '/v1/chat/completions'
        progress:
          type: number
          example: 75.0
          description: 'Completion progress (0.0 to 100)'
        model_id:
          type: string
          example: 'Qwen/Qwen3.5-9B'
          description: 'Model used for processing requests'
        output_file_id:
          type: string
          example: 'file-output789xyz012ghi'
        error_file_id:
          type: string
          example: 'file-errors456def789jkl'
        error:
          type: string
        completed_at:
          type: string
          format: date-time
          example: '2024-01-15T15:45:30Z'
    BatchJobStatus:
      type: string
      enum:
        - VALIDATING
        - IN_PROGRESS
        - COMPLETED
        - FAILED
        - EXPIRED
        - CANCELLED
      example: 'IN_PROGRESS'
      description: 'Current status of the batch job'

    EvaluationTypedRequest:
      type: object
      required:
        - type
        - parameters
      properties:
        type:
          type: string
          enum: [classify, score, compare]
          description: The type of evaluation to perform
          example: 'classify'
        parameters:
          oneOf:
            - $ref: '#/components/schemas/EvaluationClassifyParameters'
            - $ref: '#/components/schemas/EvaluationScoreParameters'
            - $ref: '#/components/schemas/EvaluationCompareParameters'
          description: Type-specific parameters for the evaluation

    EvaluationClassifyParameters:
      type: object
      required:
        - judge
        - labels
        - pass_labels
        - input_data_file_path
      properties:
        judge:
          $ref: '#/components/schemas/EvaluationJudgeModelConfig'
        labels:
          type: array
          items:
            type: string
          minItems: 2
          description: List of possible classification labels
          example: ['yes', 'no']
        pass_labels:
          type: array
          items:
            type: string
          minItems: 1
          description: List of labels that are considered passing
          example: ['yes']
        model_to_evaluate:
          $ref: '#/components/schemas/EvaluationModelOrString'
        input_data_file_path:
          type: string
          description: Data file ID
          example: 'file-1234-aefd'

    EvaluationScoreParameters:
      type: object
      required:
        - judge
        - min_score
        - max_score
        - pass_threshold
        - input_data_file_path
      properties:
        judge:
          $ref: '#/components/schemas/EvaluationJudgeModelConfig'
        min_score:
          type: number
          example: 0.0
          description: Minimum possible score
        max_score:
          type: number
          example: 10.0
          description: Maximum possible score
        pass_threshold:
          type: number
          example: 7.0
          description: Score threshold for passing
        model_to_evaluate:
          $ref: '#/components/schemas/EvaluationModelOrString'
        input_data_file_path:
          type: string
          example: 'file-01234567890123456789'
          description: Data file ID

    EvaluationCompareParameters:
      type: object
      required:
        - judge
        - input_data_file_path
      properties:
        judge:
          $ref: '#/components/schemas/EvaluationJudgeModelConfig'
        model_a:
          description: >
            Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time.
          oneOf:
            - $ref: '#/components/schemas/EvaluationModelRequest'
            - type: string
              description: Column name in the input data containing pre-generated responses
        model_b:
          description: >
            Either an EvaluationModelRequest for generation or a string column name from the dataset (when responses are pre-generated). When both model_a and model_b are EvaluationModelRequest objects, their inference runs execute in parallel to reduce total wall-clock time.
          oneOf:
            - $ref: '#/components/schemas/EvaluationModelRequest'
            - type: string
              description: Column name in the input data containing pre-generated responses
        input_data_file_path:
          type: string
          description: Data file ID
          example: 'file-01234567890123456789'
        disable_position_bias_correction:
          type: boolean
          default: false
          description: >
            When false (default), the judge runs twice per sample: once with model A's response first (original order) and once with model B's response first (flipped order). The two verdicts are reconciled to cancel out position bias. When true, only the original-order pass is run, halving judge cost and latency at the expense of position-bias correction. The result file will not contain flipped-order judge fields when this is true.

    EvaluationJudgeModelConfig:
      type: object
      required:
        - model
        - system_template
        - model_source
      properties:
        model:
          type: string
          description: Name of the judge model
          example: 'Qwen/Qwen3.5-9B'
        system_template:
          type: string
          description: System prompt template for the judge
          example: 'Imagine you are a helpful assistant'
        model_source:
          type: string
          description: >
            Source of the judge model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
              (minimum enforced even if num_workers is set lower).
            - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
              Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
              for first-party APIs, 20 for proxy/aggregator endpoints.
          enum: [serverless, dedicated, external]
        external_api_token:
          type: string
          description: "Bearer/API token for the external judge model provider. Required when model_source is 'external'."
        external_base_url:
          type: string
          description: "Base URL of the external inference API for the judge. Must be OpenAI-compatible. Required when model_source is 'external'."
        num_workers:
          type: integer
          minimum: 1
          description: >
            Number of concurrent inference workers for the judge. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here.
          example: 5
        max_tokens:
          type: integer
          minimum: 1
          description: "Maximum number of tokens the judge model may generate. Defaults to 32768 if omitted. Set higher for reasoning judges (e.g. o-series, Gemini) that spend tokens on internal chain-of-thought before emitting the verdict JSON."
          example: 8192
        temperature:
          type: number
          minimum: 0
          maximum: 2
          description: "Sampling temperature for the judge model. Defaults to 0.05 if omitted."
          example: 0.0

    EvaluationModelOrString:
      oneOf:
        - type: string
          description: Column name in the input dataset containing pre-generated responses
        - $ref: '#/components/schemas/EvaluationModelRequest'

    EvaluationModelRequest:
      type: object
      required:
        - model
        - max_tokens
        - temperature
        - system_template
        - input_template
        - model_source
      properties:
        model:
          type: string
          description: Name of the model to evaluate
          example: 'Qwen/Qwen3.5-9B'
        max_tokens:
          type: integer
          minimum: 1
          description: Maximum number of tokens to generate.
          example: 512
        temperature:
          type: number
          minimum: 0
          maximum: 2
          description: Sampling temperature for generation.
          example: 0.7
        system_template:
          type: string
          description: System prompt template. Supports Jinja2 variables referencing dataset columns.
          example: 'You are a helpful assistant.'
        input_template:
          type: string
          description: User message template. Supports Jinja2 variables referencing dataset columns.
          example: 'Please answer the following question: {{ question }}'
        model_source:
          type: string
          description: >
            Source of the model inference: - `serverless`: Together's shared serverless inference API. Default concurrency: 25 workers. - `dedicated`: A Together dedicated deployment endpoint. Default concurrency: 5 workers
              (minimum enforced even if num_workers is set lower). Authentication uses the requesting
              user's Together API token automatically.
            - `external`: An external inference API (e.g. OpenAI, Anthropic, Google, OpenRouter).
              Requires `external_api_token` and `external_base_url`. Default concurrency: 2 workers
              for first-party APIs (OpenAI, Anthropic, Google), 20 for proxy/aggregator endpoints.
          enum: [serverless, dedicated, external]
        external_api_token:
          type: string
          description: "Bearer/API token for the external model provider. Required when model_source is 'external'."
        external_base_url:
          type: string
          description: "Base URL of the external inference API. Must be OpenAI-compatible. Required when model_source is 'external'."
        num_workers:
          type: integer
          minimum: 1
          description: >
            Number of concurrent inference workers. Overrides the source-specific default (serverless: 25, dedicated: 5, external: 2–20). For dedicated endpoints the value is clamped to a minimum of 5 regardless of what is set here.
          example: 5

    EvaluationResponse:
      type: object
      properties:
        workflow_id:
          type: string
          description: The ID of the created evaluation job
          example: 'eval-1234-1244513'
        status:
          type: string
          enum: [pending]
          description: Initial status of the job

    EvaluationJob:
      type: object
      properties:
        workflow_id:
          type: string
          description: The evaluation job ID
          example: 'eval-1234aedf'
        type:
          type: string
          enum: [classify, score, compare]
          description: The type of evaluation
          example: classify
        owner_id:
          type: string
          description: ID of the job owner (admin only)
        status:
          type: string
          enum: [pending, queued, running, completed, error, user_error]
          description: Current status of the job
          example: completed
        status_updates:
          type: array
          items:
            $ref: '#/components/schemas/EvaluationJobStatusUpdate'
          description: History of status updates (admin only)
        parameters:
          type: object
          description: The parameters used for this evaluation
          additionalProperties: true
        created_at:
          type: string
          format: date-time
          description: When the job was created
          example: '2025-07-23T17:10:04.837888Z'
        updated_at:
          type: string
          format: date-time
          description: When the job was last updated
          example: '2025-07-23T17:10:04.837888Z'
        results:
          oneOf:
            - $ref: '#/components/schemas/EvaluationClassifyResults'
            - $ref: '#/components/schemas/EvaluationScoreResults'
            - $ref: '#/components/schemas/EvaluationCompareResults'
            - type: object
              properties:
                error:
                  type: string
          nullable: true
          description: Results of the evaluation (when completed)

    EvaluationJobStatusUpdate:
      type: object
      properties:
        status:
          type: string
          description: The status at this update
          example: pending
        message:
          type: string
          description: Additional message for this update
          example: Job is pending evaluation
        timestamp:
          type: string
          format: date-time
          description: When this update occurred
          example: '2025-07-23T17:10:04.837888Z'

    EvaluationClassifyResults:
      type: object
      properties:
        generation_fail_count:
          type: number
          nullable: true
          description: Number of failed generations.
          example: 0
        judge_fail_count:
          type: number
          nullable: true
          description: Number of failed judge generations
          example: 0
        invalid_label_count:
          type: number
          nullable: true
          description: Number of invalid labels
          example: 0
        result_file_id:
          type: string
          description: Data File ID
          example: file-1234-aefd
        pass_percentage:
          type: number
          nullable: true
          description: Pecentage of pass labels.
          example: 10
        label_counts:
          type: string
          description: JSON string representing label counts
          example: '{"yes": 10, "no": 0}'

    EvaluationScoreResults:
      type: object
      properties:
        aggregated_scores:
          type: object
          properties:
            mean_score:
              type: number
            std_score:
              type: number
            pass_percentage:
              type: number
        generation_fail_count:
          type: number
          nullable: true
          description: Number of failed generations.
          example: 0
        judge_fail_count:
          type: number
          nullable: true
          description: Number of failed judge generations
          example: 0
        invalid_score_count:
          type: number
          description: number of invalid scores generated from model
        failed_samples:
          type: number
          description: number of failed samples generated from model
        result_file_id:
          type: string
          description: Data File ID
          example: file-1234-aefd

    EvaluationCompareResults:
      type: object
      properties:
        A_wins:
          type: integer
          description: Number of samples where model A was judged the winner
        B_wins:
          type: integer
          description: Number of samples where model B was judged the winner
        Ties:
          type: integer
          description: Number of samples that resulted in a tie score
        generation_fail_count:
          type: number
          nullable: true
          description: Number of generation failures across model A and model B.
          example: 0
        judge_fail_count:
          type: number
          nullable: true
          description: >
            Number of judge inference failures. In the default two-pass mode (disable_position_bias_correction=false) this is the combined failure count from both the original-order and flipped-order judge passes.
          example: 0
        result_file_id:
          type: string
          description: >
            File ID of the detailed output file. Each row contains the original input fields plus judge outputs. In two-pass mode the file includes both original-order and flipped-order judge fields; in single-pass mode (disable_position_bias_correction=true) only original-order fields are present.

    AudioFileBinary:
      type: string
      format: binary
      description: >-
        Audio file uploaded as binary. Maximum upload size 80 MB (requests above this are rejected with HTTP 413). For larger payloads, host the file and submit a URL instead.

    AudioFileUrl:
      type: string
      format: uri
      description: >-
        Public HTTPS URL the server fetches the audio from. Server-side fetch limit is 1 GB; downloads exceeding the cap fail with `file_too_large`.

    CreateVideoBody:
      title: Create video request
      description: Parameters for creating a new video generation job.
      type: object
      required:
        - model
      properties:
        model:
          type: string
          description: The model to be used for the video creation request.
        prompt:
          type: string
          maxLength: 32000
          minLength: 1
          description: Text prompt that describes the video to generate.
        height:
          type: integer
        width:
          type: integer
        resolution:
          type: string
          description: Video resolution.
        ratio:
          type: string
          description: Aspect ratio of the video.
        seconds:
          type: string
          description: Clip duration in seconds.
        fps:
          type: integer
          description: Frames per second. Defaults to 24.
        steps:
          type: integer
          minimum: 10
          maximum: 50
          description: The number of denoising steps the model performs during video generation. More steps typically result in higher quality output but require longer processing time.
        seed:
          type: integer
          description: Seed to use in initializing the video generation.  Using the same seed allows deterministic video generation.  If not provided a random seed is generated for each request.
        guidance_scale:
          type: integer
          description: Controls how closely the video generation follows your prompt. Higher values make the model adhere more strictly to your text description, while lower values allow more creative freedom. guidence_scale affects both visual content and temporal consistency.Recommended range is 6.0-10.0 for most video models. Values above 12 may cause over-guidance artifacts or unnatural motion patterns.
        output_format:
          $ref: '#/components/schemas/VideoOutputFormat'
          description: Specifies the format of the output video. Defaults to MP4.
        output_quality:
          type: integer
          description: Compression quality. Defaults to 20.
        negative_prompt:
          type: string
          description: Similar to prompt, but specifies what to avoid instead of what to include
        generate_audio:
          type: boolean
          description: Whether to generate audio for the video.
        media:
          $ref: '#/components/schemas/VideoMedia'
          description: Media inputs for video generation. The accepted fields depend on the model type (e.g. i2v, r2v, t2v, videoedit).
        frame_images:
          deprecated: true
          description: "Deprecated: use media.frame_images instead. Array of images to guide video generation, similar to keyframes."
          example:
            - [{"input_image": "aac49721-1964-481a-ae78-8a4e29b91402", "frame": 0}, {"input_image": "c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7", "frame": 48}, {"input_image": "3ad204c3-a9de-4963-8a1a-c3911e3afafe", "frame": "last"}]
          type: array
          items:
            $ref: '#/components/schemas/VideoFrameImageInput'
        reference_images:
          deprecated: true
          description: "Deprecated: use media.reference_images instead. Unlike frame_images which constrain specific timeline positions, reference images guide the general appearance that should appear consistently across the video."
          type: array
          items:
            type: string
    VideoStatus:
      description: Current lifecycle status of the video job.
      type: string
      enum:
        - in_progress
        - completed
        - failed

    VideoFrameImageInput:
      type: object
      required: ['input_image']
      properties:
        input_image:
          type: string
          description: URL path to hosted image that is used for a frame
        frame:
          description: |
            Optional param to specify where to insert the frame. If this is omitted, the following heuristics are applied:
            - frame_images size is one, frame is first.
            - If size is two, frames are first and last.
            - If size is larger, frames are first, last and evenly spaced between.
          anyOf:
            - type: number
            - type: string
              enum:
                - first
                - last

    VideoMedia:
      type: object
      description: Contains all media inputs for video generation. Accepted fields depend on the model type.
      properties:
        frame_images:
          description: Array of images to guide video generation at specific timeline positions.
          type: array
          items:
            $ref: '#/components/schemas/VideoFrameImageInput'
        frame_videos:
          description: Array of video clips to use as starting clips.
          type: array
          items:
            $ref: '#/components/schemas/VideoRef'
        reference_images:
          description: Array of image URLs that guide the general appearance across the video.
          type: array
          items:
            type: string
        reference_videos:
          description: Array of reference videos.
          type: array
          items:
            $ref: '#/components/schemas/VideoRef'
        source_video:
          description: Source video to edit. Accepts a URL string or an object with a "video" key.
          oneOf:
            - type: string
            - $ref: '#/components/schemas/VideoRef'
        audio_inputs:
          description: Array of audio inputs. Each element accepts a URL string or an object with an "audio" key.
          type: array
          items:
            oneOf:
              - type: string
              - $ref: '#/components/schemas/AudioRef'

    VideoRef:
      type: object
      required: ['video']
      properties:
        video:
          type: string
          description: URL of the video.

    AudioRef:
      type: object
      required: ['audio']
      properties:
        audio:
          type: string
          description: URL of the audio.

    VideoOutputFormat:
      type: string
      enum:
        - MP4
        - WEBM

    VideoJob:
      properties:
        id:
          type: string
          description: Unique identifier for the video job.
        object:
          description: The object type, which is always video.
          const: video
        model:
          type: string
          description: The video generation model that produced the job.
        status:
          $ref: '#/components/schemas/VideoStatus'
          description: Current lifecycle status of the video job.
        created_at:
          type: number
          description: Unix timestamp (seconds) for when the job was created.
        completed_at:
          type: number
          description: Unix timestamp (seconds) for when the job completed, if finished.
        size:
          type: string
          description: The resolution of the generated video.
        seconds:
          type: string
          description: Duration of the generated clip in seconds.
        error:
          description: Error payload that explains why generation failed, if applicable.
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - message
        outputs:
          description: Available upon completion, the outputs provides the cost charged and the hosted url to access the video
          type: object
          properties:
            cost:
              type: integer
              description: The cost of generated video charged to the owners account.
            video_url:
              type: string
              description: URL hosting the generated video
          required:
            - cost
            - video_url
      type: object
      required:
        - id
        - model
        - status
        - size
        - seconds
        - created_at
      title: Video job
      description: Structured information describing a generated video job.
    ContainerStatus:
      properties:
        finishedAt:
          description: FinishedAt is the timestamp when the container finished execution (if terminated)
          type: string
        message:
          description: Message provides a human-readable message with details about the container's status
          type: string
        name:
          description: Name is the name of the container
          type: string
        reason:
          description: Reason provides a brief machine-readable reason for the container's current status
          type: string
        startedAt:
          description: StartedAt is the timestamp when the container started execution
          type: string
        status:
          description: Status is the current state of the container (e.g., "Running", "Terminated", "Waiting")
          type: string
      type: object
    SignedURLResponse:
      properties:
        url:
          type: string
      type: object
    CreateDeploymentRequest:
      properties:
        args:
          description: Args overrides the container's CMD. Provide as an array of arguments (e.g., ["python", "app.py"])
          items:
            type: string
          type: array
        autoscaling:
          description: 'Autoscaling configuration. Example: {"metric": "QueueBacklogPerWorker", "target": 1.01} to scale based on queue backlog. Omit or set to null to disable autoscaling'
          oneOf:
            - $ref: "#/components/schemas/HTTPAutoscalingConfig"
            - $ref: "#/components/schemas/QueueAutoscalingConfig"
            - $ref: "#/components/schemas/CustomMetricAutoscalingConfig"
        command:
          description: Command overrides the container's ENTRYPOINT. Provide as an array (e.g., ["/bin/sh", "-c"])
          items:
            type: string
          type: array
        cpu:
          description: CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 = 100 milli cores)
          minimum: 0.1
          type: number
        description:
          description: Description is an optional human-readable description of your deployment
          type: string
        environment_variables:
          description: EnvironmentVariables is a list of environment variables to set in the container. Each must have a name and either a value or value_from_secret
          items:
            $ref: "#/components/schemas/EnvironmentVariable"
          type: array
        gpu_count:
          description: GPUCount is the number of GPUs to allocate per container instance. Defaults to 0 if not specified
          type: integer
        gpu_type:
          description: GPUType specifies the GPU hardware to use (e.g., "h100-80gb").
          enum:
            - h100-80gb
            - h100-40gb-mig
            - h200-140gb
            - b200-192gb
          type: string
        health_check_path:
          description: HealthCheckPath is the HTTP path for health checks (e.g., "/health"). If set, the platform checks this endpoint to determine container health.
          type: string
        image:
          description: Image is the container image to deploy from registry.together.ai.
          type: string
        max_replicas:
          description: MaxReplicas is the maximum number of container instances. Defaults to MinReplicas if not set.
          type: integer
        memory:
          description: Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5 = 512MiB)
          maximum: 1000
          type: number
        min_replicas:
          description: MinReplicas is the minimum number of container instances to run. Defaults to 1 if not specified
          type: integer
        name:
          description: Name is the unique identifier for your deployment. Must contain only alphanumeric characters, underscores, or hyphens (1-100 characters)
          maxLength: 100
          minLength: 1
          type: string
        port:
          description: Port is the container port your application listens on (e.g., 8080 for web servers). Required if your application serves traffic
          maximum: 65535
          minimum: 1
          type: integer
        storage:
          description: Storage is the amount of ephemeral disk storage to allocate per container instance (e.g., 10 = 10GiB)
          maximum: 400
          type: integer
        termination_grace_period_seconds:
          description: TerminationGracePeriodSeconds is the time in seconds to wait for graceful shutdown before forcefully terminating the replica
          type: integer
        volumes:
          description: Volumes is a list of volume mounts to attach to the container. Each mount must reference an existing volume by name
          items:
            $ref: "#/components/schemas/VolumeMount"
          type: array
      required:
        - gpu_type
        - image
        - name
      type: object
    CreateSecretRequest:
      properties:
        description:
          description: Description is an optional human-readable description of the secret's purpose (max 500 characters)
          maxLength: 500
          type: string
        name:
          description: Name is the unique identifier for the secret. Can contain alphanumeric characters, underscores, hyphens, forward slashes, and periods (1-100 characters)
          maxLength: 100
          minLength: 1
          type: string
        project_id:
          description: ProjectID is ignored - the project is automatically determined from your authentication
          type: string
        value:
          description: Value is the sensitive data to store securely (e.g., API keys, passwords, tokens). Encrypted at rest.
          minLength: 1
          type: string
      required:
        - name
        - value
      type: object
    CreateVolumeRequest:
      properties:
        content:
          allOf:
            - $ref: "#/components/schemas/VolumeContentRequest"
          description: Content specifies the content configuration for this volume
        name:
          description: Name is the unique identifier for the volume within the project
          maxLength: 100
          minLength: 1
          type: string
        type:
          allOf:
            - $ref: "#/components/schemas/VolumeType"
          description: Type is the volume type (currently only "readOnly" is supported)
      required:
        - content
        - name
        - type
      type: object
    DeploymentListResponse:
      properties:
        data:
          description: Data is the array of deployment items
          items:
            $ref: "#/components/schemas/DeploymentResponseItem"
          type: array
        object:
          description: The object type, which is always `list`.
          const: list
      type: object
    DeploymentLogs:
      properties:
        lines:
          items:
            type: string
          type: array
      type: object
    DeploymentResponseItem:
      properties:
        args:
          description: Args are the arguments passed to the container's command
          items:
            type: string
          type: array
        autoscaling:
          description: Autoscaling contains autoscaling configuration parameters for this deployment. Omitted when autoscaling is disabled (nil)
          oneOf:
            - $ref: '#/components/schemas/HTTPAutoscalingConfig'
            - $ref: '#/components/schemas/QueueAutoscalingConfig'
            - $ref: '#/components/schemas/CustomMetricAutoscalingConfig'
        command:
          description: Command is the entrypoint command run in the container
          items:
            type: string
          type: array
        cpu:
          description: CPU is the amount of CPU resource allocated to each replica in cores (fractional value is allowed)
          type: number
        created_at:
          description: CreatedAt is the ISO8601 timestamp when this deployment was created
          type: string
          format: date-time
        description:
          description: Description provides a human-readable explanation of the deployment's purpose or content
          type: string
        desired_replicas:
          description: DesiredReplicas is the number of replicas that the orchestrator is targeting
          type: integer
        environment_variables:
          description: EnvironmentVariables is a list of environment variables set in the container
          items:
            $ref: "#/components/schemas/EnvironmentVariable"
          type: array
        gpu_count:
          description: GPUCount is the number of GPUs allocated to each replica in this deployment
          type: integer
        gpu_type:
          description: GPUType specifies the type of GPU requested (if any) for this deployment
          enum:
            - h100-80gb
            - h100-40gb-mig
            - h200-140gb
            - b200-192gb
          type: string
        health_check_path:
          description: HealthCheckPath is the HTTP path used for health checks of the application
          type: string
        id:
          description: ID is the unique identifier of the deployment
          type: string
        image:
          description: Image specifies the container image used for this deployment
          type: string
        max_replicas:
          description: MaxReplicas is the maximum number of replicas to run for this deployment
          type: integer
        memory:
          description: Memory is the amount of memory allocated to each replica in GiB (fractional value is allowed)
          type: number
        min_replicas:
          description: MinReplicas is the minimum number of replicas to run for this deployment
          type: integer
        name:
          description: Name is the name of the deployment
          type: string
        object:
          description: The object type, which is always `deployment`.
          const: deployment
        port:
          description: Port is the container port that the deployment exposes
          type: integer
        ready_replicas:
          description: ReadyReplicas is the current number of replicas that are in the Ready state
          type: integer
        replica_events:
          additionalProperties:
            $ref: "#/components/schemas/ReplicaEvent"
          description: ReplicaEvents is a mapping of replica names or IDs to their status events
          type: object
        status:
          allOf:
            - $ref: "#/components/schemas/DeploymentStatus"
          description: Status represents the overall status of the deployment (e.g., Updating, Scaling, Ready, Failed)
          enum:
            - Updating
            - Scaling
            - Ready
            - Failed
            - ScaledToZero
        storage:
          description: Storage is the amount of storage (in MB or units as defined by the platform) allocated to each replica
          type: integer
        termination_grace_period_seconds:
          description: TerminationGracePeriodSeconds is the time in seconds to wait for graceful shutdown before forcefully terminating the replica
          type: integer
        updated_at:
          description: UpdatedAt is the ISO8601 timestamp when this deployment was last updated
          type: string
          format: date-time
        volumes:
          description: Volumes is a list of volume mounts for this deployment
          items:
            $ref: "#/components/schemas/VolumeMount"
          type: array
      type: object
    DeploymentStatus:
      enum:
        - Updating
        - Scaling
        - Ready
        - Failed
        - ScaledToZero
      type: string
      x-enum-varnames:
        - DeploymentStatusUpdating
        - DeploymentStatusScaling
        - DeploymentStatusReady
        - DeploymentStatusFailed
        - DeploymentStatusScaledToZero
    EnvironmentVariable:
      properties:
        name:
          description: Name is the environment variable name (e.g., "DATABASE_URL"). Must start with a letter or underscore, followed by letters, numbers, or underscores
          type: string
        value:
          description: Value is the plain text value for the environment variable. Use this for non-sensitive values. Either Value or ValueFromSecret must be set, but not both
          type: string
        value_from_secret:
          description: ValueFromSecret references a secret by name or ID to use as the value. Use this for sensitive values like API keys or passwords. Either Value or ValueFromSecret must be set, but not both
          type: string
      required:
        - name
      type: object
    HTTPAutoscalingConfig:
      description: Autoscaling config for HTTPTotalRequests and HTTPAvgRequestDuration metrics
      properties:
        metric:
          description: Metric must be HTTPTotalRequests or HTTPAvgRequestDuration
          enum:
            - HTTPTotalRequests
            - HTTPAvgRequestDuration
          example: HTTPTotalRequests
          type: string
        target:
          description: 'Target is the threshold value. Default: 100 for HTTPTotalRequests, 500 (ms) for HTTPAvgRequestDuration'
          example: 100
          type: number
        time_interval_minutes:
          description: 'TimeIntervalMinutes is the rate window in minutes. Default: 10'
          example: 10
          type: integer
      type: object
    QueueAutoscalingConfig:
      description: Autoscaling config for QueueBacklogPerWorker metric
      properties:
        metric:
          description: Metric must be QueueBacklogPerWorker
          enum:
            - QueueBacklogPerWorker
          example: QueueBacklogPerWorker
          type: string
        model:
          description: Model overrides the model name for queue status lookup. Defaults to the deployment app name
          type: string
        target:
          description: 'Target is the threshold value. Default: 1.01'
          example: 1.01
          type: number
      type: object
    CustomMetricAutoscalingConfig:
      description: Autoscaling config for CustomMetric metric
      properties:
        custom_metric_name:
          description: CustomMetricName is the Prometheus metric name. Must match [a-zA-Z_:][a-zA-Z0-9_:]*
          example: my_custom_metric
          type: string
        metric:
          description: Metric must be CustomMetric
          enum:
            - CustomMetric
          example: CustomMetric
          type: string
        target:
          description: 'Target is the threshold value. Default: 500'
          example: 500
          type: number
      type: object
    KubernetesEvent:
      properties:
        action:
          description: Action is the action taken or reported by this event
          type: string
        count:
          description: Count is the number of times this event has occurred
          type: integer
        first_seen:
          description: FirstSeen is the timestamp when this event was first observed
          type: string
        last_seen:
          description: LastSeen is the timestamp when this event was last observed
          type: string
        message:
          description: Message is a human-readable description of the event
          type: string
        reason:
          description: Reason is a brief machine-readable reason for this event (e.g., "Pulling", "Started", "Failed")
          type: string
      type: object
    ListSecretsResponse:
      properties:
        data:
          description: Data is the array of secret items
          items:
            $ref: "#/components/schemas/SecretResponseItem"
          type: array
        object:
          description: The object type, which is always `list`.
          const: list
      type: object
    ListVolumesResponse:
      properties:
        data:
          description: Data is the array of volume items
          items:
            $ref: "#/components/schemas/VolumeResponseItem"
          type: array
        object:
          description: The object type, which is always `list`.
          const: list
      type: object
    ReplicaEvent:
      properties:
        image:
          description: Image is the container image used for this replica
          type: string
        replica_ready_since:
          description: ReplicaReadySince is the timestamp when the replica became ready to serve traffic
          type: string
        replica_status:
          description: ReplicaStatus is the current status of the replica (e.g., "Running", "Waiting", "Terminated")
          type: string
        replica_status_message:
          description: ReplicaStatusMessage provides a human-readable message explaining the replica's status
          type: string
        replica_status_reason:
          description: ReplicaStatusReason provides a brief machine-readable reason for the replica's status
          type: string
        revision_id:
          description: RevisionID is the deployment revision ID associated with this replica
          type: string
        volume_preload_completed_at:
          description: VolumePreloadCompletedAt is the timestamp when the volume preload completed
          type: string
        volume_preload_started_at:
          description: VolumePreloadStartedAt is the timestamp when the volume preload started
          type: string
        volume_preload_status:
          description: VolumePreloadStatus is the status of the volume preload (e.g., "InProgress", "Completed", "Failed")
          type: string
      type: object
    SecretResponseItem:
      properties:
        created_at:
          description: CreatedAt is the ISO8601 timestamp when this secret was created
          type: string
        created_by:
          description: CreatedBy is the identifier of who created this secret.
          type: string
        description:
          description: Description is a human-readable description of the secret's purpose
          type: string
        id:
          description: ID is the unique identifier for this secret
          type: string
        last_updated_by:
          description: LastUpdatedBy is the identifier of who last updated this secret.
          type: string
        name:
          description: Name is the name/key of the secret
          type: string
        object:
          description: The object type, which is always `secret`.
          const: secret
        updated_at:
          description: UpdatedAt is the ISO8601 timestamp when this secret was last updated
          type: string
      type: object
    UpdateDeploymentRequest:
      properties:
        args:
          description: Args overrides the container's CMD. Provide as an array of arguments (e.g., ["python", "app.py"])
          items:
            type: string
          type: array
        autoscaling:
          description: Autoscaling configuration for the deployment. Set to {} to disable autoscaling
          oneOf:
            - $ref: "#/components/schemas/HTTPAutoscalingConfig"
            - $ref: "#/components/schemas/QueueAutoscalingConfig"
            - $ref: "#/components/schemas/CustomMetricAutoscalingConfig"
        command:
          description: Command overrides the container's ENTRYPOINT. Provide as an array (e.g., ["/bin/sh", "-c"])
          items:
            type: string
          type: array
        cpu:
          description: CPU is the number of CPU cores to allocate per container instance (e.g., 0.1 = 100 milli cores)
          minimum: 0.1
          type: number
        description:
          description: Description is an optional human-readable description of your deployment
          type: string
        environment_variables:
          description: EnvironmentVariables is a list of environment variables to set in the container. Replaces all existing environment variables.
          items:
            $ref: "#/components/schemas/EnvironmentVariable"
          type: array
        gpu_count:
          description: GPUCount is the number of GPUs to allocate per container instance
          type: integer
        gpu_type:
          description: GPUType specifies the GPU hardware to use (e.g., "h100-80gb")
          enum:
            - h100-80gb
            - h100-40gb-mig
            - h200-140gb
            - b200-192gb
          type: string
        health_check_path:
          description: HealthCheckPath is the HTTP path for health checks (e.g., "/health"). Set to empty string to disable health checks
          type: string
        image:
          description: Image is the container image to deploy from registry.together.ai.
          type: string
        max_replicas:
          description: MaxReplicas is the maximum number of replicas that can be scaled up to.
          type: integer
        memory:
          description: Memory is the amount of RAM to allocate per container instance in GiB (e.g., 0.5 = 512MiB)
          maximum: 1000
          type: number
        min_replicas:
          description: MinReplicas is the minimum number of replicas to run
          type: integer
        name:
          description: Name is the new unique identifier for your deployment. Must contain only alphanumeric characters, underscores, or hyphens (1-100 characters)
          maxLength: 100
          minLength: 1
          type: string
        port:
          description: Port is the container port your application listens on (e.g., 8080 for web servers)
          maximum: 65535
          minimum: 1
          type: integer
        storage:
          description: Storage is the amount of ephemeral disk storage to allocate per container instance (e.g., 10 = 10GiB)
          maximum: 400
          type: integer
        termination_grace_period_seconds:
          description: TerminationGracePeriodSeconds is the time in seconds to wait for graceful shutdown before forcefully terminating the replica
          type: integer
        volumes:
          description: Volumes is a list of volume mounts to attach to the container. Replaces all existing volumes.
          items:
            $ref: "#/components/schemas/VolumeMount"
          type: array
      type: object
    UpdateSecretRequest:
      properties:
        description:
          description: Description is an optional human-readable description of the secret's purpose (max 500 characters)
          maxLength: 500
          type: string
        name:
          description: Name is the new unique identifier for the secret. Can contain alphanumeric characters, underscores, hyphens, forward slashes, and periods (1-100 characters)
          maxLength: 100
          minLength: 1
          type: string
        project_id:
          description: ProjectID is ignored - the project is automatically determined from your authentication
          type: string
        value:
          description: Value is the new sensitive data to store securely. Updating this replaces the existing secret value.
          minLength: 1
          type: string
      type: object
    UpdateVolumeRequest:
      properties:
        content:
          allOf:
            - $ref: "#/components/schemas/VolumeContentRequest"
          description: Content specifies the new content to preload to this volume.
        name:
          description: Name is the new unique identifier for the volume within the project
          type: string
        type:
          allOf:
            - $ref: "#/components/schemas/VolumeType"
          description: Type is the new volume type (currently only "readOnly" is supported)
      type: object
    VolumeMount:
      properties:
        mount_path:
          description: MountPath is the path in the container where the volume mounts (e.g., "/data").
          type: string
        name:
          description: Name is the name of the volume to mount. Must reference an existing volume by name or ID
          type: string
        version:
          description: Version is the volume version to mount. On create, defaults to the latest version. On update, defaults to the currently mounted version.
          type: integer
      required:
        - mount_path
        - name
      type: object
    VolumeResponseItem:
      properties:
        content:
          $ref: '#/components/schemas/VolumeContent'
        created_at:
          description: CreatedAt is the ISO8601 timestamp when this volume was created
          type: string
        current_version:
          description: CurrentVersion is the current version number of this volume
          type: integer
        id:
          description: ID is the unique identifier for this volume
          type: string
        mounted_by:
          description: MountedBy is the list of deployment IDs currently mounting current volume version
          items:
            type: string
          type: array
          uniqueItems: false
        name:
          description: Name is the name of the volume
          type: string
        object:
          description: Object is the type identifier for this response (always "volume")
          type: string
        type:
          $ref: '#/components/schemas/VolumeType'
        updated_at:
          description: UpdatedAt is the ISO8601 timestamp when this volume was last updated
          type: string
        version_history:
          additionalProperties:
            $ref: '#/components/schemas/VersionHistoryItem'
          description: VersionHistory contains previous versions of this volume, keyed by version number
          type: object
      type: object
    VersionHistoryItem:
      properties:
        content:
          $ref: '#/components/schemas/VolumeContentRequest'
        mounted_by:
          items:
            type: string
          type: array
          uniqueItems: false
        version:
          type: integer
      type: object
    VolumeContentRequest:
      description: Content specifies the new content to preload to this volume.
      properties:
        source_prefix:
          description: SourcePrefix is the file path prefix for the content to be preloaded into the volume
          example: models/
          type: string
        type:
          description: Type is the content type (currently only "files" is supported which allows preloading files uploaded via Files API into the volume)
          enum:
            - files
          example: files
          type: string
      type: object
    VolumeContent:
      properties:
        files:
          description: Files is the list of files to preload into the volume, if the volume content type is "files".
          items:
            $ref: '#/components/schemas/FileInfo'
          type: array
          uniqueItems: false
        source_prefix:
          description: SourcePrefix is the file path prefix for the content to be preloaded into the volume
          example: models/
          type: string
        type:
          description: Type is the content type (currently only "files" is supported which allows preloading files uploaded via Files API into the volume)
          enum:
            - files
          example: files
          type: string
      type: object
    FileInfo:
      properties:
        last_modified:
          description: LastModified is the timestamp when the file was last modified
          type: string
        name:
          description: Name is the filename including extension (e.g., "model_weights.bin")
          type: string
        size:
          description: Size is the file size in bytes
          type: integer
      type: object
    VolumeType:
      enum:
        - readOnly
      type: string
      x-enum-varnames:
        - VolumeTypeReadOnly
    QueueError:
      description: Error response returned by queue endpoints.
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        param:
          description: The parameter that caused the error, if applicable
          type: string
        type:
          description: Error category (e.g. "invalid_request_error", "not_found_error")
          type: string
      type: object
    QueueMetricsResponse:
      description: Queue job counts for a model.
      type: object
      required:
        - messages_running
        - messages_waiting
        - total_jobs
      properties:
        messages_running:
          description: Number of jobs currently being processed
          type: integer
        messages_waiting:
          description: Number of jobs waiting to be claimed by a worker
          type: integer
        total_jobs:
          description: Total number of active jobs (waiting + running)
          type: integer
    QueueCancelRequest:
      description: Request to cancel a queued job.
      properties:
        model:
          description: Model identifier the job was submitted to
          type: string
        request_id:
          description: The request ID returned from the submit endpoint
          type: string
      required:
        - model
        - request_id
      type: object
    QueueCancelResponse:
      description: Status returned after a cancel attempt.
      type: object
      required:
        - status
      properties:
        status:
          description: |
            Job status after the cancel attempt. Only pending jobs can be
            canceled. If the job is already running, done, or failed, the status
            is returned unchanged.
          type: string
          enum:
            - canceled
            - running
            - done
            - failed
    QueueClearRequest:
      description: Request to clear pending jobs for a model.
      properties:
        model:
          description: Model identifier whose pending jobs should be canceled
          type: string
      required:
        - model
      type: object
    QueueClearResponse:
      description: Count of pending jobs canceled by the clear operation.
      type: object
      required:
        - canceled_count
      properties:
        canceled_count:
          description: Number of pending jobs that were canceled
          type: integer
    QueueJobRequest:
      description: Request to submit a job to the queue.
      properties:
        info:
          description: |
            Arbitrary JSON metadata stored with the job. Returned in status
            responses, where the model and system may have added or modified
            keys (e.g. progress).
          additionalProperties: true
          type: object
        model:
          description: Required model identifier
          example: my-queue-model
          type: string
        payload:
          description: Freeform model input. Passed unchanged to the model. Contents are model-specific.
          additionalProperties: true
          type: object
        priority:
          default: 0
          description: |
            Job priority. Higher values are processed first (strict priority
            ordering). Jobs with equal priority are processed in submission
            order (FIFO).
          type: integer
      required:
        - model
        - payload
      type: object
    QueueJobResponse:
      description: Response returned after queueing a job.
      properties:
        requestId:
          description: Unique identifier for the submitted job. Use this to poll status or cancel.
          type: string
      required:
        - requestId
      type: object
    QueueJobStatusResponse:
      description: Current status and metadata for a queued job.
      required:
        - request_id
        - model
        - status
      properties:
        claimed_at:
          description: Timestamp when a worker claimed the job
          format: date-time
          type: string
        created_at:
          description: Timestamp when the job was created
          format: date-time
          type: string
        done_at:
          description: Timestamp when the job completed (done or failed)
          format: date-time
          type: string
        info:
          description: |
            Job metadata. Contains keys from the submit request, plus any
            modifications from the model or system (e.g. progress, retry
            history).
          additionalProperties: true
          type: object
        inputs:
          description: Freeform model input, as submitted
          additionalProperties: true
          type: object
        model:
          description: Model identifier the job was submitted to
          type: string
        outputs:
          description: Freeform model output, populated when the job reaches done status. Contents are model-specific.
          additionalProperties: true
          type: object
        priority:
          description: Job priority. Higher values are processed first.
          type: integer
        request_id:
          description: The request ID that was returned from the submit endpoint
          type: string
        retries:
          description: |
            Number of times this job has been retried. Workers set a claim
            timeout and must send periodic status updates to keep the job alive.
            If no update is received within the timeout, the job is returned to
            the queue and retried. After 3 retries the job is permanently
            failed. Jobs explicitly failed by the model are not retried.
          type: integer
        status:
          description: |
            Current job status. Transitions: pending → running → done/failed. A pending job may also be canceled.
          enum:
            - pending
            - running
            - done
            - failed
            - canceled
          type: string
        warnings:
          description: Non-fatal messages about the request (e.g. deprecation notices)
          items:
            type: string
          type: array
      type: object
    WhoamiResponse:
      type: object
      required:
        - api_key_id
        - project_id
        - project_name
        - project_slug
        - organization_id
        - organization_name
      properties:
        api_key_id:
          type: string
          description: The ID of the API key that authenticated the request.
        project_id:
          type: string
          description: The ID of the project the API key is scoped to.
        project_name:
          type: string
          description: Human-readable name of the project.
        project_slug:
          type: string
          description: >
            DNS-friendly project identifier. Used with an endpoint slug as `<project_slug>/<endpoint_slug>` to form the `model` value in dedicated endpoint inference calls.
        organization_id:
          type: string
          description: The ID of the organization that owns the project.
        organization_name:
          type: string
          description: Human-readable name of the organization.
        user_id:
          type: string
          description: The ID of the authenticated user, if available.
