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 agent optimization result

POST
/api/v2/projects/:projectKey/agent-optimizations/:optimizationKey/results
POST
/api/v2/projects/:projectKey/agent-optimizations/:optimizationKey/results
$curl -X POST https://app.launchdarkly.com/api/v2/projects/projectKey/agent-optimizations/optimizationKey/results \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "runId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
> "agentOptimizationVersion": 0,
> "iteration": 6,
> "instructions": "instructions",
> "userInput": "userInput",
> "parameters": {
> "key": ""
> }
>}'
1{
2 "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
3 "runId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
4 "agentOptimizationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
5 "agentOptimizationVersion": 0,
6 "status": "RUNNING",
7 "activity": "PENDING",
8 "iteration": 6,
9 "instructions": "instructions",
10 "userInput": "userInput",
11 "createdAt": 5,
12 "updatedAt": 2,
13 "_access": {
14 "denied": [
15 {
16 "action": "action",
17 "reason": {
18 "effect": "allow",
19 "resources": [
20 "proj/*:env/*;qa_*:/flag/*"
21 ],
22 "notResources": [
23 "notResources",
24 "notResources"
25 ],
26 "actions": [
27 "*"
28 ],
29 "notActions": [
30 "string",
31 "string"
32 ],
33 "role_name": "role_name"
34 }
35 },
36 {
37 "action": "action",
38 "reason": {
39 "effect": "allow",
40 "resources": [
41 "proj/*:env/*;qa_*:/flag/*"
42 ],
43 "notResources": [
44 "notResources",
45 "notResources"
46 ],
47 "actions": [
48 "*"
49 ],
50 "notActions": [
51 "string",
52 "string"
53 ],
54 "role_name": "role_name"
55 }
56 }
57 ],
58 "allowed": [
59 {
60 "action": "action",
61 "reason": {
62 "effect": "allow",
63 "resources": [
64 "proj/*:env/*;qa_*:/flag/*"
65 ],
66 "notResources": [
67 "notResources",
68 "notResources"
69 ],
70 "actions": [
71 "*"
72 ],
73 "notActions": [
74 "string",
75 "string"
76 ],
77 "role_name": "role_name"
78 }
79 },
80 {
81 "action": "action",
82 "reason": {
83 "effect": "allow",
84 "resources": [
85 "proj/*:env/*;qa_*:/flag/*"
86 ],
87 "notResources": [
88 "notResources",
89 "notResources"
90 ],
91 "actions": [
92 "*"
93 ],
94 "notActions": [
95 "string",
96 "string"
97 ],
98 "role_name": "role_name"
99 }
100 }
101 ]
102 },
103 "_links": {
104 "self": {
105 "href": "href",
106 "type": "type"
107 },
108 "parent": {
109 "href": "href",
110 "type": "type"
111 }
112 },
113 "parameters": {
114 "key": ""
115 },
116 "completionResponse": "completionResponse",
117 "variation": {
118 "key": ""
119 },
120 "scores": {
121 "key": ""
122 },
123 "generationTokens": {
124 "key": ""
125 },
126 "evaluationTokens": {
127 "key": ""
128 },
129 "generationLatency": 1,
130 "evaluationLatencies": {
131 "key": ""
132 },
133 "completedAt": 5,
134 "createdVariationKey": "createdVariationKey"
135}
Create a new result for an agent optimization run.
Was this page helpful?
Previous

Create AI Config variation

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequired
optimizationKeystringRequired

Request

Agent optimization result to create
runIdstringRequiredformat: "uuid"
agentOptimizationVersionintegerRequired
iterationintegerRequired
instructionsstringRequired
userInputstringRequired
parametersmap from strings to anyOptional

Response

Agent optimization result created
idstringformat: "uuid"
runIdstringformat: "uuid"
agentOptimizationIdstringformat: "uuid"
agentOptimizationVersioninteger
statusenum
Allowed values:
activityenum
iterationinteger
instructionsstring
userInputstring
createdAtlong
updatedAtlong
_accessobject
_linksobject
The location and content type of related resources
parametersmap from strings to any
completionResponsestring
variationmap from strings to any
scoresmap from strings to any
generationTokensmap from strings to any
evaluationTokensmap from strings to any
generationLatencyinteger
evaluationLatenciesmap from strings to any
completedAtlong
createdVariationKeystring

Errors

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