Risks Index APIOperational
grx_scenario_run
Run a scenario on the released edition (metered, vCPU-seconds)
Request
امتحان کنید
Available · MCP tool grx.scenario_run · No credits
POST/v1/grx/org/scenarios/run
curl -s -X POST "https://api.risksindex.com/v1/grx/org/scenarios/run" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: <a-unique-key-per-attempt>" \
-d '{}'const res = await fetch("https://api.risksindex.com/v1/grx/org/scenarios/run", { method: "POST", headers: { "Content-Type": "application/json", "Idempotency-Key": "<a-unique-key-per-attempt>" }, body: "{}" });
const { data, meta } = await res.json();import json, urllib.request
req = urllib.request.Request("https://api.risksindex.com/v1/grx/org/scenarios/run", data="{}".encode(), method="POST", headers={"Content-Type": "application/json", "Idempotency-Key": "<a-unique-key-per-attempt>"})
with urllib.request.urlopen(req) as res:
answer = json.load(res)200 OKapplication/json
{
"data": "…",
"meta": {
"authority": "string",
"state": "string",
"provenance": "…",
"coverage": {
"status": "full",
"records": 0,
"dimensions": {}
},
"review": {}
}
} Recomputes the composite of 1 to 50 entities of the released edition under your scenario: pillar shocks (score x multiply + add, bounded to 0 to 10) and pillar weights, with the Index method code and the design recorded in the edition (method grx-scenario-v1). Each unit is first replicated from its pillar scores; a scenario value is a deterministic point without an interval, and its class has no probability. Metered action: needs a Passport bearer token and an Idempotency-Key; the CPU budget (cpuBudgetSeconds, default 2, at most 30) is quoted and admitted at the Business Hub before the run, the run is measured and settled with the vCPU-seconds it used, and released when it fails (400, 422 CPU_BUDGET_EXCEEDED). 402 when the payer cannot pay, 503 METERING_UNAVAILABLE when the Hub does not answer. While INDEX_METERING is off (the default) it answers 402 PAYMENT_REQUIRED (NOT_ON_SALE) and runs nothing; before an edition is released it answers 501 NOT_YET_PUBLISHED and charges nothing. Availability: Available.
Parameters
Parameters
Idempotency-Keyoptionalheader · string
Optional. A value of your own (a UUID is fine) that makes this write safe to retry: the same caller, key and request within 24 hours gets the first answer again, with the header Idempotent-Replayed: true, and the work is not done twice. It applies to a request that carries a credential.
Answers
Responses
- 200
Records with provenance, coverage and links
- 400Problem, RFC 9457
Bad request body. Codes: BAD_BUILD, BAD_JSON, BAD_SCENARIO, CPU_BUDGET_INVALID, IDEMPOTENCY_KEY_REQUIRED
- 401Problem, RFC 9457
Authentication required. Codes: AUTH_REQUIRED, TOKEN_INVALID
- 402Problem, RFC 9457
Credits exhausted. Codes: NEXUS_CREDITS_EXHAUSTED, PAYMENT_REQUIRED
- 404Problem, RFC 9457
Not found. Codes: NOT_FOUND
- 409
- 413Problem, RFC 9457
Body too large. Codes: TOO_LARGE
- 414
- 422Problem, RFC 9457
CPU budget exceeded. Codes: CPU_BUDGET_EXCEEDED, METHOD_NOT_RECORDED
- 429Problem, RFC 9457
Rate limited. Codes: RATE_LIMITED
- 500Problem, RFC 9457
Internal error. Codes: INTERNAL
- 501Problem, RFC 9457
Planned. Codes: NOT_BUILT, NOT_YET_PUBLISHED, WRITES_OFF
- 503Problem, RFC 9457
Metering unavailable. Codes: METERING_UNAVAILABLE
شروع کنید
Get a key with a free account, or choose who the account is for, its seats and any council, and see your workstation first.