mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-24 20:09:02 +00:00
docs: add Usage product section
Hanzo Usage — the universal AI connector / usage plane. Adds a Products doc section: overview (the story), @hanzo/usage quickstart (UsageStore + nodeHost/createTauriHost), console onboarding (console.hanzo.ai → AI Accounts), and teams/orgs (login sharing, verified routing, 1% routed fee, per-member analytics). Registered under Products in the root nav.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"llm",
|
||||
"mcp",
|
||||
"dev",
|
||||
"usage",
|
||||
"zap",
|
||||
"---Commerce & Billing---",
|
||||
"commerce",
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: Console onboarding
|
||||
description: Connect your AI accounts at console.hanzo.ai and read the unified usage dashboard.
|
||||
---
|
||||
|
||||
import { Steps, Step } from '@hanzo/docs-base-ui/components/steps';
|
||||
|
||||
# Console onboarding
|
||||
|
||||
Connect your accounts once in the console and the same unified usage follows you
|
||||
across the `dev` CLI, Hanzo Desktop, hanzo.app, and hanzo.chat.
|
||||
|
||||
## Connect your accounts
|
||||
|
||||
<Steps>
|
||||
<Step>
|
||||
### Open AI Accounts
|
||||
|
||||
Sign in to [console.hanzo.ai](https://console.hanzo.ai) and open the
|
||||
**AI Accounts** section (`/ai-accounts`).
|
||||
</Step>
|
||||
<Step>
|
||||
### Add an account
|
||||
|
||||
On the **Accounts** tab, choose a provider — OpenAI (Codex), Anthropic (Claude),
|
||||
Hanzo, or any of the 50+ supported providers — and complete the guided
|
||||
account-connect flow. It reuses your existing login (OAuth, browser session, or
|
||||
API key); no passwords are stored.
|
||||
</Step>
|
||||
<Step>
|
||||
### Repeat for every account
|
||||
|
||||
Link as many accounts as you like, including GPU, cloud, and integration
|
||||
providers (payments, ecommerce, marketing, analytics). Each connected account
|
||||
appears in the unified dashboard.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## What the unified dashboard shows
|
||||
|
||||
For every connected account, in one view:
|
||||
|
||||
- **Rate limits** and time-to-reset for each window
|
||||
- **Credits** and remaining balance
|
||||
- **Spend** to date
|
||||
- **Source** each figure was read from (OAuth, web session, CLI, or API token)
|
||||
|
||||
The dashboard reads through the same [`@hanzo/usage`](/docs/usage/quickstart)
|
||||
core used by the CLI and desktop apps, so the numbers match everywhere.
|
||||
|
||||
## Next
|
||||
|
||||
Ready to bring in your team? See [Teams & orgs](/docs/usage/teams).
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
title: Usage
|
||||
description: One usage plane for every AI account you have — rate limits, credits, and spend across Codex, Claude, Hanzo, and 50+ providers.
|
||||
index: true
|
||||
---
|
||||
|
||||
import { Card, Cards } from '@hanzo/docs-base-ui/components/card';
|
||||
|
||||
# Hanzo Usage
|
||||
|
||||
**Hanzo Usage** is the universal AI connector and usage plane. Link your AI
|
||||
provider accounts once, then see unified usage — rate limits, resets, credits,
|
||||
and spend — everywhere Hanzo runs: the `dev` CLI, Hanzo Desktop, hanzo.app,
|
||||
hanzo.chat, and [console.hanzo.ai](https://console.hanzo.ai).
|
||||
|
||||
## The story
|
||||
|
||||
1. **Connect once.** Link OpenAI (Codex), Anthropic (Claude), Hanzo, and 50+
|
||||
providers — plus GPU, cloud, and integration accounts (payments, ecommerce,
|
||||
marketing, analytics) — using logins you already have. No passwords stored.
|
||||
2. **See unified usage.** One view across every account: limits, resets,
|
||||
credits, and spend, native in every Hanzo surface.
|
||||
3. **Add your org.** Optionally share verified logins org-wide and route AI
|
||||
usage through Hanzo's backend for a comprehensive view, analytics, and
|
||||
per-member reporting. A 1% fee applies to routed usage.
|
||||
4. **Pay OSS AI devs.** Hanzo is an AI-native cloud designed to route spend back
|
||||
to the open-source AI ecosystem it runs on.
|
||||
|
||||
## How it works
|
||||
|
||||
The engine is [`@hanzo/usage`](/docs/usage/quickstart) — a headless TypeScript
|
||||
core (a fork of the MIT CodexBar app). Each provider is a descriptor with an
|
||||
ordered pipeline of fetch strategies (`oauth` → `web` → `cli` → `apiToken` →
|
||||
`localProbe`) that reuse your existing logins — CLI OAuth token files, browser
|
||||
sessions, API keys. Strategies fall back in priority order and never ask for
|
||||
passwords. The same core drives the macOS menu-bar app, the CLI, the desktop
|
||||
and web apps, and the console.
|
||||
|
||||
<Cards>
|
||||
<Card
|
||||
title="Quickstart"
|
||||
description="Install @hanzo/usage and read usage in ~15 lines"
|
||||
href="/docs/usage/quickstart"
|
||||
/>
|
||||
<Card
|
||||
title="Console onboarding"
|
||||
description="Connect accounts at console.hanzo.ai → AI Accounts"
|
||||
href="/docs/usage/console"
|
||||
/>
|
||||
<Card
|
||||
title="Teams & orgs"
|
||||
description="Login sharing, verified routing, and per-member analytics"
|
||||
href="/docs/usage/teams"
|
||||
/>
|
||||
</Cards>
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"title": "Usage",
|
||||
"description": "Hanzo Usage — one usage plane for every AI account you have",
|
||||
"icon": "Gauge",
|
||||
"defaultOpen": false,
|
||||
"pages": [
|
||||
"quickstart",
|
||||
"console",
|
||||
"teams"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: Quickstart
|
||||
description: Install @hanzo/usage and read unified AI usage in ~15 lines of TypeScript.
|
||||
---
|
||||
|
||||
# Quickstart
|
||||
|
||||
`@hanzo/usage` is the headless core behind Hanzo Usage. It runs in Node,
|
||||
Next.js, and Tauri, and ships built-in providers for Hanzo, Codex, and Claude
|
||||
(the registry is extensible).
|
||||
|
||||
## Install
|
||||
|
||||
```bash title="Install"
|
||||
npm install @hanzo/usage
|
||||
```
|
||||
|
||||
## Read usage
|
||||
|
||||
Create a `UsageStore`, give it a host for your environment, and start the poll
|
||||
loop. The store is observable — subscribe to render, or use the React hook.
|
||||
|
||||
```ts title="usage.ts"
|
||||
import { UsageStore, allProviders } from '@hanzo/usage'
|
||||
import { nodeHost } from '@hanzo/usage/node' // or createTauriHost from '@hanzo/usage/tauri'
|
||||
|
||||
const store = new UsageStore({
|
||||
host: nodeHost,
|
||||
providers: allProviders, // hanzo, codex, claude — registry-extensible
|
||||
historyDir: `${process.env.HOME}/.config/hanzo/usage/history`,
|
||||
})
|
||||
|
||||
store.start() // 5-minute poll, CodexBar-compatible history files
|
||||
store.subscribe(() => console.log(store.getState()))
|
||||
```
|
||||
|
||||
## In Tauri (Hanzo Desktop, hanzo.app)
|
||||
|
||||
Pass the Tauri plugin modules in — the core stays dependency-free for web and
|
||||
Node bundles:
|
||||
|
||||
```ts title="tauri-host.ts"
|
||||
import * as fs from '@tauri-apps/plugin-fs'
|
||||
import { fetch } from '@tauri-apps/plugin-http'
|
||||
import { homeDir } from '@tauri-apps/api/path'
|
||||
import { createTauriHost } from '@hanzo/usage/tauri'
|
||||
|
||||
const host = await createTauriHost({ fs, fetch, homeDir })
|
||||
```
|
||||
|
||||
## In React
|
||||
|
||||
```ts title="Component.tsx"
|
||||
import { useUsage } from '@hanzo/usage/react'
|
||||
|
||||
const state = useUsage(store) // re-renders on every refresh
|
||||
```
|
||||
|
||||
Each provider runs an ordered pipeline of fetch strategies (`oauth` → `web` →
|
||||
`cli` → `apiToken` → `localProbe`) that reuse logins you already have, so no
|
||||
passwords are ever requested or stored.
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: Teams & orgs
|
||||
description: Share verified logins org-wide, route AI usage through Hanzo, and get per-member analytics.
|
||||
---
|
||||
|
||||
# Teams & orgs
|
||||
|
||||
Individual usage tracking is free and local. Add your organization to share
|
||||
access and get a comprehensive, routed view of AI usage across your team.
|
||||
|
||||
## Login sharing
|
||||
|
||||
Invite your organization and share verified provider logins org-wide. Members
|
||||
use shared accounts without ever seeing raw credentials — connections are
|
||||
verified once and made available to the team, scoped to your org.
|
||||
|
||||
## Verified routing through Hanzo
|
||||
|
||||
Optionally route AI usage through Hanzo's backend. Routed traffic is measured
|
||||
centrally, giving your org:
|
||||
|
||||
- A **comprehensive view** of every request across all members and providers
|
||||
- **Analytics** on spend, limits, and utilization over time
|
||||
- **Per-member reporting** — see usage broken down by person and account
|
||||
|
||||
## Pricing
|
||||
|
||||
Individual usage tracking is free. Routing through Hanzo carries a **1% fee on
|
||||
routed usage** — that is the only charge for the org-wide routing, sharing, and
|
||||
analytics layer. Provider costs continue to be billed by each provider.
|
||||
|
||||
## Why route through Hanzo
|
||||
|
||||
Hanzo is the universal connector and integration-management layer for AI, and an
|
||||
AI-native cloud designed to pay open-source AI developers. Routing your usage
|
||||
through Hanzo funds that ecosystem while giving your org a single, verified
|
||||
system of record for AI spend.
|
||||
Reference in New Issue
Block a user