Add support for Claude Code Token - #32
Conversation
|
Maybe not the best timing on this, given Anthropic have cracked down. Gonna sit on this one, curious what others think? |
|
I say give us the option at our own risk. Anthropic is intentionally vague about whether this is allowed or not. |
It's technically against TOS but after their statement yesterday they went out on X and said the crackdown was misunderstood and due to "docs cleanup". In my opinion, let people use it at their own risk. The reward greatly outweighs the risk as API pricing is simply not reasonable for individuals who want to use 4.6 |
…builder PR spacedriveapp#32's build_anthropic_request was used for all Anthropic-compatible providers, sending MiniMax requests to Anthropic's API with OAuth headers. Split into call_anthropic (OAuth, adaptive thinking, prompt caching, tool normalization) and call_anthropic_compatible (plain Anthropic message format for third-party providers like MiniMax).
|
@jamiepine if we're aligned I can rebase to get it in. |
|
why not use opencode to spawn claude instances? that would be fine with TOS. Basically run a claude -p ralph loop on it. |
|
Don't bother. They straight up changed something on their end yesterday evening. Anthropic only accepts OAuth based keys from Claude code now as far as I can tell? Anyone still running an agent on their sub? I had to go to GLM on my OpenClaw. |
I've been running on my sub all day 🤷 |
68a979e to
2abcf5a
Compare
- Add support for `claude setup-token` as the Anthropic API Key - Add support for dynamic-thinking per router for supported models Clean up Revert quickstart
Tasks spacedriveapp#32 and spacedriveapp#33. ChannelDetail recorded a channel as opened only after its pin loop ran twelve frames, but the effect's cleanup cancels the pending frame whenever rowCount changes, and rowCount changes on nearly every commit while history streams in. The loop restarted before it finished, so the channel was never recorded as opened, `opening` stayed true, and the distance check that releases the reader was skipped on every update — a reader who scrolled up was pulled back to the bottom. The channel is now recorded on the first pin, so the loop still spans the settling frames but can actually reach its release condition. PortalTimeline dropped every worker_run row whose id was absent from api.workersList(limit: 20), which is a page of the agent's most recent workers filtered by channel, not this conversation's full set. Worker rows vanished while that query was pending and stayed hidden for good once the agent passed twenty workers. The filter was also unnecessary: renderTimelineItem already falls back to synthesizeWorker for a worker outside the page. The timeline renders every item and the query only enriches what is there.
Summary
Details
Inspired & Ported from PI-AI OAuth token authentication.
Anthropic API keys prefixes are auto-detected and route differently depending on whether it stems from a
claude setup-tokenTool name normalization - When using a
claude setup-token, tool names are mapped to Claude Code canonical casing on the way out, and reverse-mapped back to original names on responses.Prompt caching - System prompt blocks and the last tool definition get cache_control attached
Adaptive thinking - 4.6-generation models (opus-4-6, sonnet-4-6) get
thinking: { type: "adaptive" }with configurable effort per routing slot. Opus defaults to max, others to high.Test plan
claude setup-tokenand use that as your API key for Anthropic.Known issues