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

Update an agent optimization

PATCH
/api/v2/projects/:projectKey/agent-optimizations/:optimizationKey
PATCH
/api/v2/projects/:projectKey/agent-optimizations/:optimizationKey
$curl -X PATCH https://app.launchdarkly.com/api/v2/projects/projectKey/agent-optimizations/optimizationKey \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "maxAttempts": 0,
> "modelChoices": [
> "modelChoices",
> "modelChoices"
> ],
> "judgeModel": "judgeModel",
> "variableChoices": [
> {
> "key": ""
> },
> {
> "key": ""
> }
> ],
> "acceptanceStatements": [
> {
> "statement": "statement",
> "threshold": 6.027456183070403
> },
> {
> "statement": "statement",
> "threshold": 6.027456183070403
> }
> ],
> "judges": [
> {
> "key": "key",
> "threshold": 1.4658129805029452
> },
> {
> "key": "key",
> "threshold": 1.4658129805029452
> }
> ],
> "userInputOptions": [
> "userInputOptions",
> "userInputOptions"
> ],
> "groundTruthResponses": [
> "groundTruthResponses",
> "groundTruthResponses"
> ],
> "metricKey": "metricKey",
> "tokenLimit": 6,
> "variationKey": "variationKey",
> "label": "label",
> "latencyOptimization": true,
> "tokenOptimization": true,
> "autoCommit": true
>}'
1{
2 "id": "id",
3 "key": "key",
4 "aiConfigKey": "aiConfigKey",
5 "maxAttempts": 0,
6 "modelChoices": [
7 "modelChoices",
8 "modelChoices"
9 ],
10 "judgeModel": "judgeModel",
11 "variableChoices": [
12 {
13 "key": ""
14 },
15 {
16 "key": ""
17 }
18 ],
19 "acceptanceStatements": [
20 {
21 "statement": "statement",
22 "threshold": 6.027456183070403
23 },
24 {
25 "statement": "statement",
26 "threshold": 6.027456183070403
27 }
28 ],
29 "judges": [
30 {
31 "key": "key",
32 "threshold": 1.4658129805029452
33 },
34 {
35 "key": "key",
36 "threshold": 1.4658129805029452
37 }
38 ],
39 "userInputOptions": [
40 "userInputOptions",
41 "userInputOptions"
42 ],
43 "groundTruthResponses": [
44 "groundTruthResponses",
45 "groundTruthResponses"
46 ],
47 "version": 5,
48 "createdAt": 2,
49 "_access": {
50 "denied": [
51 {
52 "action": "action",
53 "reason": {
54 "effect": "allow",
55 "resources": [
56 "proj/*:env/*;qa_*:/flag/*"
57 ],
58 "notResources": [
59 "notResources",
60 "notResources"
61 ],
62 "actions": [
63 "*"
64 ],
65 "notActions": [
66 "string",
67 "string"
68 ],
69 "role_name": "role_name"
70 }
71 },
72 {
73 "action": "action",
74 "reason": {
75 "effect": "allow",
76 "resources": [
77 "proj/*:env/*;qa_*:/flag/*"
78 ],
79 "notResources": [
80 "notResources",
81 "notResources"
82 ],
83 "actions": [
84 "*"
85 ],
86 "notActions": [
87 "string",
88 "string"
89 ],
90 "role_name": "role_name"
91 }
92 }
93 ],
94 "allowed": [
95 {
96 "action": "action",
97 "reason": {
98 "effect": "allow",
99 "resources": [
100 "proj/*:env/*;qa_*:/flag/*"
101 ],
102 "notResources": [
103 "notResources",
104 "notResources"
105 ],
106 "actions": [
107 "*"
108 ],
109 "notActions": [
110 "string",
111 "string"
112 ],
113 "role_name": "role_name"
114 }
115 },
116 {
117 "action": "action",
118 "reason": {
119 "effect": "allow",
120 "resources": [
121 "proj/*:env/*;qa_*:/flag/*"
122 ],
123 "notResources": [
124 "notResources",
125 "notResources"
126 ],
127 "actions": [
128 "*"
129 ],
130 "notActions": [
131 "string",
132 "string"
133 ],
134 "role_name": "role_name"
135 }
136 }
137 ]
138 },
139 "_links": {
140 "self": {
141 "href": "href",
142 "type": "type"
143 },
144 "parent": {
145 "href": "href",
146 "type": "type"
147 }
148 },
149 "metricKey": "metricKey",
150 "tokenLimit": 5,
151 "variationKey": "variationKey",
152 "label": "label",
153 "latencyOptimization": true,
154 "tokenOptimization": true,
155 "autoCommit": true
156}
Update an existing agent optimization. Creates a new version of the optimization.
Was this page helpful?
Previous

Update an agent optimization result

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequired
optimizationKeystringRequired

Request

Agent optimization fields to update
maxAttemptsintegerOptional
modelChoiceslist of stringsOptional
judgeModelstringOptional
variableChoiceslist of maps from strings to anyOptional
acceptanceStatementslist of objectsOptional
judgeslist of objectsOptional
userInputOptionslist of stringsOptional
groundTruthResponseslist of stringsOptional
metricKeystringOptional
tokenLimitintegerOptional
variationKeystringOptional
labelstringOptional
latencyOptimizationbooleanOptional
tokenOptimizationbooleanOptional
autoCommitbooleanOptional

Response

Agent optimization updated
idstring
keystring
aiConfigKeystring
maxAttemptsinteger
modelChoiceslist of strings
judgeModelstring
variableChoiceslist of maps from strings to any
acceptanceStatementslist of objects
judgeslist of objects
userInputOptionslist of strings
groundTruthResponseslist of strings
versioninteger
createdAtlong
_accessobject
_linksobject
The location and content type of related resources
metricKeystring
tokenLimitinteger
variationKeystring
labelstring
latencyOptimizationboolean
tokenOptimizationboolean
autoCommitboolean

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error