Skip to main content
POST
/
v2
/
prompts
Create a prompt
curl --request POST \
  --url https://api.orq.ai/v2/prompts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "display_name": "<string>",
  "description": "<string>",
  "metadata": {
    "language": "English"
  },
  "prompt_config": {
    "model": "openai/gpt-4o",
    "messages": [
      {
        "role": "system",
        "content": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "index": 123,
            "type": "function",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "tool_call_id": "<string>"
      }
    ],
    "model_parameters": {
      "temperature": 0.7,
      "maxTokens": 1000
    }
  },
  "prompt": {
    "model": "openai/gpt-4o",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant"
      },
      {
        "role": "user",
        "content": "What is the weather today?"
      }
    ],
    "temperature": 0.7,
    "max_tokens": 1000
  },
  "path": "Default"
}'
{
  "_id": "<string>",
  "type": "prompt",
  "owner": "<string>",
  "domain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created": "<string>",
  "updated": "<string>",
  "created_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "updated_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "display_name": "<string>",
  "description": "<string>",
  "prompt_config": {
    "stream": true,
    "model": "<string>",
    "model_db_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "model_type": "chat",
    "model_parameters": {
      "temperature": 123,
      "maxTokens": 123,
      "topK": 123,
      "topP": 123,
      "frequencyPenalty": 123,
      "presencePenalty": 123,
      "numImages": 123,
      "seed": 123,
      "format": "url",
      "dimensions": "<string>",
      "quality": "<string>",
      "style": "<string>",
      "responseFormat": {
        "type": "json_schema",
        "json_schema": {
          "name": "<string>",
          "description": "<string>",
          "strict": true,
          "schema": {}
        }
      },
      "photoRealVersion": "v1",
      "encoding_format": "float",
      "reasoningEffort": "disable",
      "budgetTokens": 123,
      "verbosity": "low"
    },
    "provider": "cohere",
    "integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "version": "<string>",
    "messages": [
      {
        "role": "system",
        "content": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "index": 123,
            "type": "function",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "tool_call_id": "<string>"
      }
    ]
  },
  "metadata": {
    "language": "English"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
display_name
string
required

The prompt’s name, meant to be displayable in the UI.

Maximum length: 128
path
string
required

Entity storage path in the format: project/folder/subfolder/...

The first element identifies the project, followed by nested folders (auto-created as needed).

With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.

Example:

"Default"

description
string | null

The prompt’s description, meant to be displayable in the UI. Use this field to optionally store a long form explanation of the prompt for your own purpose

metadata
object
prompt_config
object
deprecated

[DEPRECATED]. Please use the prompt property instead. The current prompt_config will keep working but it will be deprecated in future versions. Configuration for the prompt including model and messages.

prompt
object

Prompt configuration with model and messages. Either this field or prompt_config must be provided.

Example:
{
"model": "openai/gpt-4o",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant"
},
{
"role": "user",
"content": "What is the weather today?"
}
],
"temperature": 0.7,
"max_tokens": 1000
}

Response

200 - application/json

Prompt created.

A prompt entity with configuration, metadata, and versioning.

_id
string
required
type
enum<string>
required
Available options:
prompt
owner
string
required
domain_id
string<uuid>
required
created
string
required
updated
string
required
display_name
string
required

The prompt’s name, meant to be displayable in the UI.

Maximum length: 128
prompt_config
object
required

A list of messages compatible with the openAI schema

created_by_id
string<uuid> | null
updated_by_id
string<uuid> | null
description
string | null

The prompt’s description, meant to be displayable in the UI. Use this field to optionally store a long form explanation of the prompt for your own purpose

metadata
object