---
title: "Create prompt version"
method: POST
path: "/api/prompt-repo/prompts/{id}/versions"
tags: ["Prompt Repository"]
---

# Create prompt version

`POST /api/prompt-repo/prompts/{id}/versions`

Creates a new version for a prompt.

## Path parameters

- `id` string, required

## Request body

- object
  - `commit_message` string, required
  - `messages` object[], required — Array of message objects
  - `model_params` object, required
  - `provider` string, required
  - `model` string, required

## Response `200`

Version created

- object
  - `version` object — Prompt version (immutable snapshot)
    - `id` integer — Auto-increment version ID
    - `prompt_id` string
    - `version_number` integer
    - `commit_message` string
    - `model_params` object — Model parameters (flexible JSON object)
    - `provider` string
    - `model` string
    - `is_latest` boolean
    - `created_at` string, date-time
    - `messages` object[]
      - `id` integer
      - `order_index` integer
      - `message` object — Opaque message content (JSON)

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

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