---
title: "Create a prompt version"
description: "Use `{{variable_name}}` syntax in messages to define template variables. The new version becomes the prompt's current draft, and every earlier version becomes read-only. To deploy it, commit it, then use Deploy a prompt version."
---

<a id="playground-button:docs/apis/prompts/create-prompt-version"></a>

**POST** `https://api.respan.ai/api/prompts/{prompt_id}/versions/`

Use `{{variable_name}}` syntax in messages to define template variables. The new version becomes the prompt's current draft, and every earlier version becomes read-only. To deploy it, commit it, then use Deploy a prompt version.

## Servers

`https://api.respan.ai`: Respan API Server

<a id="request.auth"></a>

## Authentication

<a id="request.auth.Authorization"></a>

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


**Or:**

### DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: `bearer`; format: `Dashboard JWT`.


```http
Authorization: Bearer $RESPAN_DASHBOARD_JWT
```


<a id="request.path"></a>

## Path parameters


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| <a id="request.path.prompt_id"></a>`prompt_id` | `string` | Required | The unique prompt identifier. |


<a id="request"></a>

## Request body

A request body is required.

### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Required body | Example: `{"description":"Production version with context awareness","messages":[{"role":"system","content":"You are a helpful customer support assistant. Context: {{context}}"},{"role":"user","content":"{{user_query}}"}],"model":"gpt-6-luna","temperature":0.7,"max_tokens":2048,"variables":{"context":"Product information and FAQs","user_query":"How do I reset my password?"},"deploy":false}` |
| <a id="request.body.description"></a>`description` | `string` | Optional | Version description. |
| <a id="request.body.messages"></a>`messages` | `array<object>` | Required in parent | Non-empty message array. Each message requires `role`; `content` may be omitted, an empty string, `null`, or an empty array.<br />Minimum items: `1` |
| `messages[]` | `object` | Array item | Additional properties are allowed |
| `messages[].role` | `string` | Required in parent | - |
| `messages[].content` | `string or null or array<any>` | Optional | - |
| `messages[].content (oneOf 1)` | `string or null` | Schema variant | - |
| `messages[].content (oneOf 2)` | `array<any>` | Schema variant | - |
| `messages[].content (oneOf 2)[]` | `any` | Array item | - |
| <a id="request.body.thinking"></a>`thinking` | `object or null` | Optional | Optional provider-specific reasoning configuration. |
| <a id="request.body.model"></a>`model` | `string` | Optional | Primary model for this version.<br />Example: `"gpt-6-luna"` |
| <a id="request.body.stream"></a>`stream` | `boolean` | Optional | Whether to stream responses.<br />Default: `false` |
| <a id="request.body.temperature"></a>`temperature` | `number` | Optional | Sampling temperature (0-2).<br />Example: `0.7` |
| <a id="request.body.max_tokens"></a>`max_tokens` | `integer` | Optional | Maximum tokens to generate.<br />Example: `1024` |
| <a id="request.body.top_p"></a>`top_p` | `number` | Optional | Nucleus sampling parameter.<br />Example: `1` |
| <a id="request.body.frequency_penalty"></a>`frequency_penalty` | `number` | Optional | Frequency penalty (-2 to 2).<br />Example: `0` |
| <a id="request.body.presence_penalty"></a>`presence_penalty` | `number` | Optional | Presence penalty (-2 to 2).<br />Example: `0` |
| <a id="request.body.reasoning_effort"></a>`reasoning_effort` | `string or null` | Optional | - |
| <a id="request.body.verbosity"></a>`verbosity` | `string or null` | Optional | - |
| <a id="request.body.seed"></a>`seed` | `integer or null` | Optional | - |
| <a id="request.body.variables"></a>`variables` | `object` | Optional | Template variables and their default values. |
| <a id="request.body.tools"></a>`tools` | `array<object>` | Optional | Tools available to the model. |
| `tools[]` | `object` | Array item | - |
| <a id="request.body.tool_choice"></a>`tool_choice` | `string or null or object` | Optional | - |
| `tool_choice (oneOf 1)` | `string or null` | Schema variant | - |
| `tool_choice (oneOf 2)` | `object` | Schema variant | - |
| <a id="request.body.response_format"></a>`response_format` | `object or null` | Optional | Structured output / response format configuration. |
| <a id="request.body.json_schema"></a>`json_schema` | `object or null` | Optional | JSON schema used for structured outputs when configured. |
| <a id="request.body.is_enforcing_response_format"></a>`is_enforcing_response_format` | `boolean` | Optional | Whether to strictly enforce the response format.<br />Default: `false` |


<details class="api-schema-source">
<summary>OpenAPI request schema</summary>


```json
{
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Version description."
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string"
          },
          "content": {
            "oneOf": [
              {
                "type": "string",
                "nullable": true
              },
              {
                "type": "array",
                "items": {}
              }
            ]
          }
        },
        "additionalProperties": true
      },
      "description": "Non-empty message array. Each message requires `role`; `content` may be omitted, an empty string, `null`, or an empty array.",
      "minItems": 1
    },
    "thinking": {
      "type": "object",
      "nullable": true,
      "description": "Optional provider-specific reasoning configuration."
    },
    "model": {
      "type": "string",
      "description": "Primary model for this version.",
      "example": "gpt-6-luna"
    },
    "stream": {
      "type": "boolean",
      "description": "Whether to stream responses.",
      "default": false
    },
    "temperature": {
      "type": "number",
      "description": "Sampling temperature (0-2).",
      "example": 0.7
    },
    "max_tokens": {
      "type": "integer",
      "description": "Maximum tokens to generate.",
      "example": 1024
    },
    "top_p": {
      "type": "number",
      "description": "Nucleus sampling parameter.",
      "example": 1
    },
    "frequency_penalty": {
      "type": "number",
      "description": "Frequency penalty (-2 to 2).",
      "example": 0
    },
    "presence_penalty": {
      "type": "number",
      "description": "Presence penalty (-2 to 2).",
      "example": 0
    },
    "reasoning_effort": {
      "type": "string",
      "nullable": true
    },
    "verbosity": {
      "type": "string",
      "nullable": true
    },
    "seed": {
      "type": "integer",
      "nullable": true
    },
    "variables": {
      "type": "object",
      "description": "Template variables and their default values."
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Tools available to the model."
    },
    "tool_choice": {
      "oneOf": [
        {
          "type": "string",
          "nullable": true
        },
        {
          "type": "object"
        }
      ]
    },
    "response_format": {
      "type": "object",
      "nullable": true,
      "description": "Structured output / response format configuration."
    },
    "json_schema": {
      "type": "object",
      "nullable": true,
      "description": "JSON schema used for structured outputs when configured."
    },
    "is_enforcing_response_format": {
      "type": "boolean",
      "description": "Whether to strictly enforce the response format.",
      "default": false
    }
  },
  "required": [
    "messages"
  ],
  "example": {
    "description": "Production version with context awareness",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful customer support assistant. Context: {{context}}"
      },
      {
        "role": "user",
        "content": "{{user_query}}"
      }
    ],
    "model": "gpt-6-luna",
    "temperature": 0.7,
    "max_tokens": 2048,
    "variables": {
      "context": "Product information and FAQs",
      "user_query": "How do I reset my password?"
    },
    "deploy": false
  }
}
```

</details>

<a id="response"></a>

## Responses

### 201

Prompt version created successfully.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Example: `{"id":"pv_abc123","prompt_version_id":"pv_abc123","version":3,"description":"Added context variable","messages":[{"role":"system","content":"You are a helpful assistant. Context: {{context}}"},{"role":"user","content":"{{user_query}}"}],"thinking":null,"model":"gpt-4o","stream":false,"temperature":0.7,"max_tokens":2048,"top_p":1,"frequency_penalty":0,"presence_penalty":0,"reasoning_effort":null,"verbosity":null,"seed":null,"variables":{"context":"","user_query":""},"tools":[{"type":"function","function":{"name":"search_knowledge_base"}}],"tool_choice":"auto","response_format":null,"json_schema":null,"is_enforcing_response_format":false,"readonly":false,"is_deployed":false,"edited_by":{"id":123,"email":"user@example.com","first_name":"John","last_name":"Doe"},"created_at":"2026-01-20T10:30:00Z","updated_at":"2026-01-20T10:30:00Z"}` |
| <a id="response.body.id"></a>`id` | `string` | Optional | - |
| <a id="response.body.prompt_version_id"></a>`prompt_version_id` | `string` | Optional | - |
| <a id="response.body.version"></a>`version` | `integer` | Optional | - |
| <a id="response.body.description"></a>`description` | `string or null` | Optional | - |
| <a id="response.body.messages"></a>`messages` | `array<object>` | Optional | - |
| `messages[]` | `object` | Array item | Message object with at least `role` and `content`.<br />Additional properties are allowed |
| <a id="response.body.thinking"></a>`thinking` | `object or null` | Optional | - |
| <a id="response.body.model"></a>`model` | `string` | Optional | - |
| <a id="response.body.stream"></a>`stream` | `boolean` | Optional | - |
| <a id="response.body.temperature"></a>`temperature` | `number or null` | Optional | - |
| <a id="response.body.max_tokens"></a>`max_tokens` | `integer or null` | Optional | - |
| <a id="response.body.top_p"></a>`top_p` | `number or null` | Optional | - |
| <a id="response.body.frequency_penalty"></a>`frequency_penalty` | `number or null` | Optional | - |
| <a id="response.body.presence_penalty"></a>`presence_penalty` | `number or null` | Optional | - |
| <a id="response.body.reasoning_effort"></a>`reasoning_effort` | `string or null` | Optional | - |
| <a id="response.body.verbosity"></a>`verbosity` | `string or null` | Optional | - |
| <a id="response.body.seed"></a>`seed` | `integer or null` | Optional | - |
| <a id="response.body.variables"></a>`variables` | `object` | Optional | - |
| <a id="response.body.tools"></a>`tools` | `array<object> or null` | Optional | - |
| `tools[]` | `object` | Array item | - |
| <a id="response.body.tool_choice"></a>`tool_choice` | `string or null or object` | Optional | - |
| `tool_choice (oneOf 1)` | `string or null` | Schema variant | - |
| `tool_choice (oneOf 2)` | `object` | Schema variant | - |
| <a id="response.body.response_format"></a>`response_format` | `object or null` | Optional | - |
| <a id="response.body.json_schema"></a>`json_schema` | `object or null` | Optional | - |
| <a id="response.body.is_enforcing_response_format"></a>`is_enforcing_response_format` | `boolean` | Optional | - |
| <a id="response.body.readonly"></a>`readonly` | `boolean` | Optional | - |
| <a id="response.body.edited_by"></a>`edited_by` | `object` | Optional | - |
| `edited_by.id` | `integer` | Optional | - |
| `edited_by.email` | `string` | Optional | - |
| `edited_by.first_name` | `string` | Optional | - |
| `edited_by.last_name` | `string` | Optional | - |
| <a id="response.body.created_at"></a>`created_at` | `string` | Optional | Format: `date-time` |
| <a id="response.body.updated_at"></a>`updated_at` | `string` | Optional | Format: `date-time` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "prompt_version_id": {
      "type": "string"
    },
    "version": {
      "type": "integer"
    },
    "description": {
      "type": "string",
      "nullable": true
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "Message object with at least `role` and `content`.",
        "additionalProperties": true
      }
    },
    "thinking": {
      "type": "object",
      "nullable": true
    },
    "model": {
      "type": "string"
    },
    "stream": {
      "type": "boolean"
    },
    "temperature": {
      "type": "number",
      "nullable": true
    },
    "max_tokens": {
      "type": "integer",
      "nullable": true
    },
    "top_p": {
      "type": "number",
      "nullable": true
    },
    "frequency_penalty": {
      "type": "number",
      "nullable": true
    },
    "presence_penalty": {
      "type": "number",
      "nullable": true
    },
    "reasoning_effort": {
      "type": "string",
      "nullable": true
    },
    "verbosity": {
      "type": "string",
      "nullable": true
    },
    "seed": {
      "type": "integer",
      "nullable": true
    },
    "variables": {
      "type": "object"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "nullable": true
    },
    "tool_choice": {
      "oneOf": [
        {
          "type": "string",
          "nullable": true
        },
        {
          "type": "object"
        }
      ]
    },
    "response_format": {
      "type": "object",
      "nullable": true
    },
    "json_schema": {
      "type": "object",
      "nullable": true
    },
    "is_enforcing_response_format": {
      "type": "boolean"
    },
    "readonly": {
      "type": "boolean"
    },
    "edited_by": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "email": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "example": {
    "id": "pv_abc123",
    "prompt_version_id": "pv_abc123",
    "version": 3,
    "description": "Added context variable",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant. Context: {{context}}"
      },
      {
        "role": "user",
        "content": "{{user_query}}"
      }
    ],
    "thinking": null,
    "model": "gpt-4o",
    "stream": false,
    "temperature": 0.7,
    "max_tokens": 2048,
    "top_p": 1,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "reasoning_effort": null,
    "verbosity": null,
    "seed": null,
    "variables": {
      "context": "",
      "user_query": ""
    },
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "search_knowledge_base"
        }
      }
    ],
    "tool_choice": "auto",
    "response_format": null,
    "json_schema": null,
    "is_enforcing_response_format": false,
    "readonly": false,
    "is_deployed": false,
    "edited_by": {
      "id": 123,
      "email": "user@example.com",
      "first_name": "John",
      "last_name": "Doe"
    },
    "created_at": "2026-01-20T10:30:00Z",
    "updated_at": "2026-01-20T10:30:00Z"
  }
}
```

</details>

<a id="response.error"></a>

### 400

Validation failed.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Maps each invalid field to its error messages. |
| `$.<key>` | `any` | Map value | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "description": "Maps each invalid field to its error messages.",
  "additionalProperties": {}
}
```

</details>

##### Example


```json
{
  "messages": {
    "prompt_messages": [
      "Prompt messages cannot be empty"
    ]
  }
}
```


### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
```


### 404

Prompt not found

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Prompt not found"
}
```


## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Create a prompt version",
  "operationId": "createPromptVersion",
  "tags": [
    "Prompts"
  ],
  "description": "Use `{{variable_name}}` syntax in messages to define template variables. The new version becomes the prompt's current draft, and every earlier version becomes read-only. To deploy it, commit it, then use Deploy a prompt version.",
  "parameters": [
    {
      "name": "prompt_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "The unique prompt identifier."
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string",
              "description": "Version description."
            },
            "messages": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "role"
                ],
                "properties": {
                  "role": {
                    "type": "string"
                  },
                  "content": {
                    "oneOf": [
                      {
                        "type": "string",
                        "nullable": true
                      },
                      {
                        "type": "array",
                        "items": {}
                      }
                    ]
                  }
                },
                "additionalProperties": true
              },
              "description": "Non-empty message array. Each message requires `role`; `content` may be omitted, an empty string, `null`, or an empty array.",
              "minItems": 1
            },
            "thinking": {
              "type": "object",
              "nullable": true,
              "description": "Optional provider-specific reasoning configuration."
            },
            "model": {
              "type": "string",
              "description": "Primary model for this version.",
              "example": "gpt-6-luna"
            },
            "stream": {
              "type": "boolean",
              "description": "Whether to stream responses.",
              "default": false
            },
            "temperature": {
              "type": "number",
              "description": "Sampling temperature (0-2).",
              "example": 0.7
            },
            "max_tokens": {
              "type": "integer",
              "description": "Maximum tokens to generate.",
              "example": 1024
            },
            "top_p": {
              "type": "number",
              "description": "Nucleus sampling parameter.",
              "example": 1
            },
            "frequency_penalty": {
              "type": "number",
              "description": "Frequency penalty (-2 to 2).",
              "example": 0
            },
            "presence_penalty": {
              "type": "number",
              "description": "Presence penalty (-2 to 2).",
              "example": 0
            },
            "reasoning_effort": {
              "type": "string",
              "nullable": true
            },
            "verbosity": {
              "type": "string",
              "nullable": true
            },
            "seed": {
              "type": "integer",
              "nullable": true
            },
            "variables": {
              "type": "object",
              "description": "Template variables and their default values."
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "object"
              },
              "description": "Tools available to the model."
            },
            "tool_choice": {
              "oneOf": [
                {
                  "type": "string",
                  "nullable": true
                },
                {
                  "type": "object"
                }
              ]
            },
            "response_format": {
              "type": "object",
              "nullable": true,
              "description": "Structured output / response format configuration."
            },
            "json_schema": {
              "type": "object",
              "nullable": true,
              "description": "JSON schema used for structured outputs when configured."
            },
            "is_enforcing_response_format": {
              "type": "boolean",
              "description": "Whether to strictly enforce the response format.",
              "default": false
            }
          },
          "required": [
            "messages"
          ],
          "example": {
            "description": "Production version with context awareness",
            "messages": [
              {
                "role": "system",
                "content": "You are a helpful customer support assistant. Context: {{context}}"
              },
              {
                "role": "user",
                "content": "{{user_query}}"
              }
            ],
            "model": "gpt-6-luna",
            "temperature": 0.7,
            "max_tokens": 2048,
            "variables": {
              "context": "Product information and FAQs",
              "user_query": "How do I reset my password?"
            },
            "deploy": false
          }
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Prompt version created successfully.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "prompt_version_id": {
                "type": "string"
              },
              "version": {
                "type": "integer"
              },
              "description": {
                "type": "string",
                "nullable": true
              },
              "messages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "description": "Message object with at least `role` and `content`.",
                  "additionalProperties": true
                }
              },
              "thinking": {
                "type": "object",
                "nullable": true
              },
              "model": {
                "type": "string"
              },
              "stream": {
                "type": "boolean"
              },
              "temperature": {
                "type": "number",
                "nullable": true
              },
              "max_tokens": {
                "type": "integer",
                "nullable": true
              },
              "top_p": {
                "type": "number",
                "nullable": true
              },
              "frequency_penalty": {
                "type": "number",
                "nullable": true
              },
              "presence_penalty": {
                "type": "number",
                "nullable": true
              },
              "reasoning_effort": {
                "type": "string",
                "nullable": true
              },
              "verbosity": {
                "type": "string",
                "nullable": true
              },
              "seed": {
                "type": "integer",
                "nullable": true
              },
              "variables": {
                "type": "object"
              },
              "tools": {
                "type": "array",
                "items": {
                  "type": "object"
                },
                "nullable": true
              },
              "tool_choice": {
                "oneOf": [
                  {
                    "type": "string",
                    "nullable": true
                  },
                  {
                    "type": "object"
                  }
                ]
              },
              "response_format": {
                "type": "object",
                "nullable": true
              },
              "json_schema": {
                "type": "object",
                "nullable": true
              },
              "is_enforcing_response_format": {
                "type": "boolean"
              },
              "readonly": {
                "type": "boolean"
              },
              "edited_by": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "email": {
                    "type": "string"
                  },
                  "first_name": {
                    "type": "string"
                  },
                  "last_name": {
                    "type": "string"
                  }
                }
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              }
            },
            "example": {
              "id": "pv_abc123",
              "prompt_version_id": "pv_abc123",
              "version": 3,
              "description": "Added context variable",
              "messages": [
                {
                  "role": "system",
                  "content": "You are a helpful assistant. Context: {{context}}"
                },
                {
                  "role": "user",
                  "content": "{{user_query}}"
                }
              ],
              "thinking": null,
              "model": "gpt-4o",
              "stream": false,
              "temperature": 0.7,
              "max_tokens": 2048,
              "top_p": 1,
              "frequency_penalty": 0,
              "presence_penalty": 0,
              "reasoning_effort": null,
              "verbosity": null,
              "seed": null,
              "variables": {
                "context": "",
                "user_query": ""
              },
              "tools": [
                {
                  "type": "function",
                  "function": {
                    "name": "search_knowledge_base"
                  }
                }
              ],
              "tool_choice": "auto",
              "response_format": null,
              "json_schema": null,
              "is_enforcing_response_format": false,
              "readonly": false,
              "is_deployed": false,
              "edited_by": {
                "id": 123,
                "email": "user@example.com",
                "first_name": "John",
                "last_name": "Doe"
              },
              "created_at": "2026-01-20T10:30:00Z",
              "updated_at": "2026-01-20T10:30:00Z"
            }
          }
        }
      }
    },
    "400": {
      "description": "Validation failed.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "description": "Maps each invalid field to its error messages.",
            "additionalProperties": {}
          },
          "example": {
            "messages": {
              "prompt_messages": [
                "Prompt messages cannot be empty"
              ]
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "404": {
      "description": "Prompt not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Prompt not found"
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
