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

# Create agent experiment

> Creates an experiment from at least two saved versions of the same live agent configuration. The weights are relative and do not need to total 100. Only one experiment for an agent configuration may be active at a time.




## OpenAPI

````yaml post /api/v2/experiments
openapi: 3.0.0
info:
  version: 2.0.0
  title: Vida API
  description: Vida API Documentation
servers:
  - url: https://api.vida.dev
    description: Vida Production
    variables:
      baseUrl:
        default: api.vida.dev
        description: Production API Root
security: []
tags:
  - name: Agents
  - name: Inbound Email
    description: Control which senders may create inbound email work for an Agent.
  - name: Features
    description: Inspect capabilities available within an account hierarchy.
  - name: Conversation Logs
    description: Query conversation activity and calculate account-level metrics.
  - name: Computer Agents
    description: Set up, configure, inspect, and manage Vida Computer Agents.
  - name: Computer Agent Sessions
    description: View and reset Computer Agent sessions.
  - name: Accounts
  - name: Agent Templates
    description: Create, manage, and apply reusable Agent configurations.
paths:
  /api/v2/experiments:
    post:
      tags:
        - Agents
      summary: Create agent experiment
      description: >
        Creates an experiment from at least two saved versions of the same live
        agent configuration. The weights are relative and do not need to total
        100. Only one experiment for an agent configuration may be active at a
        time.
      operationId: experimentsPostIndex
      parameters:
        - name: targetAccountId
          in: query
          required: true
          description: Account used to authorize this request.
          schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agentConfigId
                - variants
              properties:
                agentConfigId:
                  type: string
                  description: >-
                    Live agent configuration ID whose saved versions will be
                    tested.
                name:
                  type: string
                  default: Untitled Experiment
                status:
                  type: string
                  enum:
                    - draft
                    - active
                    - paused
                    - ended
                  default: active
                variants:
                  type: array
                  minItems: 2
                  items:
                    $ref: '#/components/schemas/AgentExperimentVariant'
      responses:
        '201':
          description: Experiment created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AgentExperiment'
                  status:
                    type: string
                    example: created
      security:
        - apiKeyAuth: []
components:
  schemas:
    AgentExperimentVariant:
      type: object
      required:
        - versionId
        - weight
      properties:
        label:
          type: string
          description: Display label for the variant.
        versionId:
          type: integer
          description: Saved version used by this variant.
        weight:
          type: number
          minimum: 0
          exclusiveMinimum: true
          description: Relative traffic weight.
    AgentExperiment:
      type: object
      properties:
        id:
          oneOf:
            - type: integer
            - type: string
          readOnly: true
        agentConfigId:
          type: string
          description: Live agent configuration ID whose versions are tested.
        name:
          type: string
        status:
          type: string
          enum:
            - draft
            - active
            - paused
            - ended
        variants:
          type: array
          minItems: 2
          items:
            type: object
            required:
              - versionId
              - weight
            properties:
              label:
                type: string
                description: Display label for the variant.
              versionId:
                type: integer
                description: Saved version used by this variant.
              weight:
                type: number
                minimum: 0
                exclusiveMinimum: true
                description: Relative traffic weight.
        createdAt:
          type: integer
          format: int64
          nullable: true
          readOnly: true
        createdBy:
          oneOf:
            - type: integer
            - type: string
          nullable: true
          readOnly: true
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: query
      name: token
      description: Vida API Token

````