curl --request POST \
--url https://api.enkryptai.com/rt/model/playground \
--header 'Content-Type: application/json' \
--header 'X-Enkrypt-Model: <x-enkrypt-model>' \
--header 'X-Enkrypt-Model-Version: <x-enkrypt-model-version>' \
--header 'apikey: <api-key>' \
--data '
{
"goal": "<string>",
"attack_config": {},
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": [
"<string>"
]
}
]
},
"user_metadata": {},
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.enkryptai.com/rt/model/playground"
payload = {
"goal": "<string>",
"attack_config": {},
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": ["<string>"]
}
]
},
"user_metadata": {},
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Enkrypt-Model": "<x-enkrypt-model>",
"X-Enkrypt-Model-Version": "<x-enkrypt-model-version>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Enkrypt-Model': '<x-enkrypt-model>',
'X-Enkrypt-Model-Version': '<x-enkrypt-model-version>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
goal: '<string>',
attack_config: {},
context: {
system_description: '<string>',
policy_description: '<string>',
policy_rules: [
{
id: '<string>',
text: '<string>',
risk_category: '<string>',
severity: '<string>',
frameworks: ['<string>']
}
]
},
user_metadata: {},
run_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.enkryptai.com/rt/model/playground', 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.enkryptai.com/rt/model/playground",
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([
'goal' => '<string>',
'attack_config' => [
],
'context' => [
'system_description' => '<string>',
'policy_description' => '<string>',
'policy_rules' => [
[
'id' => '<string>',
'text' => '<string>',
'risk_category' => '<string>',
'severity' => '<string>',
'frameworks' => [
'<string>'
]
]
]
],
'user_metadata' => [
],
'run_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Enkrypt-Model: <x-enkrypt-model>",
"X-Enkrypt-Model-Version: <x-enkrypt-model-version>",
"apikey: <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.enkryptai.com/rt/model/playground"
payload := strings.NewReader("{\n \"goal\": \"<string>\",\n \"attack_config\": {},\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"user_metadata\": {},\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Enkrypt-Model", "<x-enkrypt-model>")
req.Header.Add("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
req.Header.Add("apikey", "<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.enkryptai.com/rt/model/playground")
.header("X-Enkrypt-Model", "<x-enkrypt-model>")
.header("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"goal\": \"<string>\",\n \"attack_config\": {},\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"user_metadata\": {},\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/rt/model/playground")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Enkrypt-Model"] = '<x-enkrypt-model>'
request["X-Enkrypt-Model-Version"] = '<x-enkrypt-model-version>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"goal\": \"<string>\",\n \"attack_config\": {},\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"user_metadata\": {},\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Run Playground with saved model
Identical to POST /rt/playground, except the system under test is a saved model named in the X-Enkrypt-Model / X-Enkrypt-Model-Version headers instead of an inline target. The gateway resolves the model and fills in target before the request reaches the Red Team service.
Saved models that reach their provider through a custom cURL command, custom headers/payload/response format, JWT auth, provider-specific auth_data or metadata, or an outbound proxy have no equivalent in the target shape and return 400. Use an inline target on POST /rt/playground for those, or the Archived Red Team API.
Relay routing is the one exception to that metadata rule: a model saved with model_config.connect_via_relay: true and a model_config.metadata.relay block is projected onto target.connect_via_relay / target.metadata.relay and runs through your bridge exactly as an inline relay target would.
curl --request POST \
--url https://api.enkryptai.com/rt/model/playground \
--header 'Content-Type: application/json' \
--header 'X-Enkrypt-Model: <x-enkrypt-model>' \
--header 'X-Enkrypt-Model-Version: <x-enkrypt-model-version>' \
--header 'apikey: <api-key>' \
--data '
{
"goal": "<string>",
"attack_config": {},
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": [
"<string>"
]
}
]
},
"user_metadata": {},
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.enkryptai.com/rt/model/playground"
payload = {
"goal": "<string>",
"attack_config": {},
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": ["<string>"]
}
]
},
"user_metadata": {},
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Enkrypt-Model": "<x-enkrypt-model>",
"X-Enkrypt-Model-Version": "<x-enkrypt-model-version>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Enkrypt-Model': '<x-enkrypt-model>',
'X-Enkrypt-Model-Version': '<x-enkrypt-model-version>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
goal: '<string>',
attack_config: {},
context: {
system_description: '<string>',
policy_description: '<string>',
policy_rules: [
{
id: '<string>',
text: '<string>',
risk_category: '<string>',
severity: '<string>',
frameworks: ['<string>']
}
]
},
user_metadata: {},
run_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.enkryptai.com/rt/model/playground', 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.enkryptai.com/rt/model/playground",
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([
'goal' => '<string>',
'attack_config' => [
],
'context' => [
'system_description' => '<string>',
'policy_description' => '<string>',
'policy_rules' => [
[
'id' => '<string>',
'text' => '<string>',
'risk_category' => '<string>',
'severity' => '<string>',
'frameworks' => [
'<string>'
]
]
]
],
'user_metadata' => [
],
'run_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Enkrypt-Model: <x-enkrypt-model>",
"X-Enkrypt-Model-Version: <x-enkrypt-model-version>",
"apikey: <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.enkryptai.com/rt/model/playground"
payload := strings.NewReader("{\n \"goal\": \"<string>\",\n \"attack_config\": {},\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"user_metadata\": {},\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Enkrypt-Model", "<x-enkrypt-model>")
req.Header.Add("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
req.Header.Add("apikey", "<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.enkryptai.com/rt/model/playground")
.header("X-Enkrypt-Model", "<x-enkrypt-model>")
.header("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"goal\": \"<string>\",\n \"attack_config\": {},\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"user_metadata\": {},\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/rt/model/playground")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Enkrypt-Model"] = '<x-enkrypt-model>'
request["X-Enkrypt-Model-Version"] = '<x-enkrypt-model-version>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"goal\": \"<string>\",\n \"attack_config\": {},\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"user_metadata\": {},\n \"run_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
The model saved name. E.g. Test Model
"Test Model"
The model version. Default is 'v1'
"v1"
Body
POST /v1/playground payload.
Single-goal ad-hoc probe. No category scaffolding, no generation.
attack_config lives top-level (not under categories).
target is omitted: the saved model named in the X-Enkrypt-Model / X-Enkrypt-Model-Version headers supplies it.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional caller-chosen run id (UUID). The response only names the job once the probe has finished, so supply one here to open the log websocket on play-<run_id> before submitting. Returns 409 if the id is already in use — retry with a fresh UUID. Omit it and the service generates one.
Response
Successful Response
The response is of type Response Run Playground With Saved Model · object.

