Borrowing it
Nothing to install: this file belongs to gotgenes/pi-anthropic-auth. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/gotgenes/pi-anthropic-auth/main/.pi/skills/anthropic/SKILL.mdgit clone --depth 1 https://github.com/gotgenes/pi-anthropic-authWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/anthropic)<a href="https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/anthropic"><img src="https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/anthropic/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/gotgenes/pi-anthropic-auth/anthropic"><img src="https://agentmods.dev/badge/skills/gotgenes/pi-anthropic-auth/anthropic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.02020 |
| Opus 5 | $0.00024 | $0.01010 |
| Sonnet 5 | $0.00010 | $0.00404 |
| Haiku 4.5 | $0.00005 | $0.00202 |
Grade A, and why
anthropic scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Anthropic OAuth Compatibility
Use When
- Anthropic OAuth requests fail with
You're out of extra usage. - Pi Anthropic OAuth works for login but fails for actual requests.
- You need to compare Pi, OpenCode, and
opencode-anthropic-authbehavior. - You need to decide whether a fix belongs in
before_provider_request, thestreamSimpletransport wrapper, or a deeper override.
Core Lessons
- Treat Anthropic's
You're out of extra usage.error as a possible disguised request rejection, not only a billing problem. - Prefer the thinnest fix that works.
- Preserve Pi's built-in Anthropic behavior by default.
- Prefer request shaping before prompt rewriting.
- Avoid
streamSimpleunless hooks are clearly insufficient — they are insufficient for compaction and background-agent calls, which is why this repo wraps the transport (Issue #18).
Repo-Specific Findings
Confirmed Pi upstream behavior
- Pi already handles Claude Code OAuth headers, Claude Code identity injection, native Anthropic OAuth login, and tool-name normalization.
- Pi auth storage already refreshes OAuth tokens under a lock.
Confirmed local fixes
- OAuth Anthropic payload shaping prepends an
x-anthropic-billing-headersystem block. - The billing block must not add
cache_control, or Anthropic can reject the request for exceeding the cache-control block limit. - Assistant message ordering must be normalized when Pi serializes
[tool_use..., text]for Anthropic. - Pi's default system prompt can act as an Anthropic fingerprint and trigger disguised rejection errors.
- Shaping runs in a thin
streamSimpletransport wrapper (delegating to Pi's built-in Anthropic transport, resolved from the installed pi-ai layout), gated on thesk-ant-oattoken. - The wrapper covers the main loop and compaction — everything that dispatches through
modelRuntime. - On pi >=0.80.8,
agentLoopbackground agents and extensions calling pi-ai'scompat.streamSimpledirectly are confirmed uncovered, and cannot be covered from this extension (Issue #46); seedocs/architecture.mdfor why, and for theagent.streamFunctionworkaround.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 147 lines · 49 tokens per session scan A b6f22c5f324d
anthropic is a skill published in the GitHub repository gotgenes/pi-anthropic-auth (241 stars, last pushed 4d ago), licensed MIT. It adds 49 tokens to every session and 2,020 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
surf
Control Chrome browser via CLI for testing, automation, and debugging. Use when the user needs browser automation, screenshots, form filling, page inspection, network/CPU emulation, DevTools streaming, or AI queries via ChatGPT/Gemini/Perplexity/Grok/AI Studio.
auth-patterns
Use when implementing authentication (JWT, sessions, OAuth), authorization (RBAC, ABAC), password hashing, MFA, or security best practices for backend services.
watcha-oauth
A guide to adding Watcha sign-in to a website or mobile app through OAuth 2.0, a standard way for users to grant access without sharing their password.
zhihu-oauth
A guide to adding Zhihu sign-in to a web application through OAuth 2.0, a standard way for users to grant another service limited access without sharing their password.
n8n-integration-testing-patterns
API contract testing, authentication flows, rate limit handling, and error scenario coverage for n8n integrations with external services. Use when testing n8n node integrations.
prisma-database-setup
Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".