For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
      • POSTAdd AI models to the restricted list
      • POSTCreate a prompt snippet
      • POSTCreate agent optimization
      • POSTCreate agent optimization result
      • POSTCreate AI Config variation
      • POSTCreate an AI model config
      • POSTCreate an AI tool
      • POSTCreate new agent graph
      • POSTCreate new AI Config
      • DELDelete a prompt snippet
      • DELDelete agent graph
      • DELDelete AI Config
      • DELDelete AI Config variation
      • DELDelete AI tool
      • DELDelete an agent optimization
      • DELDelete an AI model config
      • GETGet a prompt snippet
      • GETGet agent graph
      • GETGet AI Config
      • GETGet AI Config metrics
      • GETGet AI Config metrics by variation
      • GETGet AI Config quick stats
      • GETGet AI Config variation
      • GETGet AI model config
      • GETGet AI tool
      • GETGet an agent optimization
      • GETList agent graphs
      • GETList agent optimization results for a run
      • GETList agent optimization runs
      • GETList agent optimization runs
      • GETList agent optimizations
      • GETList AI Configs
      • GETList AI model configs
      • GETList AI tool references
      • GETList AI tool versions
      • GETList AI tools
      • GETList all agent optimization results across versions
      • GETList prompt snippet references
      • GETList prompt snippet versions
      • GETList prompt snippets
      • DELRemove AI models from the restricted list
      • GETShow an AI Config's targeting
      • PATCHUpdate a prompt snippet
      • PATCHUpdate agent graph
      • PATCHUpdate AI Config
      • PATCHUpdate AI Config targeting
      • PATCHUpdate AI Config variation
      • PATCHUpdate AI tool
      • PATCHUpdate an agent optimization
      • PATCHUpdate an agent optimization result
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewAI Configs

Create AI Config variation

POST
/api/v2/projects/:projectKey/ai-configs/:configKey/variations
POST
/api/v2/projects/:projectKey/ai-configs/:configKey/variations
$curl -X POST https://app.launchdarkly.com/api/v2/projects/projectKey/ai-configs/configKey/variations \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "key": "key",
> "name": "name",
> "comment": "comment",
> "description": "description",
> "instructions": "instructions",
> "messages": [
> {
> "content": "content",
> "role": "role"
> },
> {
> "content": "content",
> "role": "role"
> }
> ],
> "model": "{}",
> "modelConfigKey": "modelConfigKey",
> "tools": [
> {
> "key": "key",
> "version": 0
> },
> {
> "key": "key",
> "version": 0
> }
> ],
> "toolKeys": [
> "toolKeys",
> "toolKeys"
> ],
> "judgeConfiguration": {
> "judges": [
> {
> "judgeConfigKey": "judgeConfigKey",
> "samplingRate": 0.7061401
> },
> {
> "judgeConfigKey": "judgeConfigKey",
> "samplingRate": 0.7061401
> }
> ]
> }
>}'
1{
2 "key": "key",
3 "_id": "_id",
4 "model": "{}",
5 "name": "name",
6 "createdAt": 6,
7 "version": 1,
8 "_links": {
9 "parent": {
10 "href": "href",
11 "type": "type"
12 }
13 },
14 "color": "color",
15 "comment": "comment",
16 "description": "description",
17 "instructions": "instructions",
18 "messages": [
19 {
20 "content": "content",
21 "role": "role"
22 },
23 {
24 "content": "content",
25 "role": "role"
26 }
27 ],
28 "modelConfigKey": "modelConfigKey",
29 "state": "state",
30 "_archivedAt": 5,
31 "_publishedAt": 5,
32 "tools": [
33 {
34 "key": "key",
35 "version": 2,
36 "customParameters": {
37 "key": ""
38 }
39 },
40 {
41 "key": "key",
42 "version": 2,
43 "customParameters": {
44 "key": ""
45 }
46 }
47 ],
48 "judgeConfiguration": {
49 "judges": [
50 {
51 "judgeConfigKey": "judgeConfigKey",
52 "samplingRate": 0.7061401
53 },
54 {
55 "judgeConfigKey": "judgeConfigKey",
56 "samplingRate": 0.7061401
57 }
58 ]
59 },
60 "judgingConfigKeys": [
61 "judgingConfigKeys",
62 "judgingConfigKeys"
63 ]
64}
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 } } ```
Was this page helpful?
Previous

Create an AI model config

Next
Built with

Create a new variation for a given AI Config.

The model in the request body requires a modelName and parameters, for example:

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

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequired
configKeystringRequired

Request

AI Config variation object to create
keystringRequired
namestringRequired
commentstringOptional

Human-readable description of this variation

descriptionstringOptional
Returns the description for the agent. This is only returned for agent variations.
instructionsstringOptional
Returns the instructions for the agent. This is only returned for agent variations.
messageslist of objectsOptional
modelobjectOptional
modelConfigKeystringOptional
toolslist of objectsOptional
List of tools to use for this variation. The latest version of the tool will be used.
toolKeyslist of stringsOptional
List of tool keys to use for this variation. The latest version of the tool will be used.
judgeConfigurationobjectOptional

Response

AI Config variation created
keystring
_idstring
modelobject
namestring
createdAtlong
versioninteger
_linksobject
colorstring
commentstring
descriptionstring
Returns the description for the agent. This is only returned for agent variations.
instructionsstring
Returns the instructions for the agent. This is only returned for agent variations.
messageslist of objects
modelConfigKeystring
statestring
_archivedAtlong
_publishedAtlong
toolslist of objects
judgeConfigurationobject
judgingConfigKeyslist of strings

Errors

400
Bad Request Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error