Commerce-1 / API.md
yasintoy's picture
Stage immutable Commerce-1 release privately
47e8004 verified
|
Raw History Blame Contribute Delete
1.37 kB
# Typed local API
The local endpoint is `POST /v1/systemone`. This example exercises all three
question types:
```bash
curl --fail --silent http://127.0.0.1:8000/v1/systemone \
-H 'content-type: application/json' \
--data-binary @- <<'JSON'
{
"model": "infercrane/commerce-1",
"state": {
"cart_value": 149.00,
"customer_tier": "returning",
"destination": "domestic"
},
"questions": {
"route": {
"type": "choice",
"instructions": "Choose the fulfillment route.",
"criteria": {
"standard": "Standard fulfillment",
"review": "Manual review"
}
},
"eligible": {
"type": "noul",
"instructions": "Is the order eligible for automatic processing?"
},
"priority": {
"type": "score",
"instructions": "Score processing priority.",
"criteria": ["low", "medium", "high"]
}
}
}
JSON
```
Successful responses contain typed answers, raw normalized distributions,
checkpoint and runtime identities, token use, and `cost: null`. Returned values
depend on the verified local model; this document intentionally includes no
fabricated prediction example.
`GET /healthz` reports process health. `GET /v1/model` reports the loaded
content identity. The loopback server serializes model work and may return 429
while busy or 503 when the runtime cannot complete a request.