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 an AI model config

POST
/api/v2/projects/:projectKey/ai-configs/model-configs
POST
/api/v2/projects/:projectKey/ai-configs/model-configs
$curl -X POST https://app.launchdarkly.com/api/v2/projects/default/ai-configs/model-configs \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "name": "name",
> "key": "key",
> "id": "id",
> "icon": "icon",
> "provider": "provider",
> "params": "{}",
> "customParams": "{}",
> "tags": [
> "tags",
> "tags"
> ],
> "costPerInputToken": 0.8008281904610115,
> "costPerOutputToken": 6.027456183070403,
> "costPerCachedInputToken": 1.4658129805029452
>}'
1{
2 "name": "name",
3 "key": "key",
4 "id": "id",
5 "global": true,
6 "tags": [
7 "tags",
8 "tags"
9 ],
10 "version": 0,
11 "isRestricted": true,
12 "_access": {
13 "denied": [
14 {
15 "action": "action",
16 "reason": {
17 "effect": "allow",
18 "resources": [
19 "proj/*:env/*;qa_*:/flag/*"
20 ],
21 "notResources": [
22 "notResources",
23 "notResources"
24 ],
25 "actions": [
26 "*"
27 ],
28 "notActions": [
29 "string",
30 "string"
31 ],
32 "role_name": "role_name"
33 }
34 },
35 {
36 "action": "action",
37 "reason": {
38 "effect": "allow",
39 "resources": [
40 "proj/*:env/*;qa_*:/flag/*"
41 ],
42 "notResources": [
43 "notResources",
44 "notResources"
45 ],
46 "actions": [
47 "*"
48 ],
49 "notActions": [
50 "string",
51 "string"
52 ],
53 "role_name": "role_name"
54 }
55 }
56 ],
57 "allowed": [
58 {
59 "action": "action",
60 "reason": {
61 "effect": "allow",
62 "resources": [
63 "proj/*:env/*;qa_*:/flag/*"
64 ],
65 "notResources": [
66 "notResources",
67 "notResources"
68 ],
69 "actions": [
70 "*"
71 ],
72 "notActions": [
73 "string",
74 "string"
75 ],
76 "role_name": "role_name"
77 }
78 },
79 {
80 "action": "action",
81 "reason": {
82 "effect": "allow",
83 "resources": [
84 "proj/*:env/*;qa_*:/flag/*"
85 ],
86 "notResources": [
87 "notResources",
88 "notResources"
89 ],
90 "actions": [
91 "*"
92 ],
93 "notActions": [
94 "string",
95 "string"
96 ],
97 "role_name": "role_name"
98 }
99 }
100 ]
101 },
102 "icon": "icon",
103 "provider": "provider",
104 "params": "{}",
105 "customParams": "{}",
106 "costPerInputToken": 6.027456183070403,
107 "costPerOutputToken": 1.4658129805029452,
108 "costPerCachedInputToken": 5.962133916683182
109}
Create an AI model config. You can use this in any variation for any AI Config in your project.
Was this page helpful?
Previous

Create an AI tool

Next
Built with

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequired

Request

AI model config object to create
namestringRequired
Human readable name of the model
keystringRequired
Unique key for the model
idstringRequired
Identifier for the model, for use with third party providers
iconstringOptional
Icon for the model
providerstringOptional
Provider for the model
paramsobjectOptional
customParamsobjectOptional
tagslist of stringsOptional
costPerInputTokendoubleOptional
Cost per input token in USD
costPerOutputTokendoubleOptional
Cost per output token in USD
costPerCachedInputTokendoubleOptional
Cost per cached input token in USD

Response

Successful response
namestring
Human readable name of the model
keystring
Unique key for the model
idstring
Identifier for the model, for use with third party providers
globalboolean
Whether the model is global
tagslist of strings
versioninteger
isRestrictedboolean
Whether the model is restricted
_accessobject
iconstring
Icon for the model
providerstring
Provider for the model
paramsobject
customParamsobject
costPerInputTokendouble
Cost per input token in USD
costPerOutputTokendouble
Cost per output token in USD
costPerCachedInputTokendouble
Cost per cached input token in USD

Errors

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