Skip to main content
POST
/
api
/
v2
/
projects
/
{projectKey}
/
ai-configs
Create new AI Config
curl --request POST \
  --url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mode": "completion",
  "defaultVariation": {
    "judgeConfiguration": {
      "judges": [
        {
          "samplingRate": 0.7061401,
          "judgeConfigKey": "judgeConfigKey"
        },
        {
          "samplingRate": 0.7061401,
          "judgeConfigKey": "judgeConfigKey"
        }
      ]
    },
    "instructions": "instructions",
    "toolKeys": [
      "toolKeys",
      "toolKeys"
    ],
    "name": "name",
    "description": "description",
    "messages": [
      {
        "role": "role",
        "content": "content"
      },
      {
        "role": "role",
        "content": "content"
      }
    ],
    "comment": "comment",
    "model": "{}",
    "modelConfigKey": "modelConfigKey",
    "tools": [
      {
        "version": 0,
        "key": "key"
      },
      {
        "version": 0,
        "key": "key"
      }
    ],
    "key": "key"
  },
  "maintainerId": "507f1f77bcf86cd799439011",
  "maintainerTeamKey": "example-team-key",
  "name": "name",
  "description": "",
  "evaluationMetricKey": "evaluationMetricKey",
  "key": "key",
  "isInverted": true,
  "tags": [
    "tags",
    "tags"
  ]
}
'
{
  "_maintainer": {
    "kind": "kind"
  },
  "_links": {
    "parent": {
      "href": "href",
      "type": "type"
    },
    "self": {
      "href": "href",
      "type": "type"
    }
  },
  "description": "description",
  "evaluationMetricKey": "evaluationMetricKey",
  "version": 0,
  "tags": [
    "tags",
    "tags"
  ],
  "dependencies": [
    {
      "type": "agent-graph",
      "key": "key"
    },
    {
      "type": "agent-graph",
      "key": "key"
    }
  ],
  "mode": "completion",
  "createdAt": 9,
  "evaluationMetricKeys": [
    "evaluationMetricKeys",
    "evaluationMetricKeys"
  ],
  "_access": {
    "allowed": [
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      },
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      }
    ],
    "denied": [
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      },
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      }
    ]
  },
  "variations": [
    {
      "judgeConfiguration": {
        "judges": [
          {
            "samplingRate": 0.7061401,
            "judgeConfigKey": "judgeConfigKey"
          },
          {
            "samplingRate": 0.7061401,
            "judgeConfigKey": "judgeConfigKey"
          }
        ]
      },
      "instructions": "instructions",
      "color": "color",
      "_links": {
        "parent": {
          "href": "href",
          "type": "type"
        }
      },
      "description": "description",
      "modelConfigKey": "modelConfigKey",
      "judgingConfigKeys": [
        "judgingConfigKeys",
        "judgingConfigKeys"
      ],
      "version": 1,
      "tools": [
        {
          "customParameters": {
            "key": ""
          },
          "version": 2,
          "key": "key"
        },
        {
          "customParameters": {
            "key": ""
          },
          "version": 2,
          "key": "key"
        }
      ],
      "createdAt": 6,
      "_publishedAt": 5,
      "_archivedAt": 5,
      "name": "name",
      "messages": [
        {
          "role": "role",
          "content": "content"
        },
        {
          "role": "role",
          "content": "content"
        }
      ],
      "comment": "comment",
      "model": "{}",
      "_id": "_id",
      "state": "state",
      "key": "key"
    },
    {
      "judgeConfiguration": {
        "judges": [
          {
            "samplingRate": 0.7061401,
            "judgeConfigKey": "judgeConfigKey"
          },
          {
            "samplingRate": 0.7061401,
            "judgeConfigKey": "judgeConfigKey"
          }
        ]
      },
      "instructions": "instructions",
      "color": "color",
      "_links": {
        "parent": {
          "href": "href",
          "type": "type"
        }
      },
      "description": "description",
      "modelConfigKey": "modelConfigKey",
      "judgingConfigKeys": [
        "judgingConfigKeys",
        "judgingConfigKeys"
      ],
      "version": 1,
      "tools": [
        {
          "customParameters": {
            "key": ""
          },
          "version": 2,
          "key": "key"
        },
        {
          "customParameters": {
            "key": ""
          },
          "version": 2,
          "key": "key"
        }
      ],
      "createdAt": 6,
      "_publishedAt": 5,
      "_archivedAt": 5,
      "name": "name",
      "messages": [
        {
          "role": "role",
          "content": "content"
        },
        {
          "role": "role",
          "content": "content"
        }
      ],
      "comment": "comment",
      "model": "{}",
      "_id": "_id",
      "state": "state",
      "key": "key"
    }
  ],
  "name": "name",
  "key": "key",
  "isInverted": true,
  "updatedAt": 3
}

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Path Parameters

projectKey
string
required

Body

application/json

AI Config object to create

key
string
required
name
string
required
description
string
default:""
maintainerId
string
Example:

"507f1f77bcf86cd799439011"

maintainerTeamKey
string
Example:

"example-team-key"

mode
enum<string>
default:completion
Available options:
agent,
completion,
judge
tags
string[]
defaultVariation
object
Example:
{
"judgeConfiguration": {
"judges": [
{
"samplingRate": 0.7061401,
"judgeConfigKey": "judgeConfigKey"
},
{
"samplingRate": 0.7061401,
"judgeConfigKey": "judgeConfigKey"
}
]
},
"instructions": "instructions",
"toolKeys": ["toolKeys", "toolKeys"],
"name": "name",
"description": "description",
"messages": [
{ "role": "role", "content": "content" },
{ "role": "role", "content": "content" }
],
"comment": "comment",
"model": "{}",
"modelConfigKey": "modelConfigKey",
"tools": [
{ "version": 0, "key": "key" },
{ "version": 0, "key": "key" }
],
"key": "key"
}
evaluationMetricKey
string

Evaluation metric key for this AI Config

isInverted
boolean

Whether the evaluation metric is inverted, meaning a lower value is better if set as true

Response

AI Config created

description
string
required
key
string
required
name
string
required
tags
string[]
required
version
integer
required
variations
object[]
required
createdAt
integer<int64>
required
updatedAt
integer<int64>
required
_access
object
Example:
{
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
]
}

The location and content type of related resources

Example:
{
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
}
_maintainer
object
Example:
{ "kind": "kind" }
mode
enum<string>
default:completion
Available options:
agent,
completion,
judge
evaluationMetricKey
string

Evaluation metric key for this AI Config

evaluationMetricKeys
string[]
deprecated

List of evaluation metric keys for this AI Config

isInverted
boolean

Whether the evaluation metric is inverted, meaning a lower value is better if set as true

dependencies
object[]

Resources that depend on this AI Config, grouped by type