> ## Documentation Index
> Fetch the complete documentation index at: https://docs.together.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an A/B experiment

> Updates an experiment's description or member traffic percentages. Use the experiment etag for optimistic concurrency.



## OpenAPI

````yaml PATCH /projects/{projectId}/endpoints/{endpointId}/abExperiments/{id}
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:
  /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
      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'
      servers:
        - url: https://api.together.ai/v2
components:
  schemas:
    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.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.
    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
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-bearer-format: bearer
      x-default: default

````