Create accounts

Opens a named wallet account for the caller's org.

POST /v1/wallet/accounts

Addresshttps://api.hanzo.ai/v1/wallet/accounts
MethodPOST
Operationpost_wallet_accounts
AuthAuthorization: Bearer $HANZO_API_KEY

Opens a named wallet account for the caller's org. An account is a GROUPING of wallets, not a key or a balance: wallets are created under one and can be listed by it. The org is stamped by the server from the validated principal, so a request can never open an account in another tenant.

Request

1 field, body application/json (required).

FieldInTypeRequiredDescription
namebodystring—Name is the account's label.

Response

StatusBodyMeaning
200wallet.WalletAccountok
defaultproblem-detailsrefused

200 body — 4 fields.

FieldInTypeAlwaysDescription
createdAtbodyinteger (int64)—CreatedAt is when the account was opened, Unix seconds.
idbodystring—ID is the account id, minted by the server as "acct_" + 24 hex.
namebodystring—Name is the label given at creation, trimmed and required.
orgbodystring—Org is the tenant that owns the account, stamped from the validated principal rather than taken from the request.

Failure carries the platform error shape — see Errors.

Examples

hanzo wallet accounts create
import { Configuration, WalletApi } from 'hanzoai';

const api = new WalletApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postWalletAccounts({ name: "<name>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WalletApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WalletApi(client).post_wallet_accounts(name="<name>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WalletAPI.PostWalletAccounts(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, wallet_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = wallet_api::post_wallet_accounts(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WalletApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WalletApi(client).postWalletAccounts();
curl -X POST https://api.hanzo.ai/v1/wallet/accounts \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "name": "<name>"
     }'

MCP reaches wallet through the wallet tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_wallets"
         }
       }
     }'

Wallet API · All Hanzo APIs · Interactive reference

Was this page useful?