Replace replicas
Saves capacity, weight and preferred agent roles in the native router's pool file and applies them without dropping running streams or pins.
PUT /v1/engine/replicas
| Address | https://api.hanzo.ai/v1/engine/replicas |
| Method | PUT |
| Operation | engineUpdateReplica |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Saves capacity, weight and preferred agent roles in the native router's pool file and applies them without dropping running streams or pins. Only platform SuperAdmins can retune shared workers. The Rust runtime owns validation, durable storage and activation; cloud only carries the operation.
Request
5 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
capacity | body | integer (int64) | — | |
id | body | string | — | |
model | body | string | — | |
roles | body | string[] | — | |
weight | body | integer (int64) | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | object | ok |
default | problem-details | refused |
200 body — 10 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
* | body | engine.engineReplica[] | — | |
*[].capacity | body | integer (int64) | — | |
*[].healthy | body | boolean | — | |
*[].id | body | string | — | |
*[].inflight | body | integer (int64) | — | |
*[].roles | body | string[] | — | |
*[].ttft_ewma_ms | body | number (double) | — | |
*[].upstream_model | body | string | — | |
*[].url | body | string | — | |
*[].weight | body | integer (int64) | — |
Failure carries the platform error shape — see Errors.
Examples
hanzo engine replicas replaceimport { Configuration, EngineApi } from 'hanzoai';
const api = new EngineApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.engineUpdateReplica({ capacity: 0, id: "<id>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EngineApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EngineApi(client).engine_update_replica(capacity=0, id="<id>")cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.EngineAPI.EngineUpdateReplica(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, engine_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = engine_api::engine_update_replica(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EngineApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new EngineApi(client).engineUpdateReplica();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl -X PUT https://api.hanzo.ai/v1/engine/replicas \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"capacity": 0,
"id": "<id>"
}'MCP declares no tool for engine — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
How is this guide?