← Developer Hub
AI & Generative Models
Generative Financial Scenarios
Generate reproducible governed financial stress scenarios from an approved FinanceGPT VAE.
Version: v2
Stability: stable
Sandbox: Available
Production: Entitlement required
Target latency: ≤ 1,800 ms
POST
/api/v2/ml/scenariosScenario generations are stress-test samples, not forecasts or probabilities. Synthetic peer benchmarking remains disabled.
Required scope:
ml:inferenceTry it in the FinanceGPT sandbox
The playground uses deterministic isolated sandbox fixtures. It never queries production workspace data and does not require you to paste an API secret into the browser.
Sign in to runExample response
{
"data": {
"type": "scenario_generation",
"output": {
"samples": [
{
"revenue_growth": -0.059999999999999997779553950749686919152736663818359375,
"net_margin": 0.11000000000000000055511151231257827021181583404541015625,
"current_ratio": 1.350000000000000088817841970012523233890533447265625
}
]
}
}
}Code examples
curl
curl -X POST \
https://financegpt.dev/api/v2/ml/scenarios \
-H "Authorization: Bearer $FINANCEGPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"samples":5,"stress":{"revenue_growth":-0.1000000000000000055511151231257827021181583404541015625}}'python
import os, requests
url = "https://financegpt.dev/api/v2/ml/scenarios"
headers = {"Authorization": f"Bearer {os.environ['FINANCEGPT_API_KEY']}"}
payload = {
"samples": 5,
"stress": {
"revenue_growth": -0.1000000000000000055511151231257827021181583404541015625
}
}
response = requests.request("POST", url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())javascript
const response = await fetch('https://financegpt.dev/api/v2/ml/scenarios', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.FINANCEGPT_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({"samples":5,"stress":{"revenue_growth":-0.1000000000000000055511151231257827021181583404541015625}})
});
if (!response.ok) throw new Error(`FinanceGPT ${response.status}`);
console.log(await response.json());php
<?php
$ch = curl_init('https://financegpt.dev/api/v2/ml/scenarios');
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => ['Authorization: Bearer '.getenv('FINANCEGPT_API_KEY'), 'Content-Type: application/json'], CURLOPT_POSTFIELDS => '{\"samples\":5,\"stress\":{\"revenue_growth\":-0.1000000000000000055511151231257827021181583404541015625}}']);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException($response);
echo $response;Versions & changelog
v2 published
M15 publication of this governed FinanceGPT API operation.
Ready to build?
Explorer gives immediate isolated sandbox access. Production plans require a commercial entitlement.
Create account