---
title: "Create an AI model config"
method: POST
path: "/api/v2/projects/{projectKey}/ai-configs/model-configs"
tags: ["AI Configs"]
---

# Create an AI model config

`POST /api/v2/projects/{projectKey}/ai-configs/model-configs`

Create an AI model config. You can use this in any variation for any AI Config in your project.

## Path parameters

- `projectKey` string, required

## Request body

- ModelConfigPost
  - `name` string, required — Human readable name of the model
  - `key` string, required — Unique key for the model
  - `id` string, required — Identifier for the model, for use with third party providers
  - `icon` string — Icon for the model
  - `provider` string — Provider for the model
  - `params` object
  - `customParams` object
  - `tags` string[]
  - `costPerInputToken` number, double — Cost per input token in USD
  - `costPerOutputToken` number, double — Cost per output token in USD

## Response `200`

Successful response

- ModelConfig
  - `_access` AiConfigsAccess
    - `denied` AiConfigsAccessDenied[], required
      - `action` string, required
      - `reason` AiConfigsAccessDeniedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
    - `allowed` AiConfigsAccessAllowedRep[], required
      - `action` string, required
      - `reason` AiConfigsAccessAllowedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
  - `name` string, required — Human readable name of the model
  - `key` string, required — Unique key for the model
  - `id` string, required — Identifier for the model, for use with third party providers
  - `icon` string — Icon for the model
  - `provider` string — Provider for the model
  - `global` boolean, required — Whether the model is global
  - `params` object
  - `customParams` object
  - `tags` string[], required
  - `version` integer, required
  - `costPerInputToken` number, double — Cost per input token in USD
  - `costPerOutputToken` number, double — Cost per output token in USD
  - `isRestricted` boolean, required — Whether the model is restricted

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `404` — Not found
- `500` — Internal server error

## Changes

- **2026-02-28** `69c5c9aafe78` — 1 warning, 2 info
  - deleted the `header` request parameter `LD-API-Version`
  - api tag `AI Configs` added
  - api tag `AI Configs (beta)` removed

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/projects/:projectKey/ai-configs/model-configs/post.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
