curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"schema": "{}",
"maintainerId": "507f1f77bcf86cd799439011",
"maintainerTeamKey": "example-team-key",
"description": "description",
"customParameters": {
"requiresApproval": true,
"timeoutMs": 5000
},
"key": "key",
"tags": [
"support"
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools"
payload = {
"schema": "{}",
"maintainerId": "507f1f77bcf86cd799439011",
"maintainerTeamKey": "example-team-key",
"description": "description",
"customParameters": {
"requiresApproval": True,
"timeoutMs": 5000
},
"key": "key",
"tags": ["support"]
}
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({
schema: '{}',
maintainerId: '507f1f77bcf86cd799439011',
maintainerTeamKey: 'example-team-key',
description: 'description',
customParameters: {requiresApproval: true, timeoutMs: 5000},
key: 'key',
tags: ['support']
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools', 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-tools",
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([
'schema' => '{}',
'maintainerId' => '507f1f77bcf86cd799439011',
'maintainerTeamKey' => 'example-team-key',
'description' => 'description',
'customParameters' => [
'requiresApproval' => true,
'timeoutMs' => 5000
],
'key' => 'key',
'tags' => [
'support'
]
]),
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-tools"
payload := strings.NewReader("{\n \"schema\": \"{}\",\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"description\": \"description\",\n \"customParameters\": {\n \"requiresApproval\": true,\n \"timeoutMs\": 5000\n },\n \"key\": \"key\",\n \"tags\": [\n \"support\"\n ]\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-tools")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"schema\": \"{}\",\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"description\": \"description\",\n \"customParameters\": {\n \"requiresApproval\": true,\n \"timeoutMs\": 5000\n },\n \"key\": \"key\",\n \"tags\": [\n \"support\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools")
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 \"schema\": \"{}\",\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"description\": \"description\",\n \"customParameters\": {\n \"requiresApproval\": true,\n \"timeoutMs\": 5000\n },\n \"key\": \"key\",\n \"tags\": [\n \"support\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"schema": "{}",
"createdAt": 0,
"_maintainer": {
"kind": "kind"
},
"_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"
}
]
},
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"_site": {
"href": "href",
"type": "type"
},
"description": "description",
"customParameters": {
"requiresApproval": true,
"timeoutMs": 5000
},
"version": 2,
"key": "key",
"tags": [
"support"
]
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Create an AI tool
Create an AI tool
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"schema": "{}",
"maintainerId": "507f1f77bcf86cd799439011",
"maintainerTeamKey": "example-team-key",
"description": "description",
"customParameters": {
"requiresApproval": true,
"timeoutMs": 5000
},
"key": "key",
"tags": [
"support"
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools"
payload = {
"schema": "{}",
"maintainerId": "507f1f77bcf86cd799439011",
"maintainerTeamKey": "example-team-key",
"description": "description",
"customParameters": {
"requiresApproval": True,
"timeoutMs": 5000
},
"key": "key",
"tags": ["support"]
}
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({
schema: '{}',
maintainerId: '507f1f77bcf86cd799439011',
maintainerTeamKey: 'example-team-key',
description: 'description',
customParameters: {requiresApproval: true, timeoutMs: 5000},
key: 'key',
tags: ['support']
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools', 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-tools",
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([
'schema' => '{}',
'maintainerId' => '507f1f77bcf86cd799439011',
'maintainerTeamKey' => 'example-team-key',
'description' => 'description',
'customParameters' => [
'requiresApproval' => true,
'timeoutMs' => 5000
],
'key' => 'key',
'tags' => [
'support'
]
]),
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-tools"
payload := strings.NewReader("{\n \"schema\": \"{}\",\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"description\": \"description\",\n \"customParameters\": {\n \"requiresApproval\": true,\n \"timeoutMs\": 5000\n },\n \"key\": \"key\",\n \"tags\": [\n \"support\"\n ]\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-tools")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"schema\": \"{}\",\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"description\": \"description\",\n \"customParameters\": {\n \"requiresApproval\": true,\n \"timeoutMs\": 5000\n },\n \"key\": \"key\",\n \"tags\": [\n \"support\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/ai-tools")
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 \"schema\": \"{}\",\n \"maintainerId\": \"507f1f77bcf86cd799439011\",\n \"maintainerTeamKey\": \"example-team-key\",\n \"description\": \"description\",\n \"customParameters\": {\n \"requiresApproval\": true,\n \"timeoutMs\": 5000\n },\n \"key\": \"key\",\n \"tags\": [\n \"support\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"schema": "{}",
"createdAt": 0,
"_maintainer": {
"kind": "kind"
},
"_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"
}
]
},
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"_site": {
"href": "href",
"type": "type"
},
"description": "description",
"customParameters": {
"requiresApproval": true,
"timeoutMs": 5000
},
"version": 2,
"key": "key",
"tags": [
"support"
]
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Path Parameters
The project key
Body
AI tool object to create
A unique key for the tool
JSON Schema defining the tool's parameters for LLM consumption
The ID of the member who maintains this resource
"507f1f77bcf86cd799439011"
The key of the team that maintains this resource
"example-team-key"
A description of the tool
Custom metadata and configuration for application-level use (not sent to LLM)
{
"requiresApproval": true,
"timeoutMs": 5000
}
Tags for the tool. Tags can be used in custom role policies.
["support"]
Response
AI tool created
The tool key
JSON Schema defining the tool's parameters for LLM consumption
Version of the tool. Starts at 1, and each update that changes the description, schema, custom parameters, or tags creates a new version. Pass this value with key in a variation's tools: [{key, version}].
2
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"
}
]
}
The location and content type of related resources
Show child attributes
Show child attributes
{
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
}
Show child attributes
Show child attributes
{ "href": "href", "type": "type" }
The member or team that maintains this resource
- Option 1
- Option 2
Show child attributes
Show child attributes
{ "kind": "kind" }
A description of the tool
Custom metadata and configuration for application-level use (not sent to LLM)
{
"requiresApproval": true,
"timeoutMs": 5000
}
Tags for the tool. Tags can be used in custom role policies.
["support"]