Rpc
Package web3 is the chain-access surface: which chains this deployment can reach, a JSON-RPC door onto each, and the two token reads every wallet UI needs.
Package web3 is the chain-access surface: which chains this deployment can reach, a JSON-RPC door onto each, and the two token reads every wallet UI needs.
| Base URL | https://api.hanzo.ai |
| Operations | 1 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Quickstart
export HANZO_API_KEY=hk-... # console.hanzo.ai → API keysThen the first call. This one takes arguments — the placeholders are yours to fill. POST /v1/rpc/{chain}, operation post_rpc_by_chain:
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, RpcApi } from 'hanzoai';
const api = new RpcApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postRpcByChain({ chain: 'chain', chain: "<chain>", id: "<id>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import RpcApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = RpcApi(client).post_rpc_by_chain(chain='chain', chain="<chain>", id="<id>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.RpcAPI.PostRpcByChain(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, rpc_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = rpc_api::post_rpc_by_chain(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.RpcApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new RpcApi(client).postRpcByChain();The method above is the one at the current release of the document. [email protected] (PyPI) 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 POST https://api.hanzo.ai/v1/rpc/<chain> \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chain": "<chain>",
"id": "<id>"
}'The door declares no tool for rpc — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.
Answers 200 with object — ok.
rpc
POST /v1/rpc/{chain}
Forwards a JSON-RPC call to the named chain and returns its answer unchanged. Only declared chains are reachable, and only to a caller with a validated principal — this is the deployment's upstream, not an open relay.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
chain | path | string | yes | Chain is the registry id, from the URL. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
chain | string | — | Chain is the registry id, from the URL. |
id | — | ID is echoed back untouched. | |
jsonrpc | string | — | JSONRPC must be "2.0" when present. |
method | string | — | Method is the RPC method, e.g. |
params | — | Params is the method's parameters, passed through unread. |
How is this guide?
Router
Package ai is Hanzo AI — the model API on /v1 (/v1/chat/completions, /v1/messages, /v1/models and the rest of hanzoai/ai's surface) — mounted into a cloud binary with the money, ingest and telemetry…
Run
Package platform is Hanzo PaaS: deploy containers to your own tenant namespace — builds, releases, environments, logs, custom domains.