scaledthought 0.0.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ScaledThought Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,63 @@
1
1
  # scaledthought
2
2
 
3
- The CLI for [ScaledThought](https://scaledthought.com): headless open-model inference run by your agent.
3
+ The CLI for [ScaledThought](https://scaledthought.com): headless, OpenAI-compatible inference for
4
+ open-weight models, hosted in the US or Canada. It's built for coding agents: it never prompts, prints
5
+ JSON when stdout isn't a terminal, and every error is one JSON line on stderr with a non-zero exit.
4
6
 
5
- **Not launched yet.** This release only reserves the name. Running it prints a notice and exits; it makes no network calls.
7
+ Agents: the full setup protocol is at <https://scaledthought.com/llms.txt>.
8
+
9
+ ```bash
10
+ npx -y scaledthought@latest init --region us # or: --region ca (data stays in Canada)
11
+ ```
12
+
13
+ `init` creates an account, writes `ST_API_KEY` and `ST_BASE_URL` to `./.env` (mode 0600), adds `.env` to
14
+ `.gitignore`, and prints the account, its credit balance (`balance_usd`, `needs_credits`), the models live in your
15
+ region, `next_command` and `next_steps`.
16
+ Running it again is safe. If a key already exists it returns `"already_initialized": true` and the
17
+ account status instead of creating a second account.
18
+
19
+ If you arrived through a `scaledthought.com/go/<code>` link, its instructions add `--source <code>` (a campaign code
20
+ such as `a-rd`, stored on the new account so we know which campaign worked). It's optional, and a value that isn't a
21
+ code is dropped with a warning rather than failing `init`. On some US campaigns the human can copy an opt-in prompt
22
+ ending in `(ad click <token>)`; the `/go` instructions then tell the agent to add `--ad-click <token>` (the token is
23
+ in the prompt, never in the link). A malformed token is dropped with a warning, and the flag is ignored outside `us`.
24
+ Turn ad measurement off at any time with `account ad-measurement off` (nothing about the account is then sent to any
25
+ ad platform). `account` and `account ad-measurement` print `ad_measurement` (true only when something about the
26
+ account could be sent: a `us` account that signed up with an ad click and hasn't opted out; always false in `ca`) and
27
+ `ad_measurement_opt_out` (the stored preference). Neither flag is a secret.
28
+
29
+ Inference is prepaid, and a new account has no credits: until your human pays, completions return
30
+ `402 insufficient_credits`. So the first thing after `init` is a top-up your human approves:
31
+
32
+ ```bash
33
+ npx -y scaledthought@latest billing topup --amount-usd 5 # prints approval_url and topup_id
34
+ # show your human the approval_url, exactly as printed; they pay by card
35
+ npx -y scaledthought@latest billing wait # returns once they've paid; on topup_pending run it again
36
+ ```
37
+
38
+ `billing wait` returns within about 90 seconds (`--timeout-s` to change it), under Claude Code's default 2-minute
39
+ shell timeout. Prefer it to `billing topup --wait`: an agent's shell tool usually shows a command's output only when it
40
+ ends, so the link would reach the human only after the payment it is waiting for.
41
+
42
+ ```bash
43
+ npx -y scaledthought@latest models --live # models serving in your region now
44
+ npx -y scaledthought@latest chat -m auto "Reply with OK" # one real completion
45
+ npx -y scaledthought@latest mcp # `claude mcp add …` command + JSON config
46
+ npx -y scaledthought@latest account # plan, region, spend
47
+ npx -y scaledthought@latest account ad-measurement off # opt out of ad measurement
48
+ ```
49
+
50
+ Other commands: `keys list|create|rotate|revoke|revoke-self` (`keys create --expires-in 30d --scopes inference --child`, `keys rotate <id> --grace 24h`), `usage`, `billing status|topup|wait|auto-reload|transactions`, `batches …`,
51
+ `fine-tune …`, `benchmarks <id>`, `status` (with your account's notices when a key is set), `doctor` (setup check),
52
+ `webhooks add <url> [--events …]|list|remove <id>` (signed callbacks), `transcribe <file>` (speech to text, `--translate` for English,
53
+ `--format srt|vtt|text|verbose_json`) and `speak -o out.mp3 "text"` (text to speech, streamed to the file; US
54
+ only for now) and `realtime --model <id> --input question.wav --output reply.wav` (one spoken turn over the realtime
55
+ WebSocket; mono 16-bit 24 kHz WAV; paid from prepaid credits). Add `--help` to any of them.
56
+
57
+ Use the key from any OpenAI SDK: `base_url = $ST_BASE_URL`, `api_key = $ST_API_KEY`.
58
+
59
+ - Keys are read from `ST_API_KEY` or `./.env`, never from flags.
60
+ - The key's prefix (`st_us_…` / `st_ca_…`) picks the region's hosts. Requests never cross regions.
61
+ - Errors look like `{"error":{"code":"…","message":"…","hint":"…"}}`. Exit code 2 means bad usage, 1 anything else.
62
+
63
+ Before the first credit purchase an account has lower limits: 60 requests/min per key and up to 5 keys.