Maxim Logo
Prompts/Run

Run Prompt Version

Run a specific version of a prompt

POST
/v1/prompts/run

Authorization

x-maxim-api-key<token>

API key for authentication

In: header

Request Body

application/jsonOptional
promptIdRequiredstring

Unique identifier for the prompt

versionIdRequiredstring

Unique identifier for the version

workspaceIdRequiredstring

Unique identifier for the workspace

messagesRequiredarray<object>

Array of messages

modelNameRequiredstring

Name of the model to use

modelProviderRequiredstring

Provider of the model

Value in: "openai" | "azure" | "huggingface" | "anthropic" | "together" | "google" | "groq" | "bedrock" | "maxim" | "cohere" | "ollama" | "lmstudio" | "xai"
modelParametersobject & object

Model parameters configuration

Default: {}
curl -X POST "https://api.getmaxim.ai/v1/prompts/run" \
  -H "x-maxim-api-key: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "promptId": "string",
    "versionId": "string",
    "workspaceId": "string",
    "messages": [
      {
        "role": "assistant",
        "content": "string"
      }
    ],
    "modelName": "string",
    "modelProvider": "openai",
    "modelParameters": {}
  }'

Prompt version executed successfully

{
  "data": {
    "output": null,
    "usage": {
      "totalTokens": 0,
      "promptTokens": 0,
      "completionTokens": 0
    }
  }
}