---
title: "Create a prompt."
method: POST
path: "/v1/prompts"
tags: ["Prompts"]
---

# Create a prompt.

`POST /v1/prompts`

Create a new prompt.

## Request body

- CreatePromptRequest — Request model for creating a new prompt.
  - `prompt` string, required — The prompt text content with variable placeholders.
  - `variables` string[], nullable — List of variable names that can be used in the prompt template.

## Response `200`

The created Prompt resource.

- Prompt — A prompt resource representing a stored OpenAI Compatible prompt template in OGX.
  - `prompt` string, nullable — The system prompt with variable placeholders
  - `version` integer, required — Version (integer starting at 1, incremented on save)
  - `prompt_id` string, required — Unique identifier in format 'pmpt_<48-digit-hash>'
  - `variables` string[] — List of variable names that can be used in the prompt template
  - `is_default` boolean — Boolean indicating whether this version is the default version

## Other responses

- `400` — The request was invalid or malformed
- `429` — The client has sent too many requests in a given amount of time
- `500` — The server encountered an unexpected error
- `default` — An error occurred

---

[API](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis.md) · [All operations](https://skmtc.net/ogx-ai/apis/ogx-specification-stable-experimental-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ogx-ai/ogx-specification-stable-experimental-apis/revisions/f3f783962256/schema)
