curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"costPerOutputToken": 6.027456183070403,
"maintainerId": "507f1f77bcf86cd799439011",
"costPerInputToken": 0.8008281904610115,
"provider": "provider",
"customParams": "{}",
"name": "name",
"maintainerTeamKey": "example-team-key",
"id": "id",
"params": "{}",
"costPerCachedInputToken": 1.4658129805029452,
"tags": [
"tags",
"tags"
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}"
payload = {
"costPerOutputToken": 6.027456183070403,
"maintainerId": "507f1f77bcf86cd799439011",
"costPerInputToken": 0.8008281904610115,
"provider": "provider",
"customParams": "{}",
"name": "name",
"maintainerTeamKey": "example-team-key",
"id": "id",
"params": "{}",
"costPerCachedInputToken": 1.4658129805029452,
"tags": ["tags", "tags"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
costPerOutputToken: 6.027456183070403,
maintainerId: '507f1f77bcf86cd799439011',
costPerInputToken: 0.8008281904610115,
provider: 'provider',
customParams: '{}',
name: 'name',
maintainerTeamKey: 'example-team-key',
id: 'id',
params: '{}',
costPerCachedInputToken: 1.4658129805029452,
tags: ['tags', 'tags']
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'costPerOutputToken' => 6.027456183070403,
'maintainerId' => '507f1f77bcf86cd799439011',
'costPerInputToken' => 0.8008281904610115,
'provider' => 'provider',
'customParams' => '{}',
'name' => 'name',
'maintainerTeamKey' => 'example-team-key',
'id' => 'id',
'params' => '{}',
'costPerCachedInputToken' => 1.4658129805029452,
'tags' => [
'tags',
'tags'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}"
payload := strings.NewReader("{\n \"costPerOutputToken\": 6.027456183070403,\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"costPerInputToken\": 0.8008281904610115,\n \"provider\": \"provider\",\n \"customParams\": \"{}\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"id\": \"id\",\n \"params\": \"{}\",\n \"costPerCachedInputToken\": 1.4658129805029452,\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"costPerOutputToken\": 6.027456183070403,\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"costPerInputToken\": 0.8008281904610115,\n \"provider\": \"provider\",\n \"customParams\": \"{}\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"id\": \"id\",\n \"params\": \"{}\",\n \"costPerCachedInputToken\": 1.4658129805029452,\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"costPerOutputToken\": 6.027456183070403,\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"costPerInputToken\": 0.8008281904610115,\n \"provider\": \"provider\",\n \"customParams\": \"{}\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"id\": \"id\",\n \"params\": \"{}\",\n \"costPerCachedInputToken\": 1.4658129805029452,\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"costPerOutputToken": 1.4658129805029452,
"_maintainer": {
"kind": "kind"
},
"costPerInputToken": 6.027456183070403,
"customParams": "{}",
"icon": "icon",
"global": true,
"params": "{}",
"version": 0,
"tags": [
"tags",
"tags"
],
"_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"
}
]
},
"usedInCount": 5,
"provider": "provider",
"name": "name",
"id": "id",
"isRestricted": true,
"key": "key",
"costPerCachedInputToken": 5.962133916683182
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Update an AI model config
Update an AI model config.
curl --request PATCH \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"costPerOutputToken": 6.027456183070403,
"maintainerId": "507f1f77bcf86cd799439011",
"costPerInputToken": 0.8008281904610115,
"provider": "provider",
"customParams": "{}",
"name": "name",
"maintainerTeamKey": "example-team-key",
"id": "id",
"params": "{}",
"costPerCachedInputToken": 1.4658129805029452,
"tags": [
"tags",
"tags"
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}"
payload = {
"costPerOutputToken": 6.027456183070403,
"maintainerId": "507f1f77bcf86cd799439011",
"costPerInputToken": 0.8008281904610115,
"provider": "provider",
"customParams": "{}",
"name": "name",
"maintainerTeamKey": "example-team-key",
"id": "id",
"params": "{}",
"costPerCachedInputToken": 1.4658129805029452,
"tags": ["tags", "tags"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
costPerOutputToken: 6.027456183070403,
maintainerId: '507f1f77bcf86cd799439011',
costPerInputToken: 0.8008281904610115,
provider: 'provider',
customParams: '{}',
name: 'name',
maintainerTeamKey: 'example-team-key',
id: 'id',
params: '{}',
costPerCachedInputToken: 1.4658129805029452,
tags: ['tags', 'tags']
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'costPerOutputToken' => 6.027456183070403,
'maintainerId' => '507f1f77bcf86cd799439011',
'costPerInputToken' => 0.8008281904610115,
'provider' => 'provider',
'customParams' => '{}',
'name' => 'name',
'maintainerTeamKey' => 'example-team-key',
'id' => 'id',
'params' => '{}',
'costPerCachedInputToken' => 1.4658129805029452,
'tags' => [
'tags',
'tags'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}"
payload := strings.NewReader("{\n \"costPerOutputToken\": 6.027456183070403,\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"costPerInputToken\": 0.8008281904610115,\n \"provider\": \"provider\",\n \"customParams\": \"{}\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"id\": \"id\",\n \"params\": \"{}\",\n \"costPerCachedInputToken\": 1.4658129805029452,\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"costPerOutputToken\": 6.027456183070403,\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"costPerInputToken\": 0.8008281904610115,\n \"provider\": \"provider\",\n \"customParams\": \"{}\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"id\": \"id\",\n \"params\": \"{}\",\n \"costPerCachedInputToken\": 1.4658129805029452,\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs/{modelConfigKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"costPerOutputToken\": 6.027456183070403,\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"costPerInputToken\": 0.8008281904610115,\n \"provider\": \"provider\",\n \"customParams\": \"{}\",\n \"name\": \"name\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"id\": \"id\",\n \"params\": \"{}\",\n \"costPerCachedInputToken\": 1.4658129805029452,\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"costPerOutputToken": 1.4658129805029452,
"_maintainer": {
"kind": "kind"
},
"costPerInputToken": 6.027456183070403,
"customParams": "{}",
"icon": "icon",
"global": true,
"params": "{}",
"version": 0,
"tags": [
"tags",
"tags"
],
"_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"
}
]
},
"usedInCount": 5,
"provider": "provider",
"name": "name",
"id": "id",
"isRestricted": true,
"key": "key",
"costPerCachedInputToken": 5.962133916683182
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Body
AI model config object to update
Immutable provider model identifier. To use a different model identifier, create a new model config.
Immutable model provider. To use a different provider, create a new model config.
Human-readable name of the model
Cost per input token in USD
Cost per output token in USD
Cost per cached input token in USD
"507f1f77bcf86cd799439011"
"example-team-key"
Response
Successful response
Human-readable name of the model
Unique key for the model
Identifier for the model, for use with third party providers
Whether the model is global
Whether the model is restricted
Show child attributes
Show child attributes
{ "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" } ] }
- Option 1
- Option 2
Show child attributes
Show child attributes
{ "kind": "kind" }
Icon for the model
Provider for the model
Cost per input token in USD
Cost per output token in USD
Cost per cached input token in USD
Number of distinct AgentControl configs that reference this model