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

# 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

## Headers

- `LD-API-Version` 'beta', 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[], required
    - `content` string, required
    - `role` string, required
  - `model` object
  - `name` string, required
  - `modelConfigKey` string

## 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

## Other responses

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

## Changes

- **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/b2724c5174d1/schema)
