Publish your organisation's model as a named, immutable value
Publishes your organisation's model as a NAMED VALUE, so a decision taken today can be reconstructed tomorrow and a change made today can be undone.
POST /v1/risk/state/model
| Address | https://api.hanzo.ai/v1/risk/state/model |
| Method | POST |
| Operation | riskPublishModel |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Publishes your organisation's model as a NAMED VALUE, so a decision taken today can be reconstructed tomorrow and a change made today can be undone.
It answers with a NAME and not with the state. The masses stay on your organisation's own encrypted store and are referred to by an address computed from their own content: the shape, the geometry seed, the position in the window, the threshold, the masses themselves as IEEE-754 bits, and the fold watermark behind them. That is what makes the value nameable without making the caller its custodian.
IT IS IDEMPOTENT ON THE VALUE. A model that has not changed publishes to the name it already has and mints nothing, reporting minted=false — so publishing at every boundary that matters is free. Ten values are retained per organisation, bounded in BYTES rather than in rows, and the oldest is disposed of past that.
A model that has learned nothing is refused: planted is not learned, and a value that reproduces nothing is not a value.
It is POST and PUT on one address because they are one plane's two verbs over one kind of thing: POST mints a value from the model in force, PUT puts a value in force. They were /v1/risk/state/snapshot and /v1/risk/state/restore — two addresses named after the operation rather than after the thing, which is how a reader ends up asking what the difference between a snapshot and a value is.
Request
The document declares no body for POST /v1/risk/state/model. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask the MCP door's describe for riskPublishModel, which answers from the running route.
Response
| Status | Body | Meaning |
|---|---|---|
201 | riskPublishOut | created |
201 body — 9 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
minted | body | boolean | — | Minted is false when your model was ALREADY published under this name and nothing was written. |
tenant | body | string | — | Tenant is whose history it entered. |
value | body | riskModelValue | — | |
value.address | body | string | — | Address names this value by its own content: the model's shape, the geometry seed, its position in the window, its threshold, its masses as IEEE-754 bits and… |
value.at | body | string | — | At is when it was published, RFC 3339, on the server clock. |
value.learned | body | integer | — | Learned is how many events are behind the masses. |
value.sequence | body | integer | — | Sequence is this value's place in YOUR organisation's own history, from 1 and contiguous until retention disposes of the oldest. |
value.shape | body | string | — | Shape NAMES the model space the masses are only meaningful against, as <family>:<digest> — the KIND of model, and that family's own digest over the feature… |
value.warmed | body | string | — | Warmed is how far your own event surface had been folded in when this value was published, RFC 3339. |
Failure carries the platform error shape — see Errors.
Examples
hanzo risk state model createimport { Configuration, RiskApi } from 'hanzoai';
const api = new RiskApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.riskPublishModel();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import RiskApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = RiskApi(client).risk_publish_model()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.RiskAPI.RiskPublishModel(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, risk_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = risk_api::risk_publish_model(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.RiskApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new RiskApi(client).riskPublishModel();curl -X POST https://api.hanzo.ai/v1/risk/state/model \
-H "Authorization: Bearer $HANZO_API_KEY"Tool risk, op riskPublishModel — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "risk",
"arguments": {
"op": "riskPublishModel",
"input": {}
}
}
}'How is this guide?