---
title: "Create a prompt version"
method: POST
path: "/api/prompts/{prompt_id}/versions/"
tags: ["prompts"]
---

# Create a prompt version

`POST /api/prompts/{prompt_id}/versions/`

Create a new version of a prompt. Use `{{variable_name}}` syntax in messages to define template variables.

## Path parameters

- `prompt_id` string, required

## Headers

- `Authorization` string, required

## Request body

- object
  - `description` string — Version description.
  - `messages` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaMessagesItems[], required — Non-empty message array. Each message requires `role`; `content` may be omitted, an empty string, `null`, or an empty array.
    - `role` string, required
    - `content` union
      - string
      - unknown[]
        - unknown
  - `thinking` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaThinking — Optional provider-specific reasoning configuration.
  - `model` string — Primary model for this version.
  - `stream` boolean — Whether to stream responses.
  - `temperature` number, double — Sampling temperature (0-2).
  - `max_tokens` integer — Maximum tokens to generate.
  - `top_p` number, double — Nucleus sampling parameter.
  - `frequency_penalty` number, double — Frequency penalty (-2 to 2).
  - `presence_penalty` number, double — Presence penalty (-2 to 2).
  - `reasoning_effort` string, nullable
  - `verbosity` string, nullable
  - `seed` integer, nullable
  - `variables` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaVariables — Template variables and their default values.
  - `fallback_models` string[] — Fallback models if the primary model fails.
  - `load_balance_models` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaLoadBalanceModelsItems[] — Weighted load-balancing model configuration.
  - `tools` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaToolsItems[] — Tools available to the model.
  - `tool_choice` union
    - string
    - object
  - `response_format` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaResponseFormat — Structured output / response format configuration.
  - `json_schema` ApiPromptsPromptIdVersionsPostRequestBodyContentApplicationJsonSchemaJsonSchema — JSON schema used for structured outputs when configured.
  - `is_enforcing_response_format` boolean — Whether to strictly enforce the response format.
  - `deploy` boolean — Deploy this version as the live version immediately.

## Response `201`

Prompt version created successfully.

- PromptsCreatePromptVersionResponse201
  - `id` string
  - `prompt_version_id` string
  - `version` integer
  - `description` string, nullable
  - `messages` object[]
  - `thinking` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaThinking
  - `model` string
  - `stream` boolean
  - `temperature` number, double, nullable
  - `max_tokens` integer, nullable
  - `top_p` number, double, nullable
  - `frequency_penalty` number, double, nullable
  - `presence_penalty` number, double, nullable
  - `reasoning_effort` string, nullable
  - `verbosity` string, nullable
  - `seed` integer, nullable
  - `variables` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaVariables
  - `fallback_models` string[], nullable
  - `load_balance_models` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaLoadBalanceModelsItems[], nullable
  - `tools` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaToolsItems[], nullable
  - `tool_choice` union
    - string
    - object
  - `response_format` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaResponseFormat
  - `json_schema` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaJsonSchema
  - `is_enforcing_response_format` boolean
  - `readonly` boolean
  - `is_deployed` boolean
  - `edited_by` ApiPromptsPromptIdVersionsPostResponsesContentApplicationJsonSchemaEditedBy
    - `id` integer
    - `email` string
    - `first_name` string
    - `last_name` string
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Missing/invalid authentication
- `404` — Prompt not found

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/4e064cf81dae/schema)
