{"article":{"title":"Sharing a subscription","breadcrumb":["Guides","Sharing a subscription"],"body":"**What this covers**: taking a monthly coding subscription from start to finish. Run a node on your own machine, connect the subscription as a channel, use it yourself, then list it on the [Token Market](token-market).\n\nThe subscription key stays on your node; Tare never stores it. Every call runs on that node, yours and buyers' alike.\n\n### Which subscriptions work\n\nThe endpoint list for a new subscription channel offers:\n\n| Endpoint | Address |\n|---|---|\n| GLM Coding Plan (bigmodel.cn) | `https://open.bigmodel.cn/api/coding/paas/v4` |\n| GLM Coding Plan (z.ai) | `https://api.z.ai/api/coding/paas/v4` |\n| Kimi For Coding | `https://api.kimi.com/coding/v1` |\n| MiniMax Coding Plan | `https://api.minimaxi.com/v1` |\n| Local address on the node | An OpenAI-compatible service you run on that machine, for example `http://127.0.0.1:8317/v1` |\n\nA subscription that is not in the list works too if it is called with a key over an OpenAI-compatible API: pick **Custom** and enter the address.\n\n### 1. Run a node on a machine that stays on\n\nA subscription channel runs only on the node that holds it, and it is skipped while that node is offline. Pick a machine that stays powered on and online. Linux suits this best; a node on a Mac runs only while someone is logged in.\n\n```bash\n# Linux (needs root)\nsudo bash <(curl -fsSL https://www.jamerly.ai/tare-local-node/install.sh)\n\n# macOS (no sudo)\nbash <(curl -fsSL https://www.jamerly.ai/tare-local-node/install.sh)\n```\n\nRun in a terminal, the script shows a code and a link. Open the link on any device where you are signed in to jamerly.ai, check the code, and approve; the registration token and the Inference key are created for you. For an unattended install, pass `--token \"<registration token>\" --key \"<API key>\"` as before; the token comes from Console → **Local Nodes** → **Generate registration token**.\n\nOnce installed, the node appears on the **Local Nodes** page as **Online** and **Tunnel connected**. It needs node version 0.4.9 or later; re-run the install command to upgrade an older one.\n\nIf you will sell to others, open UDP 8091 on this machine. Buyers' nodes then connect straight to yours instead of going round through Tare. When they cannot connect, calls go through Tare as usual. Installation details and the other variables are in [Local Nodes](local-nodes).\n\n### Do it all from the node: `tare-local-node share`\n\nOn the machine from step 1, run:\n\n```bash\n# Linux\nsudo tare-local-node share\n\n# macOS\ntare-local-node share\n```\n\nIt shows a code and a link. Open the link on any device where you are signed in to jamerly.ai, check that the code matches the one in the terminal, and approve. The command then lists what this machine can share:\n\n- OpenAI-compatible servers running on it (Ollama, vLLM, LM Studio, llama.cpp) and their models. **Add a local or LAN address** adds another one, including a server on another machine in your network.\n- Coding subscriptions. **Add a subscription**: pick the endpoint and type the key. The key is written to this node's `keys.json` and nowhere else.\n\nFor each model, choose **use myself** or **use + sell**. To sell, set the input and output price and how many tokens to sell per period. Press `s` to apply: it creates the channel, writes the key, adds the routes, creates the listing and submits it for review, then makes a test call through this node. Run it again later to change a price, take a model off, or remove a whole channel (`d`). It needs node version 0.4.33 or later.\n\nFor models on this machine (Ollama, LM Studio and so on), see [Sharing local models](local-models).\n\nThe steps below do the same by hand in the console.\n\n### 2. Create the subscription channel\n\n1. Console → **Channels** → **Add channel**, then switch to **Self-hosted** at the top.\n2. Under **Node**, pick the node from step 1. With no node installed yet, pick **New machine…**; the command in step 3 installs the node as well.\n3. In the list to the left of **Base URL**, pick your subscription; the address fills in. Give it a recognizable **Name**.\n4. Save.\n\nThere is no key field on this form. After saving, the bottom of the dialog shows the command to run on the node's machine; click **Copy**. With **New machine…**, the command carries a one-time registration token that is shown only this once and is valid for 24 hours. If it expires, open the channel again, pick **New machine…** under Node again and save.\n\n### 3. Put the subscription key on the node\n\nOn the node's machine, run the command copied in step 2. It looks like this (`123` is the channel id):\n\n```bash\n# Linux\nsudo bash <(curl -fsSL https://www.jamerly.ai/tare/share.sh) --channel 123\n\n# macOS (no sudo)\nbash <(curl -fsSL https://www.jamerly.ai/tare/share.sh) --channel 123\n```\n\nThe script asks for the subscription key on the machine itself and writes it to the node's `keys.json`. It then has you pick a model routed to this channel, makes one test call through the local node and reports what happened on this channel: success, the key was rejected by the provider, the key has not been picked up yet, or another channel served the model. With no node on the machine it runs the installer first (add `--token <registration token>`); a node older than 0.4.9 is upgraded first. `--remove` deletes the channel's key.\n\nTo do it by hand instead, create `keys.json` on that node and add the key under the channel id:\n\n| System | File |\n|---|---|\n| Linux | `/etc/tare-local-node/keys.json` |\n| macOS | `~/.config/tare-local-node/keys.json` |\n\n```bash\n# Linux example, channel id 123\nsudo tee /etc/tare-local-node/keys.json >/dev/null <<'EOF'\n{\"123\": \"<your subscription key>\"}\nEOF\nsudo chmod 600 /etc/tare-local-node/keys.json\n```\n\n- One entry per subscription channel on the node.\n- Takes effect within 10 seconds, with no restart. Re-running the install command to upgrade leaves the file alone.\n- If the endpoint is **Local address on the node** and the local service does not check keys, the entry is still required; any non-empty value works.\n\n### 4. Use it yourself first\n\nGive the subscription a route: Console → **Routing** → **Add route**.\n\n| Field | Value |\n|---|---|\n| Model | The name you will call it by, for example `my-glm` |\n| Channel | The subscription channel from step 2 |\n| Upstream name | The model name from the subscription provider's docs |\n\nTare cannot list the upstream models of a subscription channel because it does not hold the key, so type **Upstream name** in by hand.\n\nTry a call on the node's machine:\n\n```bash\ncurl http://127.0.0.1:8090/v1/chat/completions \\\n  -H \"Authorization: Bearer $TARE_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"model\": \"my-glm\", \"messages\": [{\"role\": \"user\", \"content\": \"hello\"}]}'\n```\n\nA 200 means it is connected. On a 503, check the node log: a missing key shows up as `WARNING: channel 123 skipped`, naming the channel id and the file to add it to. The log commands are under \"Keeping the node running\" in [Local Nodes](local-nodes).\n\nFrom then on the model name works everywhere: against this node, against another of your nodes (nodes connect directly), against `https://tare.jamerly.ai/v1` (Tare hands the call to this node over the tunnel), and in coding tools as described in [Coding tools](coding-tools).\n\n### 5. List it on the market\n\nBefore your first sale, set up a seller profile: Console → **Market** → **Selling**, fill in a name, profile address and bio, and click **Start selling**. The profile address cannot be changed afterwards.\n\nThen create the listing:\n\n1. **New listing**: pick this subscription channel, and enter the **Upstream name** from step 4 as the upstream model.\n2. Enter input and output prices per million tokens. Cache read and write prices are optional.\n3. Set **Tokens for sale** to **Limited**. Subscriptions have their own usage caps (many reset every 5 hours or every week), so keep the amount sold per period under that cap and leave room for your own use. Periods are every 5 hours, daily, every 7 days, every 30 days or never reset, and **Quota** changes it at any time.\n4. **Submit for review**. Tare runs a [channel evaluation](channels) on this channel. The evaluation runs on your node and uses the subscription's own allowance. The listing goes live if no check fails.\n\nThe listing shows on the price page [/market](/market) and on your seller profile, with its source marked as running on the seller's machine. Buyers' prompts and replies pass through your node.\n\n### 6. After it is listed\n\n- **Earnings**: you receive the full listing price for each call. It is held for 7 days, then credited to your wallet as \"Market earning\". **Market** → **Earnings** shows held and settled amounts and has monthly CSV statements.\n- **Keep the node online**: while the node is offline the listing is skipped, and the buyer's call goes to the other candidates in their route.\n- **Usage reconciliation**: both nodes report token counts for these calls and Tare reconciles them. When a report does not match the content actually sent and received, Tare's own count is billed, and repeated mismatches pause the listing.\n- **Price changes**: decreases apply immediately; increases apply after 7 days.\n- **Delisting**: after **Delist** the listing takes no new traffic, and recorded earnings settle as usual. When the subscription ends or you stop selling, delist first, then remove the entry from `keys.json`.\n\nRelated: [Token Market](token-market), [Local Nodes](local-nodes), [Routing](routing).\n"}}