Anthropic Agent SDK Relay — Development skill for Claude Code
Anthropic Messages API endpoint answered by the Claude Agent SDK, so self-hosted n8n can use a Claude subscription instead of per-token API billing.
How to install Anthropic Agent SDK Relay
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open rinukkusu/anthropic-agent-sdk-relay and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Anthropic Agent SDK Relay does
Anthropic Messages API endpoint answered by the Claude Agent SDK, so self-hosted n8n can use a Claude subscription instead of per-token API billing.
Alternatives in Development
- Claude API — Build apps with the Claude API or Anthropic SDK 94.1k ★
- Ccusage — CLI for analyzing Claude Code/Codex usage from local JSONL files 11.8k ★
- Microsandbox — Open-source self-hosted MicroVM sandboxes with sub-200ms startup, hardware-level isolation via libkrun 5k ★
README
anthropic-agent-sdk-relay
An Anthropic Messages API endpoint that is answered by the Claude Agent SDK instead of the Claude API, so a self-hosted n8n can use a Claude subscription rather than per-token API billing.
Point n8n's Anthropic credential at this service and the Agent node works as usual, tools included.
What it does
n8n Agent node ──POST /v1/messages──▶ relay ──▶ Claude Agent SDK ──▶ Claude
▲ │
└────── tool_use / tool_result ───┘
The interesting part is tool calling. n8n runs its own tools and expects the model to emit `tool_use` blocks; the Agent SDK does the opposite and executes tools itself. The relay closes that gap:
- Every tool the client declares is registered as an in-process MCP tool.
- When Claude calls one, the handler's promise is parked, not resolved.
- The HTTP response ends with
stop_reason: "tool_use"carrying that call. - n8n runs the tool and posts a history ending in
tool_result. - The relay matches the result to the parked promise and the same live session carries on.
Because the session stays open between requests, nothing is replayed and the agent loop never learns that a tool round-trip crossed a network boundary.
Requirements
- Bun 1.2 or newer
- A Claude Pro or Max subscription
- Claude Code credentials reachable by the process (see below)
Quick start
bun install
cp .env.example .env # set RELAY_API_KEY
bun run start
Or pull the published image, built for amd64 and arm64 on every push to `main`:
docker run --rm -p 8787:8787 --env-file .env ghcr.io/rinukkusu/anthropic-agent-sdk-relay:latest
curl http://127.0.0.1:8787/v1/messages -H "x-api-key: $RELAY_API_KEY" -H 'content-type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":256,"messages":[{"role":"user","content":"pong?"}]}'
Authentication
Two separate secrets are in play.
**Callers to the relay** present `RELAY_API_KE
Related Skills
Opencode Anthropic Auth Fix
One-command OpenCode fix for Anthropic subscription billing. Installs @ex-machina/opencode-anthropic-auth, pat
Openclaw Billing Proxy
Route OpenClaw API requests through Claude Code subscription billing instead of Extra Usage
Dario
A local OpenAI- and Anthropic-compatible proxy that brings your Claude Pro/Max subscription to Cursor, Cline,
Open Agent SDK
Agent SDK API for local/self-hosted LLMs via OpenAI-compatible endpoints
Otherside CLI
Totally Free Claude Code inspired terminal coding agent. Multi-provider: Anthropic, Codex, Gemini, Kimi, DeepS
Ccledger
Team usage ledger for Claude Code. Self-hosted OTLP ingest into SQLite, with a per-person dashboard. Independe
Related Agents
Openrouter Agent
Runs a model from any of ~60 vendors through OpenRouter's OpenAI-compatible endpoint, billed per token against
Payment Integration
Payment systems integration specialist. Use PROACTIVELY for Stripe, PayPal, and payment processor implementati
Spgr Agent Billing
Owns the SaaS revenue model: Stripe integration, subscription lifecycle, usage metering, dunning, plan entitle