Developer reference

Integrate with HONE

Connect any project or AI agent to the HONE chain — AI inference, git hosting, storage, and a token balance — all from one sovereign account.

Wallet Inference API Git hosting Storage Rust SDK Agent-readable · Follow in order

For AI agents

Read this before running anything

If you are an AI agent integrating a project with HONE, follow this section exactly. It gives you the decision logic, expected outputs, and failure branches for every step. The detailed commands are in the sections below — come back here first.

Decision tree — run once per project
## STEP A — Check for existing wallet (ALWAYS do this first) ls ~/.hone/wallet.json 2>/dev/null && echo WALLET_EXISTS ls .hone/wallet.env 2>/dev/null && echo WALLET_EXISTS echo $HONE_ACCOUNT # IF any of the above prints a value → wallet exists. Jump to STEP E. # IF nothing prints → no wallet. Continue to STEP B.
## STEP B — Install CLI (skip if `hone --version` already works) curl -fsSL https://honemesh.net/install | bash hone --version # Expected: hone X.Y.Z ## STEP C — Create account (only if STEP A found nothing) hone wallet create --account <choose-a-username> # Expected: mnemonic printed once. Write it down. It is never stored. # Save the output — you cannot recover it later. ## STEP D — Register signing key (only after STEP C) hone key generate hone key register --account <username> --role posting # Expected: {"status":"ok"} or similar. Key saved to ~/.hone/key.json. ## STEP E — Check balance curl https://honemesh.net/api/balance/<username> # Expected: {"balance":10.0,"hunits":1000000000,...} # IF balance is 0 → run STEP F. Otherwise skip to STEP G. ## STEP F — Claim faucet (only if balance is 0) hone faucet claim <username> # Expected: {"status":"ok","amount":10,...} # Gives 10 HONE = 1,000,000,000 hunits ≈ 100,000 inference calls. ## STEP G — Generate API key (skip if HONE_API_KEY already set) grep HONE_API_KEY .hone/wallet.env 2>/dev/null # IF printed a value → already done. Skip to STEP H. hone wallet api-key-gen --mnemonic "word1 word2 ... word12" echo '.hone/wallet.env' >> .gitignore # Expected: .hone/wallet.env written with HONE_ACCOUNT and HONE_API_KEY. ## STEP H — Export env vars export $(grep -v '^#' .hone/wallet.env | xargs) # Required before making any API call. Verify: echo $HONE_ACCOUNT $HONE_API_KEY # Expected: <username> <64-char hex> ## STEP I — Verify with a test inference call curl -X POST https://honemesh.net/v1/chat/completions \ -H "Authorization: Bearer $HONE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"messages":[{"role":"user","content":"ping"}],"model":"dolphin-llama3"}' # Expected: {"choices":[{"message":{"content":"..."}}],"usage":{"fee_hunits":...}} # 401 → API key wrong. Re-run STEP G. # 402 → Balance too low. Re-run STEP F then retry. # 503 → No miner online. Try model "llama3" or "mistral".
Rules for agents
RuleReason
Never create a wallet without checking firstCreating a second wallet overwrites access to the first — tokens are unrecoverable
Never hardcode HONE_API_URLAlways read from env — the URL changes between testnet and mainnet
On 402, claim faucet once then retryDo not retry more than once — multiple faucet claims in rapid succession are rate-limited
Never commit .hone/wallet.envContains live signing keys — add to .gitignore immediately after creation
HONE_API_URL defaults to https://honemesh.netOverride to http://localhost:4242 to use a local node instead

One-time setup

Seven steps to your first inference call

From zero to a working account, API key, and first call.

1
Install the CLI
curl -fsSL https://honemesh.net/install | bash hone --version
2
Check for an existing wallet first
Do not create a new wallet if one already exists. You will lose access to your existing account and tokens.
# Any of these means you already have a wallet: ls ~/.hone/wallet.json 2>/dev/null && echo EXISTS ls .hone/wallet.env 2>/dev/null && echo EXISTS echo $HONE_ACCOUNT

If a wallet exists, skip to step 5.

3
Create your account (only if none exists)
hone wallet create --account myproject # Prints a 12-word mnemonic. Write it down — shown once, never stored.
4
Register your signing key (only if new account)
hone key generate hone key register --account myproject --role posting

Generates ~/.hone/key.json and registers its public key on-chain.

5
Check balance and claim tokens
curl https://honemesh.net/api/balance/myproject

If balance is 0:

hone faucet claim myproject # Or via Telegram: message @honebot with /faucet
Faucet gives 10 HONE — covers ~100,000 average inference calls. 1 HONE = 100,000,000 hunits.
6
Generate an API key
grep HONE_API_KEY .hone/wallet.env 2>/dev/null # If empty or missing: hone wallet api-key-gen --mnemonic "your twelve words here" echo '.hone/wallet.env' >> .gitignore
7
Set environment variables
HONE_ACCOUNT=myproject HONE_API_KEY=<64-char hex from api-key-gen> HONE_API_URL=https://honemesh.net export $(grep -v '^#' .hone/wallet.env | xargs)

Inference

POST /v1/chat/completions

Auth required. 100 hunits per token, minimum 1,000 per request. Fee is charged after the model responds from actual token counts.

curl -X POST https://honemesh.net/v1/chat/completions \ -H "Authorization: Bearer $HONE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [{"role":"user","content":"What is 2+2?"}], "model": "dolphin-llama3" }'

Response includes usage.fee_hunits — the exact cost.

// Cargo.toml hone-sdk = { git = "https://github.com/shindevlin/hone", subdirectory = "rust/hone-sdk" }
let client = HoneClient::from_env(); // reads env vars let resp = client.chat_completions( vec![json!({"role":"user","content":"Summarise this PR."})], None, ).await?; let text = resp["choices"][0]["message"]["content"].as_str().unwrap_or("");
const res = await fetch(`${process.env.HONE_API_URL}/v1/chat/completions`, { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.HONE_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ messages: [{ role: 'user', content: prompt }], model: 'dolphin-llama3', }), }); const data = await res.json(); const text = data.choices[0].message.content;
Error responses
StatusMeaningFix
401Missing or invalid API keyRun hone wallet api-key-gen
402Insufficient balanceClaim faucet — see below
429Rate limited (60 req / 60 s per IP)Back off and retry
503No miner available for this modelTry a different model
Auto-claim on 402 — agent pattern
match client.chat_completions(messages, None).await { Err(e) if e.to_string().contains("402") => { client.faucet_claim(&account).await?; client.chat_completions(messages, None).await? } r => r?, }

More services

Balance, Models, Git & Storage

Balance
curl https://honemesh.net/api/balance/myproject
let bal = client.balance("myproject").await?;
Available models
curl https://honemesh.net/api/node/models

Testnet: dolphin-llama3, llama3, mistral, qwen2.5, gemma2

Git hosting — LinkGit
hone repo init myproject git remote add hone \ https://git.honemesh.net/myproject/myrepo git push hone main
Storage heartbeat

Nodes that store data earn from the storage pool each epoch.

curl -X POST https://honemesh.net/api/entry \ -d '{ "type":"STORAGE_HEARTBEAT", "node_id":"myproject", "bytes_stored":1073741824, "proof_valid":true, "epoch":<current_epoch> }'
Async inference jobs

For jobs over ~30 s. Lifecycle: Posted → Awarded → Completed → Paid

hone inference post \ --account myproject \ --model llama3:70b \ --max-fee 100000 hone inference job <job_id>

Checklist

Ready to go live?

[ ] Check for existing wallet before creating a new one [ ] hone wallet create --account <name> [ ] hone key generate [ ] hone key register --account <name> --role posting [ ] hone faucet claim <name> [ ] hone wallet api-key-gen --mnemonic "..." [ ] echo '.hone/wallet.env' >> .gitignore [ ] Set HONE_ACCOUNT, HONE_API_KEY, HONE_API_URL in env [ ] Handle 402 by claiming faucet and retrying once [ ] Never hardcode HONE_API_URL — always read from env