Skip to main content

QuickStart

This page gets you from zero to your first call through TokHive in a few minutes. If you have an idle ChatGPT or Claude subscription, Supply your subscription shows how to earn from it.

TokHive's console is at https://console.tokhive.ai, and its API at https://api.tokhive.ai.

Use TokHive​

You can use any machine that runs an OpenAI or Anthropic client.

1. Create an account​

Register at console.tokhive.ai/register with an email address and a password of at least 8 characters. If someone invited you, their invite link fills in the optional Referral code field; see Referrals.

2. Create an API key​

In the console, open API Keys and click Create key. The key starts with hive_ and is shown only once, so copy it right away. You can revoke a key and create a new one at any time.

Save the key as HIVE_API_KEY, so your tools find it in every new terminal, not just the current one:

echo "export HIVE_API_KEY='hive_xxxxxxxxxxxxxxxxxxxxxxxxxxxx'" >> ~/.$(basename "$SHELL")rc
export HIVE_API_KEY='hive_xxxxxxxxxxxxxxxxxxxxxxxxxxxx'

The first line adds the key to ~/.zshrc or ~/.bashrc; the second sets it in the terminal you are using now.

The Setup guides on the API Keys page give you these commands with your own key filled in.

3. Add balance​

A new account has a balance of 0, and every inference request returns 402 insufficient_balance until you add funds.

TokHive accepts stablecoins today: USDT or USDC on Ethereum, and USDT0 on Conflux eSpace. Card and bank payments aren't supported yet.

Open Balances and click Deposit. Choose the network and the stablecoin, and TokHive gives you a deposit address that is permanently yours. Send the stablecoin to that address from your wallet or exchange; it is credited automatically after the network's confirmations. The amount is credited as US dollars, and your deposits are listed under Deposits in the ledger.

Check the network and the token

The deposit dialog shows the network, its chain ID, the token contract and how many confirmations a deposit needs. Send only that token, on that network, to that address. A transfer of another token or on another network may not be recoverable.

Deposits shows which network to choose, how to deposit from an exchange, and how to bridge USDT from other networks to Conflux eSpace.

4. Point your client at TokHive​

TokHive speaks both the OpenAI and the Anthropic API. You only change the base URL and the API key.

APIBase URL
OpenAI compatible (Responses, Chat Completions, Models)https://api.tokhive.ai/v1
Anthropic compatible (Messages)https://api.tokhive.ai/anthropic

Both accept Authorization: Bearer hive_.... The Anthropic API also accepts x-api-key: hive_..., which the Anthropic SDKs and Claude Code use by default. The API Keys page has copy buttons for both URLs.

Codex​

For a step-by-step walkthrough with screenshots, see Set Up Codex.

Merge this into ~/.codex/config.toml (on Windows, %USERPROFILE%\.codex\config.toml), keeping your other settings:

model = "gpt-6-sol"
model_provider = "tokhive"

[model_providers.tokhive]
name = "TokHive"
base_url = "https://api.tokhive.ai/v1/codex"
model_catalog_url = "https://api.tokhive.ai/v1/codex/models"
env_key = "HIVE_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false

Then run codex as usual. Codex uses its own endpoint under /v1/codex, which passes its requests through unchanged, so new Codex versions keep working.

Claude Code​

For a step-by-step walkthrough with screenshots, see Set Up Claude Code.

Merge this into ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json), keeping your other settings, then run claude:

{
"model": "claude-opus-5-5",
"env": {
"ANTHROPIC_BASE_URL": "https://api.tokhive.ai/anthropic",
"ANTHROPIC_AUTH_TOKEN": "hive_xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-2"
}
}

Claude Code reads this file in every terminal and editor, so you don't need shell variables. Besides your main model, it uses the opus, sonnet, haiku and fable aliases for subagents and background work; point each at a model TokHive offers, or those requests fail with model_not_found. The Setup guides fill all of these in from the models offered right now.

OpenCode​

Merge this into ~/.config/opencode/opencode.json, keeping your other settings, then run opencode:

{
"$schema": "https://opencode.ai/config.json",
"model": "tokhive/gpt-6-sol",
"provider": {
"tokhive": {
"npm": "@ai-sdk/openai",
"name": "TokHive",
"options": { "baseURL": "https://api.tokhive.ai/v1", "apiKey": "{env:HIVE_API_KEY}" },
"models": { "gpt-6-sol": { "name": "gpt-6-sol" } }
}
}
}

SDKs​

Pass the base URL and read the key from HIVE_API_KEY:

  • OpenAI SDK: OpenAI(base_url="https://api.tokhive.ai/v1", api_key=os.environ["HIVE_API_KEY"])
  • Anthropic SDK: Anthropic(base_url="https://api.tokhive.ai/anthropic", api_key=os.environ["HIVE_API_KEY"])

The API reference has Python and Node.js examples for every endpoint.

5. Make your first call​

curl https://api.tokhive.ai/v1/chat/completions \
-H "Authorization: Bearer $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-6-sol","messages":[{"role":"user","content":"Reply with exactly OK."}]}'

curl https://api.tokhive.ai/anthropic/v1/messages \
-H "x-api-key: $HIVE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"claude-opus-5-5","max_tokens":16,"messages":[{"role":"user","content":"Reply with exactly OK."}]}'

To see which models you can use right now:

curl https://api.tokhive.ai/v1/models -H "Authorization: Bearer $HIVE_API_KEY"

The list only includes models that currently have supply online, so it can get shorter when providers go offline.

Every call and its cost appear on the Call Records page.

Common errors​

ErrorMeaning and what to do
401 invalid_api_keyThe key is wrong or revoked. Create a new one.
402 insufficient_balanceYour balance is 0 or below. Add balance.
429 concurrency_limitThis key has too many requests in flight. Wait for the time in Retry-After and retry.
503 no_supplyNo supply can take the request right now. Retry shortly.
Balance is an entry check, not a spending cap

A request only needs a balance above 0 to start. It is charged for its actual usage when it finishes, so a long request can take your balance below 0.

Need help?​

Supply your subscription​

If your ChatGPT or Claude subscription has quota you don't use, you can supply it to TokHive with Bee, the Provider agent, and earn from every request it serves.

  1. Read Before You Supply: the account risk, what you earn, and what supplying does to your quota.
  2. Follow the Provider Quickstart to install Bee and start supplying, in about ten minutes.