Prompts API

Save instructions, messages and settings once, then use them by id in the Responses API.

Prompts

Save reusable prompts and use them by id in POST /v1/responses with prompt: {"id": "pmpt_...", "version": "2", "variables": {...}} (leave out version for the latest). A prompt holds instructions, input messages and default settings (model, tools, tool_choice, text, reasoning, temperature, top_p, max_output_tokens, parallel_tool_calls, truncation); fields you send with the request win. Its instructions come first, its messages before your input.

EndpointDoes
POST /v1/promptsCreate a prompt (version 1)
POST /v1/prompts/{id}Save a new version (versions never change)
GET /v1/prompts/{id}The latest version, or ?version=
GET /v1/prompts, GET /v1/prompts/{id}/versionsList prompts, or a prompt's versions
DELETE /v1/prompts/{id}Delete a prompt and all its versions

Prompts belong to your account: every key on it can use them.

Endpoints

List prompts

GET https://api.openscale.so/v1/prompts

Your account's prompts at their latest versions, newest first. Paged with limit, order and after (a prompt id).

Query parameters

FieldTypeRequiredDescription
limitintegerNoFrom 1 to 100. Default 20.
orderstringNoOne of asc, desc. Default "desc".
afterstringNo

Example request

bash
curl https://api.openscale.so/v1/prompts \
  -H "Authorization: Bearer $OPENSCALE_API_KEY"

Response

200: A list of prompts.

FieldTypeDescription
objectstringAlways list.
dataarray of object
data[].idstringExample: pmpt_9f2c....
data[].objectstringAlways prompt.
data[].namestring or null
data[].versionstringExample: 2.
data[].latest_versionstring
data[].variablesarray of string
data[].created_atinteger
data[].version_created_atinteger
first_idstring or null
last_idstring or null
has_moreboolean

Create a prompt

POST https://api.openscale.so/v1/prompts

Save a reusable prompt as version 1. It needs instructions or input messages; {{name}} placeholders in them become the prompt's variables. Settings (model, tools, tool_choice, text, reasoning, temperature, top_p, max_output_tokens, parallel_tool_calls, truncation) apply when a request leaves them out.

Request body

FieldTypeRequiredDescription
namestringNoUp to 256 characters.
instructionsstringNo
inputanyNoA string (one user message) or a list of messages.
modelstringNo
toolsarray of objectNo
tool_choiceanyNo
textobjectNo
reasoningobjectNo
temperaturenumberNo
top_pnumberNo
max_output_tokensintegerNo
parallel_tool_callsbooleanNo
truncationstringNoOne of auto, disabled.

Example request

bash
curl https://api.openscale.so/v1/prompts \
  -H "Authorization: Bearer $OPENSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Support",
  "instructions": "You are a support agent for {{company}}. Answer in one paragraph.",
  "model": "deepseek/deepseek-v4.1-flash"
}'

Response

200: The prompt.

FieldTypeDescription
idstringExample: pmpt_9f2c....
objectstringAlways prompt.
namestring or null
versionstringExample: 2.
latest_versionstring
variablesarray of string
created_atinteger
version_created_atinteger

Errors

StatusMeaning
400Invalid prompt; param names the field.
401Missing or invalid API key.

Retrieve a prompt

GET https://api.openscale.so/v1/prompts/{prompt_id}

The latest version of a prompt, or the one in ?version=.

Path parameters

FieldTypeRequiredDescription
prompt_idstringYes

Query parameters

FieldTypeRequiredDescription
versionstringNo

Example request

bash
curl https://api.openscale.so/v1/prompts/$PROMPT_ID \
  -H "Authorization: Bearer $OPENSCALE_API_KEY"

Response

200: The prompt.

FieldTypeDescription
idstringExample: pmpt_9f2c....
objectstringAlways prompt.
namestring or null
versionstringExample: 2.
latest_versionstring
variablesarray of string
created_atinteger
version_created_atinteger

Errors

StatusMeaning
404No prompt (or version) with this id.

Save a new version

POST https://api.openscale.so/v1/prompts/{prompt_id}

Save the body (as in Create a prompt) as the next version; earlier versions stay as they were. name renames the prompt.

Path parameters

FieldTypeRequiredDescription
prompt_idstringYes

Request body

FieldTypeRequiredDescription
namestringNoUp to 256 characters.
instructionsstringNo
inputanyNoA string (one user message) or a list of messages.
modelstringNo
toolsarray of objectNo
tool_choiceanyNo
textobjectNo
reasoningobjectNo
temperaturenumberNo
top_pnumberNo
max_output_tokensintegerNo
parallel_tool_callsbooleanNo
truncationstringNoOne of auto, disabled.

Example request

bash
curl -X POST https://api.openscale.so/v1/prompts/$PROMPT_ID \
  -H "Authorization: Bearer $OPENSCALE_API_KEY"

Response

200: The new version.

FieldTypeDescription
idstringExample: pmpt_9f2c....
objectstringAlways prompt.
namestring or null
versionstringExample: 2.
latest_versionstring
variablesarray of string
created_atinteger
version_created_atinteger

Errors

StatusMeaning
404No prompt with this id.

Delete a prompt

DELETE https://api.openscale.so/v1/prompts/{prompt_id}

Delete a prompt and all its versions.

Path parameters

FieldTypeRequiredDescription
prompt_idstringYes

Example request

bash
curl -X DELETE https://api.openscale.so/v1/prompts/$PROMPT_ID \
  -H "Authorization: Bearer $OPENSCALE_API_KEY"

Response

200: Deleted.

FieldTypeDescription
idstring
objectstringAlways prompt.deleted.
deletedboolean

Errors

StatusMeaning
404No prompt with this id.

List prompt versions

GET https://api.openscale.so/v1/prompts/{prompt_id}/versions

Every version of a prompt, newest first. Paged with limit, order and after (a version number).

Path parameters

FieldTypeRequiredDescription
prompt_idstringYes

Query parameters

FieldTypeRequiredDescription
limitintegerNoFrom 1 to 100. Default 20.
orderstringNoOne of asc, desc. Default "desc".
afterstringNo

Example request

bash
curl https://api.openscale.so/v1/prompts/$PROMPT_ID/versions \
  -H "Authorization: Bearer $OPENSCALE_API_KEY"

Response

200: A list of versions.

FieldTypeDescription
objectstringAlways list.
dataarray of object
data[].idstringExample: pmpt_9f2c....
data[].objectstringAlways prompt.
data[].namestring or null
data[].versionstringExample: 2.
data[].latest_versionstring
data[].variablesarray of string
data[].created_atinteger
data[].version_created_atinteger
first_idstring or null
last_idstring or null
has_moreboolean

Errors

StatusMeaning
404No prompt with this id.

More of the API reference

  • API reference: base URLs, authentication and a first request.
  • Chat Completions: POST /v1/chat/completions: the OpenAI Chat Completions format, streamed or not, with reasoning and tools.
  • Responses: POST /v1/responses: the OpenAI Responses format with stored state, background runs and enforced tool rules.
  • Conversations: Keep the turns of a Responses conversation on our side and continue it by id.
  • Anthropic Messages: POST /anthropic/v1/messages: the Anthropic Messages format, for Claude Code and Anthropic SDKs.
  • Models and pricing: Model ids, prices per 1M tokens, context windows, output limits, versions and the live catalog endpoint.
  • Batch: Upload a JSONL file of chat completions, create a batch and collect the results when it finishes.
  • Errors: The error shape, every status code and code, and which ones to retry.
  • Rate limits: Requests and tokens per minute, how a 429 tells you when to retry, and how to get more.
  • Data retention: What is stored, for how long, how to delete it, and zero data retention.
  • Interactive reference: try every endpoint in the browser.
  • OpenAPI document: the whole API as OpenAPI 3.1.

This page as Markdown: /docs/prompts.md