---
title: "Create AI Config variation"
method: POST
path: "/api/v2/projects/{projectKey}/ai-configs/{configKey}/variations"
tags: ["AI Configs"]
---

# Create AI Config variation

`POST /api/v2/projects/{projectKey}/ai-configs/{configKey}/variations`

Create a new variation for a given AI Config.

The <code>model</code> in the request body requires a <code>modelName</code> and <code>parameters</code>, for example:

```
  "model": {
    "modelName": "claude-3-opus-20240229",
    "parameters": {
      "max_tokens": 1024
    }
  }
```

## Path parameters

- `projectKey` string, required
- `configKey` string, required

## Request body

- AIConfigVariationPost
  - `comment` string — Human-readable description of this variation
  - `description` string — Returns the description for the agent. This is only returned for agent variations.
  - `instructions` string — Returns the instructions for the agent. This is only returned for agent variations.
  - `key` string, required
  - `messages` Message[]
    - `content` string, required
    - `role` string, required
  - `model` object
  - `name` string, required
  - `modelConfigKey` string
  - `tools` VariationToolPost[] — List of tools to use for this variation. The latest version of the tool will be used.
    - `key` string, required — The key of the tool to use.
    - `version` integer, required — The version of the tool.
  - `toolKeys` string[] — List of tool keys to use for this variation. The latest version of the tool will be used.
  - `judgeConfiguration` JudgeConfiguration
    - `judges` JudgeAttachment[] — List of judges for this variation. When updating, this replaces all existing judge attachments, and if empty, removes all judge attachments.
      - `judgeConfigKey` string, required — Key of the judge AI Config
      - `samplingRate` number, float, required — Sampling rate for this judge attachment (0.0 to 1.0)

## Response `201`

AI Config variation created

- AIConfigVariation
  - `_links` ParentLink
    - `parent` CoreLink, required
      - `href` string, required
      - `type` string, required
  - `color` string
  - `comment` string
  - `description` string — Returns the description for the agent. This is only returned for agent variations.
  - `instructions` string — Returns the instructions for the agent. This is only returned for agent variations.
  - `key` string, required
  - `_id` string, required
  - `messages` Message[]
    - `content` string, required
    - `role` string, required
  - `model` object, required
  - `modelConfigKey` string
  - `name` string, required
  - `createdAt` integer, required
  - `version` integer, required
  - `state` string
  - `_archivedAt` integer
  - `_publishedAt` integer
  - `tools` VariationTool[]
    - `key` string, required — The key of the tool to use.
    - `version` integer, required — The version of the tool.
    - `customParameters` object — Custom metadata and configuration for application-level use
  - `judgeConfiguration` JudgeConfiguration
    - `judges` JudgeAttachment[] — List of judges for this variation. When updating, this replaces all existing judge attachments, and if empty, removes all judge attachments.
      - `judgeConfigKey` string, required — Key of the judge AI Config
      - `samplingRate` number, float, required — Sampling rate for this judge attachment (0.0 to 1.0)
  - `judgingConfigKeys` string[]

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `500` — Internal server error

## Changes

- **2026-02-28** `69c5c9aafe78` — 1 warning, 9 info
  - deleted the `header` request parameter `LD-API-Version`
  - api tag `AI Configs` added
  - api tag `AI Configs (beta)` removed
  - added the new optional request property `judgeConfiguration`
  - …6 more
- **2025-07-08** `b2724c5174d1` — 1 breaking, 6 info
  - the response property `messages` became optional for the status `201`
  - added the new optional request property `description`
  - added the new optional request property `instructions`
  - the request property `model` became optional
  - …3 more

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/projects/:projectKey/ai-configs/:configKey/variations/post.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
