curl --request POST \
--url https://api.example.com/v1/models/{model_id}/scenario \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataframe": {
"plan": {},
"columns": [
{
"name": "<string>",
"datatype": {
"kind": "string"
}
}
],
"version": 1
},
"target_value": 123,
"n_trials": 500,
"max_steps": 30,
"random_state": 42,
"explain_every": 1,
"check_every": 1,
"top_k_drivers": 2,
"constraints": {}
}
'import requests
url = "https://api.example.com/v1/models/{model_id}/scenario"
payload = {
"dataframe": {
"plan": {},
"columns": [
{
"name": "<string>",
"datatype": { "kind": "string" }
}
],
"version": 1
},
"target_value": 123,
"n_trials": 500,
"max_steps": 30,
"random_state": 42,
"explain_every": 1,
"check_every": 1,
"top_k_drivers": 2,
"constraints": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataframe: {
plan: {},
columns: [{name: '<string>', datatype: {kind: 'string'}}],
version: 1
},
target_value: 123,
n_trials: 500,
max_steps: 30,
random_state: 42,
explain_every: 1,
check_every: 1,
top_k_drivers: 2,
constraints: {}
})
};
fetch('https://api.example.com/v1/models/{model_id}/scenario', 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.example.com/v1/models/{model_id}/scenario",
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([
'dataframe' => [
'plan' => [
],
'columns' => [
[
'name' => '<string>',
'datatype' => [
'kind' => 'string'
]
]
],
'version' => 1
],
'target_value' => 123,
'n_trials' => 500,
'max_steps' => 30,
'random_state' => 42,
'explain_every' => 1,
'check_every' => 1,
'top_k_drivers' => 2,
'constraints' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/v1/models/{model_id}/scenario"
payload := strings.NewReader("{\n \"dataframe\": {\n \"plan\": {},\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"datatype\": {\n \"kind\": \"string\"\n }\n }\n ],\n \"version\": 1\n },\n \"target_value\": 123,\n \"n_trials\": 500,\n \"max_steps\": 30,\n \"random_state\": 42,\n \"explain_every\": 1,\n \"check_every\": 1,\n \"top_k_drivers\": 2,\n \"constraints\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/v1/models/{model_id}/scenario")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataframe\": {\n \"plan\": {},\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"datatype\": {\n \"kind\": \"string\"\n }\n }\n ],\n \"version\": 1\n },\n \"target_value\": 123,\n \"n_trials\": 500,\n \"max_steps\": 30,\n \"random_state\": 42,\n \"explain_every\": 1,\n \"check_every\": 1,\n \"top_k_drivers\": 2,\n \"constraints\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/models/{model_id}/scenario")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataframe\": {\n \"plan\": {},\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"datatype\": {\n \"kind\": \"string\"\n }\n }\n ],\n \"version\": 1\n },\n \"target_value\": 123,\n \"n_trials\": 500,\n \"max_steps\": 30,\n \"random_state\": 42,\n \"explain_every\": 1,\n \"check_every\": 1,\n \"top_k_drivers\": 2,\n \"constraints\": {}\n}"
response = http.request(request)
puts response.read_body{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Scenario
Scenario search: find row modifications that reach a desired class.
curl --request POST \
--url https://api.example.com/v1/models/{model_id}/scenario \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataframe": {
"plan": {},
"columns": [
{
"name": "<string>",
"datatype": {
"kind": "string"
}
}
],
"version": 1
},
"target_value": 123,
"n_trials": 500,
"max_steps": 30,
"random_state": 42,
"explain_every": 1,
"check_every": 1,
"top_k_drivers": 2,
"constraints": {}
}
'import requests
url = "https://api.example.com/v1/models/{model_id}/scenario"
payload = {
"dataframe": {
"plan": {},
"columns": [
{
"name": "<string>",
"datatype": { "kind": "string" }
}
],
"version": 1
},
"target_value": 123,
"n_trials": 500,
"max_steps": 30,
"random_state": 42,
"explain_every": 1,
"check_every": 1,
"top_k_drivers": 2,
"constraints": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataframe: {
plan: {},
columns: [{name: '<string>', datatype: {kind: 'string'}}],
version: 1
},
target_value: 123,
n_trials: 500,
max_steps: 30,
random_state: 42,
explain_every: 1,
check_every: 1,
top_k_drivers: 2,
constraints: {}
})
};
fetch('https://api.example.com/v1/models/{model_id}/scenario', 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.example.com/v1/models/{model_id}/scenario",
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([
'dataframe' => [
'plan' => [
],
'columns' => [
[
'name' => '<string>',
'datatype' => [
'kind' => 'string'
]
]
],
'version' => 1
],
'target_value' => 123,
'n_trials' => 500,
'max_steps' => 30,
'random_state' => 42,
'explain_every' => 1,
'check_every' => 1,
'top_k_drivers' => 2,
'constraints' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/v1/models/{model_id}/scenario"
payload := strings.NewReader("{\n \"dataframe\": {\n \"plan\": {},\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"datatype\": {\n \"kind\": \"string\"\n }\n }\n ],\n \"version\": 1\n },\n \"target_value\": 123,\n \"n_trials\": 500,\n \"max_steps\": 30,\n \"random_state\": 42,\n \"explain_every\": 1,\n \"check_every\": 1,\n \"top_k_drivers\": 2,\n \"constraints\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.example.com/v1/models/{model_id}/scenario")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataframe\": {\n \"plan\": {},\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"datatype\": {\n \"kind\": \"string\"\n }\n }\n ],\n \"version\": 1\n },\n \"target_value\": 123,\n \"n_trials\": 500,\n \"max_steps\": 30,\n \"random_state\": 42,\n \"explain_every\": 1,\n \"check_every\": 1,\n \"top_k_drivers\": 2,\n \"constraints\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/models/{model_id}/scenario")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataframe\": {\n \"plan\": {},\n \"columns\": [\n {\n \"name\": \"<string>\",\n \"datatype\": {\n \"kind\": \"string\"\n }\n }\n ],\n \"version\": 1\n },\n \"target_value\": 123,\n \"n_trials\": 500,\n \"max_steps\": 30,\n \"random_state\": 42,\n \"explain_every\": 1,\n \"check_every\": 1,\n \"top_k_drivers\": 2,\n \"constraints\": {}\n}"
response = http.request(request)
puts response.read_body{
"job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
An API key or OAuth2/OIDC access token sent as Authorization: Bearer <token>.
Path Parameters
Body
Inline dataset spec — each materialized row is one query for the scenario search. Caps on row count are enforced inside the worker after materialize().
Show child attributes
Show child attributes
Score the search drives each query's prediction to cross. In label units for regression; the positive-class probability in (0, 1) for binary classification (e.g. 0.5 flips to the other side of the decision boundary). Each query travels in whichever direction reaches it.
x >= 1x >= 1Speed/quality knob: higher values speed up the search at some cost to scenario yield. Default 1 (highest quality).
x >= 1Speed/quality knob with higher leverage than explain_every: higher values speed up the search with a coarser stride. Default 1 (highest quality).
x >= 1Restrict each step to the K most influential features — yields sparser scenarios on wide feature spaces. None = no restriction. Avoid 1 (too restrictive).
x >= 1Show child attributes
Show child attributes