Skip to main content
POST
Create new AI Config

Authorizations

Authorization
string
header
required

Path Parameters

projectKey
string
required

The project key

Body

application/json

AI Config object to create

key
string
required

A unique key for the AI Config

name
string
required

A human-readable name for the AI Config

description
string
default:""

A description of the AI Config

maintainerId
string

The ID of the member who maintains this resource

Example:

"507f1f77bcf86cd799439011"

maintainerTeamKey
string

The key of the team that maintains this resource

Example:

"example-team-key"

mode
enum<string>
default:completion

The AI Config mode

Available options:
agent,
completion,
judge
tags
string[]

Tags for this resource

viewKeys
string[]

Keys of the views to add the AI Config to

defaultVariation
object
Example:
evaluationMetricKey
string

Evaluation metric key for this config

isInverted
boolean

The success direction of a judge. Offline evaluations use it to decide whether a score passes.

  • true: A lower score is better. Use this for a judge that scores bad output, such as a toxicity or hallucination judge.
  • false: A higher score is better. Use this for a judge that scores good output, such as an accuracy or relevance judge.

Required for a custom judge. A custom judge has mode set to judge and a key that is not a built-in judge key. Built-in judge keys are ld-ai-judge-accuracy, ld-ai-judge-relevance, and ld-ai-judge-toxicity, with or without a -<timestamp> suffix such as ld-ai-judge-accuracy-1760000000000. For a built-in judge key, this field is optional, and the API always uses the built-in direction.

Do not send this field when mode is agent or completion.

This field is not in the schema's required list, because only custom judges need it.

The API returns a 400 error in these cases:

  • isInverted is required for a custom judge: ...: You create a custom judge without this field. Send true or false.
  • isInverted is only supported for judge mode: You send this field and mode is agent or completion. Remove the field, or set mode to judge.
  • isInverted is not supported: Custom judges are not available for your account. Remove the field from the request.
Example:

true

Response

AI Config created

description
string
required

A description of the AI Config

key
string
required

The AI Config key

name
string
required

The AI Config name

tags
string[]
required

Tags for this resource

version
integer
required

The version number of this resource

variations
object[]
required

The variations of this AI Config

createdAt
integer<int64>
required
updatedAt
integer<int64>
required
_access
object
Example:

The location and content type of related resources

Example:
_site
object
Example:
_maintainer
object

The member or team that maintains this resource

Example:
mode
enum<string>
default:completion

The AI Config mode

Available options:
agent,
completion,
judge
evaluationMetricKey
string

Evaluation metric key for this config

evaluationMetricKeys
string[]
deprecated

List of evaluation metric keys for this config

isInverted
boolean

The success direction of a judge. Offline evaluations use it to decide whether a score passes.

  • true: A lower score is better. Use this for a judge that scores bad output, such as a toxicity or hallucination judge.
  • false: A higher score is better. Use this for a judge that scores good output, such as an accuracy or relevance judge.

The response includes this field only when mode is judge. For a built-in judge key, the value is always the built-in direction. Built-in judge keys are ld-ai-judge-accuracy, ld-ai-judge-relevance, and ld-ai-judge-toxicity, with or without a -<timestamp> suffix such as ld-ai-judge-accuracy-1760000000000. A custom judge with no stored direction omits this field.

Example:

true

dependencies
object[]

Resources that depend on this config, grouped by type