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

# Create an experiment variant

> Creates a new variant for the specified experiment.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/avido/openapi.documented.yml post /v0/experiments/{id}/variants
openapi: 3.1.1
info:
  title: Avido API
  description: >-
    Avido's API for LLM usage events, tool calls, trace management, webhook
    validation, and more. See each endpoint's request/response schema for
    details.
  version: 0.1.0
  contact:
    name: Avido Support
    email: support@avidoai.com
    url: https://avidoai.com/support
servers:
  - url: https://api.avidoai.com
    description: Production API
security:
  - ApiKey: []
    ApplicationId: []
paths:
  /v0/experiments/{id}/variants:
    post:
      tags:
        - Experiments
      summary: Create an experiment variant
      description: Creates a new variant for the specified experiment.
      operationId: createExperimentVariant
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            description: The unique identifier of the experiment
            example: 123e4567-e89b-12d3-a456-426614174000
          required: true
          description: The unique identifier of the experiment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExperimentVariantRequest'
      responses:
        '201':
          description: Successfully created experiment variant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentVariantResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateExperimentVariantRequest:
      type: object
      properties:
        title:
          description: The title of the variant
          example: Variant A
          type: string
          maxLength: 256
        description:
          description: The variant description
          example: Switch to reasoning model
          type: string
          maxLength: 2048
        parentId:
          description: Parent variant ID for inherited variants (non-baseline variants)
          example: 123e4567-e89b-12d3-a456-426614174000
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        configPatch:
          $ref: '#/components/schemas/ExperimentVariantConfigPatch'
      required:
        - configPatch
      additionalProperties: false
      title: Create Experiment Variant Request
      description: Request body for creating a new experiment variant
    ExperimentVariantResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ExperimentVariantOutput'
      required:
        - data
      additionalProperties: false
      title: Experiment Variant Response
      description: Response containing a single experiment variant
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message explaining the error.
          example: Resource not found
      required:
        - message
      additionalProperties: false
      title: ErrorResponse
      description: Standard error format for failed API operations.
    ValidationErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message indicating what went wrong.
          example: Invalid request data
        issues:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              path:
                type: array
                items:
                  type: string
            required:
              - code
              - message
              - path
            additionalProperties: false
          description: Array of detailed validation error objects.
          example:
            - code: invalid_string
              message: Invalid UUID
              path:
                - id
      required:
        - message
        - issues
      additionalProperties: false
      title: ValidationErrorResponse
      description: Details about validation errors in incoming requests.
    ExperimentVariantConfigPatch:
      type: object
      propertyNames:
        type: string
      additionalProperties:
        type: object
        propertyNames:
          type: string
        additionalProperties: {}
      description: The config patch to apply to the system, entire config if baseline
      example:
        llm:
          model: reasoning
    ExperimentVariantOutput:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: The unique identifier of the variant
          example: 123e4567-e89b-12d3-a456-426614174000
        experimentId:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: The unique identifier of the experiment
          example: 123e4567-e89b-12d3-a456-426614174000
        parentId:
          description: Parent variant ID for inherited variants (non-baseline variants)
          example: 123e4567-e89b-12d3-a456-426614174000
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        createdAt:
          description: When the variant was created
          example: '2024-01-05T12:34:56.789Z'
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        modifiedAt:
          description: When the variant was last modified
          example: '2024-01-05T12:34:56.789Z'
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        title:
          type: string
          description: The title of the experiment
          example: Credit Card Block
        description:
          type: string
          description: The experiment description
          example: Wants to block their credit card
        status:
          type: string
          enum:
            - DRAFT
            - RUNNING
            - COMPLETED
            - FAILED
            - REJECTED
        configPatch:
          $ref: '#/components/schemas/ExperimentVariantConfigPatch'
        config:
          $ref: '#/components/schemas/ExperimentVariantConfig'
        result:
          $ref: '#/components/schemas/RunResultOutput'
        progress:
          $ref: '#/components/schemas/ExperimentVariantProgressOutput'
          description: >-
            Progress of the variant's latest run, present when the variant has
            an active run
      required:
        - id
        - experimentId
        - createdAt
        - modifiedAt
        - title
        - description
        - status
        - configPatch
        - config
      additionalProperties: false
    ExperimentVariantConfig:
      type: object
      propertyNames:
        type: string
      additionalProperties:
        type: object
        propertyNames:
          type: string
        additionalProperties: {}
      description: The config patch to apply to the system, entire config if baseline
      example:
        llm:
          model: reasoning
    RunResultOutput:
      type: object
      properties:
        passed:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        failed:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        total:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        passRate:
          type: number
          minimum: 0
          maximum: 100
        averageScore:
          type: number
          minimum: 0
          maximum: 1
        evals:
          type: array
          items:
            $ref: '#/components/schemas/RunEvalResultOutput'
      required:
        - passed
        - failed
        - total
        - passRate
        - averageScore
        - evals
      additionalProperties: false
    ExperimentVariantProgressOutput:
      type: object
      properties:
        completed:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Number of tests that have finished (COMPLETED + FAILED)
          example: 5
        total:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Total number of tests in the run
          example: 10
      required:
        - completed
        - total
      additionalProperties: false
      title: ExperimentVariantProgress
      description: Progress of the variant's latest run (completed vs total tests)
    RunEvalResultOutput:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        name:
          type: string
        type:
          $ref: '#/components/schemas/EvalType'
        passed:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        failed:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        total:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        passRate:
          type: number
          minimum: 0
          maximum: 100
        averageScore:
          type: number
          minimum: 0
          maximum: 1
      required:
        - id
        - name
        - type
        - passed
        - failed
        - total
        - passRate
        - averageScore
      additionalProperties: false
    EvalType:
      type: string
      enum:
        - NATURALNESS
        - STYLE
        - RECALL
        - CUSTOM
        - OUTPUT_MATCH
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your unique Avido API key
    ApplicationId:
      type: apiKey
      in: header
      name: x-application-id
      description: Your unique Avido Application ID

````