Skip to main content
POST
Create an AI model config

Authorizations

Authorization
string
header
required

Path Parameters

projectKey
string
required

The project key

Body

application/json

AI model config object to create

name
string
required

Human readable name of the model

Example:

"GPT Image 2"

key
string
required

Unique key for the model config in the project, in the format Provider.model-id. Config variations reject other formats. Keys of global catalog models are reserved.

Example:

"OpenAI.gpt-image-2"

id
string
required

Model ID that the provider's API uses. Cannot be changed after creation.

Example:

"gpt-image-2"

maintainerId
string

The member ID of the maintainer. Not applied on create. To set the maintainer, update the model config after you create it.

Example:

"507f1f77bcf86cd799439011"

maintainerTeamKey
string

The key of the team that maintains the model config. Not applied on create. To set the maintainer, update the model config after you create it.

Example:

"example-team-key"

icon
string

Icon for the model

Example:

"openai"

provider
string

Provider for the model. Use the provider prefix of key. Cannot be changed after creation.

Example:

"OpenAI"

params
object

Freeform JSON object. LaunchDarkly does not validate the keys. In a model config, params and customParams hold parameters that the provider's API accepts, for example {"temperature": 0.7, "maxTokens": 4096}.

customParams
object

Freeform JSON object. LaunchDarkly does not validate the keys. In a model config, params and customParams hold parameters that the provider's API accepts, for example {"temperature": 0.7, "maxTokens": 4096}.

tags
string[]

Tags for the model config

Example:
costPerInputToken
number<double>

Cost per input token in USD

Example:

0.000005

costPerOutputToken
number<double>

Cost per output token in USD

Example:

0.00004

costPerCachedInputToken
number<double>

Cost per cached input token in USD

Example:

0.00000125

Response

Successful response

name
string
required

Human-readable name of the model

Example:

"GPT Image 2"

key
string
required

Unique key for the model config in the project, in the format Provider.model-id. Use this value as modelConfigKey on a config variation.

Example:

"OpenAI.gpt-image-2"

id
string
required

Model ID that the provider's API uses. This is different from key. Use this value as modelName on a config variation.

Example:

"gpt-image-2"

global
boolean
required

Whether the model is in the LaunchDarkly global catalog. Global models are read-only. Model configs that you create are always custom, with global set to false.

tags
string[]
required

Tags for the model config. Tags can be used in custom role policies.

Example:
version
integer
required

Version of the model config. Starts at 1, and each update that changes the model config adds a new version.

Example:

2

isRestricted
boolean
required

Whether the model is on the project's restricted list. Config variations cannot select a restricted model. To change this, use the add or remove restricted models endpoints.

_access
object
Example:
_maintainer
object

The member or team that maintains this resource

Example:
icon
string

Icon for the model

Example:

"openai"

provider
string

Provider for the model. Matches the provider prefix of key.

Example:

"OpenAI"

params
object

Freeform JSON object. LaunchDarkly does not validate the keys. In a model config, params and customParams hold parameters that the provider's API accepts, for example {"temperature": 0.7, "maxTokens": 4096}.

customParams
object

Freeform JSON object. LaunchDarkly does not validate the keys. In a model config, params and customParams hold parameters that the provider's API accepts, for example {"temperature": 0.7, "maxTokens": 4096}.

costPerInputToken
number<double>

Cost per input token in USD

Example:

0.000005

costPerOutputToken
number<double>

Cost per output token in USD

Example:

0.00004

costPerCachedInputToken
number<double>

Cost per cached input token in USD

Example:

0.00000125

usedInCount
integer

Number of distinct AgentControl configs that reference this model