Create model

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

Addresshttps://api.hanzo.ai/v1/risk/state/model
MethodPOST
OperationriskPublishModel
AuthAuthorization: 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 MCP's describe for riskPublishModel, which answers from the running route.

Response

StatusBodyMeaning
201risk.riskPublishOutcreated
defaultproblem-detailsrefused

201 body — 9 fields.

FieldInTypeAlwaysDescription
mintedbodyboolean—Minted is false when your model was ALREADY published under this name and nothing was written.
tenantbodystring—Tenant is whose history it entered.
valuebodyrisk.riskModelValue—
value.addressbodystring—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 the fold watermark behind them.
value.atbodystring—At is when it was published, RFC 3339, on the server clock.
value.learnedbodyinteger (int64)—Learned is how many events are behind the masses.
value.sequencebodyinteger (int64)—Sequence is this value's place in YOUR organisation's own history, from 1 and contiguous until retention disposes of the oldest.
value.shapebodystring—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 inventory in order and the detector's geometry parameters.
value.warmedbodystring—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 create
import { 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 := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.RiskAPI.RiskPublishModel(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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.setBearerToken(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": {}
         }
       }
     }'

Risk API · All Hanzo APIs · Interactive reference

Was this page useful?