curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"costPerOutputToken": 6.027456183070403,
"costPerInputToken": 0.8008281904610115,
"customParams": "{}",
"maintainerTeamKey": "example-team-key",
"icon": "icon",
"params": "{}",
"tags": [
"tags",
"tags"
],
"maintainerId": "507f1f77bcf86cd799439011",
"provider": "provider",
"name": "name",
"id": "id",
"key": "key",
"costPerCachedInputToken": 1.4658129805029452
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs"
payload = {
"costPerOutputToken": 6.027456183070403,
"costPerInputToken": 0.8008281904610115,
"customParams": "{}",
"maintainerTeamKey": "example-team-key",
"icon": "icon",
"params": "{}",
"tags": ["tags", "tags"],
"maintainerId": "507f1f77bcf86cd799439011",
"provider": "provider",
"name": "name",
"id": "id",
"key": "key",
"costPerCachedInputToken": 1.4658129805029452
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
costPerOutputToken: 6.027456183070403,
costPerInputToken: 0.8008281904610115,
customParams: '{}',
maintainerTeamKey: 'example-team-key',
icon: 'icon',
params: '{}',
tags: ['tags', 'tags'],
maintainerId: '507f1f77bcf86cd799439011',
provider: 'provider',
name: 'name',
id: 'id',
key: 'key',
costPerCachedInputToken: 1.4658129805029452
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'costPerOutputToken' => 6.027456183070403,
'costPerInputToken' => 0.8008281904610115,
'customParams' => '{}',
'maintainerTeamKey' => 'example-team-key',
'icon' => 'icon',
'params' => '{}',
'tags' => [
'tags',
'tags'
],
'maintainerId' => '507f1f77bcf86cd799439011',
'provider' => 'provider',
'name' => 'name',
'id' => 'id',
'key' => 'key',
'costPerCachedInputToken' => 1.4658129805029452
]),
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"
payload := strings.NewReader("{\n \"costPerOutputToken\": 6.027456183070403,\n \"costPerInputToken\": 0.8008281904610115,\n \"customParams\": \"{}\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"icon\": \"icon\",\n \"params\": \"{}\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"provider\": \"provider\",\n \"name\": \"name\",\n \"id\": \"id\",\n \"key\": \"key\",\n \"costPerCachedInputToken\": 1.4658129805029452\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"costPerOutputToken\": 6.027456183070403,\n \"costPerInputToken\": 0.8008281904610115,\n \"customParams\": \"{}\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"icon\": \"icon\",\n \"params\": \"{}\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"provider\": \"provider\",\n \"name\": \"name\",\n \"id\": \"id\",\n \"key\": \"key\",\n \"costPerCachedInputToken\": 1.4658129805029452\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"costPerOutputToken\": 6.027456183070403,\n \"costPerInputToken\": 0.8008281904610115,\n \"customParams\": \"{}\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"icon\": \"icon\",\n \"params\": \"{}\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"provider\": \"provider\",\n \"name\": \"name\",\n \"id\": \"id\",\n \"key\": \"key\",\n \"costPerCachedInputToken\": 1.4658129805029452\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"
}Create an AI model config
Create an AI model config. You can use this in any variation for any config in your project.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"costPerOutputToken": 6.027456183070403,
"costPerInputToken": 0.8008281904610115,
"customParams": "{}",
"maintainerTeamKey": "example-team-key",
"icon": "icon",
"params": "{}",
"tags": [
"tags",
"tags"
],
"maintainerId": "507f1f77bcf86cd799439011",
"provider": "provider",
"name": "name",
"id": "id",
"key": "key",
"costPerCachedInputToken": 1.4658129805029452
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs"
payload = {
"costPerOutputToken": 6.027456183070403,
"costPerInputToken": 0.8008281904610115,
"customParams": "{}",
"maintainerTeamKey": "example-team-key",
"icon": "icon",
"params": "{}",
"tags": ["tags", "tags"],
"maintainerId": "507f1f77bcf86cd799439011",
"provider": "provider",
"name": "name",
"id": "id",
"key": "key",
"costPerCachedInputToken": 1.4658129805029452
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
costPerOutputToken: 6.027456183070403,
costPerInputToken: 0.8008281904610115,
customParams: '{}',
maintainerTeamKey: 'example-team-key',
icon: 'icon',
params: '{}',
tags: ['tags', 'tags'],
maintainerId: '507f1f77bcf86cd799439011',
provider: 'provider',
name: 'name',
id: 'id',
key: 'key',
costPerCachedInputToken: 1.4658129805029452
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'costPerOutputToken' => 6.027456183070403,
'costPerInputToken' => 0.8008281904610115,
'customParams' => '{}',
'maintainerTeamKey' => 'example-team-key',
'icon' => 'icon',
'params' => '{}',
'tags' => [
'tags',
'tags'
],
'maintainerId' => '507f1f77bcf86cd799439011',
'provider' => 'provider',
'name' => 'name',
'id' => 'id',
'key' => 'key',
'costPerCachedInputToken' => 1.4658129805029452
]),
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"
payload := strings.NewReader("{\n \"costPerOutputToken\": 6.027456183070403,\n \"costPerInputToken\": 0.8008281904610115,\n \"customParams\": \"{}\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"icon\": \"icon\",\n \"params\": \"{}\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"provider\": \"provider\",\n \"name\": \"name\",\n \"id\": \"id\",\n \"key\": \"key\",\n \"costPerCachedInputToken\": 1.4658129805029452\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"costPerOutputToken\": 6.027456183070403,\n \"costPerInputToken\": 0.8008281904610115,\n \"customParams\": \"{}\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"icon\": \"icon\",\n \"params\": \"{}\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"provider\": \"provider\",\n \"name\": \"name\",\n \"id\": \"id\",\n \"key\": \"key\",\n \"costPerCachedInputToken\": 1.4658129805029452\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-configs/model-configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"costPerOutputToken\": 6.027456183070403,\n \"costPerInputToken\": 0.8008281904610115,\n \"customParams\": \"{}\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"icon\": \"icon\",\n \"params\": \"{}\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ],\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"provider\": \"provider\",\n \"name\": \"name\",\n \"id\": \"id\",\n \"key\": \"key\",\n \"costPerCachedInputToken\": 1.4658129805029452\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
Path Parameters
Body
AI model config object to create
Human readable name of the model
Unique key for the model
Identifier for the model, for use with third party providers
"507f1f77bcf86cd799439011"
"example-team-key"
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
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