Run Prompt Version
curl --request POST \
--url https://api.getmaxim.ai/v1/prompts/run \
--header 'Content-Type: application/json' \
--header 'x-maxim-api-key: <api-key>' \
--data '
{
"promptId": "<string>",
"versionId": "<string>",
"workspaceId": "<string>",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"modelName": "<string>",
"modelParameters": {}
}
'import requests
url = "https://api.getmaxim.ai/v1/prompts/run"
payload = {
"promptId": "<string>",
"versionId": "<string>",
"workspaceId": "<string>",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"modelName": "<string>",
"modelParameters": {}
}
headers = {
"x-maxim-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-maxim-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
promptId: '<string>',
versionId: '<string>',
workspaceId: '<string>',
messages: [
{
content: '<string>',
tool_call_id: '<string>',
tool_calls: [
{
id: '<string>',
type: 'function',
function: {name: '<string>', arguments: '<string>'}
}
]
}
],
modelName: '<string>',
modelParameters: {}
})
};
fetch('https://api.getmaxim.ai/v1/prompts/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getmaxim.ai/v1/prompts/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'promptId' => '<string>',
'versionId' => '<string>',
'workspaceId' => '<string>',
'messages' => [
[
'content' => '<string>',
'tool_call_id' => '<string>',
'tool_calls' => [
[
'id' => '<string>',
'type' => 'function',
'function' => [
'name' => '<string>',
'arguments' => '<string>'
]
]
]
]
],
'modelName' => '<string>',
'modelParameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-maxim-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getmaxim.ai/v1/prompts/run"
payload := strings.NewReader("{\n \"promptId\": \"<string>\",\n \"versionId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"modelName\": \"<string>\",\n \"modelParameters\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-maxim-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getmaxim.ai/v1/prompts/run")
.header("x-maxim-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"promptId\": \"<string>\",\n \"versionId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"modelName\": \"<string>\",\n \"modelParameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmaxim.ai/v1/prompts/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-maxim-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"promptId\": \"<string>\",\n \"versionId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"modelName\": \"<string>\",\n \"modelParameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"usage": {
"totalTokens": 123,
"promptTokens": 123,
"completionTokens": 123
},
"output": null
}
}Prompt Version
Run Prompt Version
Run a specific version of a prompt
POST
/
v1
/
prompts
/
run
Run Prompt Version
curl --request POST \
--url https://api.getmaxim.ai/v1/prompts/run \
--header 'Content-Type: application/json' \
--header 'x-maxim-api-key: <api-key>' \
--data '
{
"promptId": "<string>",
"versionId": "<string>",
"workspaceId": "<string>",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"modelName": "<string>",
"modelParameters": {}
}
'import requests
url = "https://api.getmaxim.ai/v1/prompts/run"
payload = {
"promptId": "<string>",
"versionId": "<string>",
"workspaceId": "<string>",
"messages": [
{
"content": "<string>",
"tool_call_id": "<string>",
"tool_calls": [
{
"id": "<string>",
"type": "function",
"function": {
"name": "<string>",
"arguments": "<string>"
}
}
]
}
],
"modelName": "<string>",
"modelParameters": {}
}
headers = {
"x-maxim-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-maxim-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
promptId: '<string>',
versionId: '<string>',
workspaceId: '<string>',
messages: [
{
content: '<string>',
tool_call_id: '<string>',
tool_calls: [
{
id: '<string>',
type: 'function',
function: {name: '<string>', arguments: '<string>'}
}
]
}
],
modelName: '<string>',
modelParameters: {}
})
};
fetch('https://api.getmaxim.ai/v1/prompts/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getmaxim.ai/v1/prompts/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'promptId' => '<string>',
'versionId' => '<string>',
'workspaceId' => '<string>',
'messages' => [
[
'content' => '<string>',
'tool_call_id' => '<string>',
'tool_calls' => [
[
'id' => '<string>',
'type' => 'function',
'function' => [
'name' => '<string>',
'arguments' => '<string>'
]
]
]
]
],
'modelName' => '<string>',
'modelParameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-maxim-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getmaxim.ai/v1/prompts/run"
payload := strings.NewReader("{\n \"promptId\": \"<string>\",\n \"versionId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"modelName\": \"<string>\",\n \"modelParameters\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-maxim-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.getmaxim.ai/v1/prompts/run")
.header("x-maxim-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"promptId\": \"<string>\",\n \"versionId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"modelName\": \"<string>\",\n \"modelParameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmaxim.ai/v1/prompts/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-maxim-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"promptId\": \"<string>\",\n \"versionId\": \"<string>\",\n \"workspaceId\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_call_id\": \"<string>\",\n \"tool_calls\": [\n {\n \"id\": \"<string>\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"<string>\",\n \"arguments\": \"<string>\"\n }\n }\n ]\n }\n ],\n \"modelName\": \"<string>\",\n \"modelParameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"usage": {
"totalTokens": 123,
"promptTokens": 123,
"completionTokens": 123
},
"output": null
}
}Authorizations
API key for authentication
Body
application/json
Unique identifier for the prompt
Unique identifier for the version
Unique identifier for the workspace
Array of messages
Show child attributes
Show child attributes
Name of the model to use
Provider of the model
Available options:
openai, azure, huggingface, anthropic, together, google, groq, bedrock, maxim, cohere, ollama, lmstudio, xai, vertex, mistral, fireworks Model parameters configuration
Show child attributes
Show child attributes
Response
Prompt version executed successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I