Embed Claude Proxy Locally is a development Claude Skill built by Jasper Zhang. Best for: Backend developers add Claude API access to existing apps without separate servers or external exposure..
Integrate claude-sub-proxy as an internal service into your project with 4 files and localhost configuration.
Embed claude-sub-proxy as an internal service within another project. Minimal footprint — 4 JS files + config, running on localhost with no external exposure.
Trigger this skill when the user wants to:
Check that credentials exist:
cat ~/.claude/.credentials.json
# Should contain claudeAiOauth.accessToken
If not authenticated, run claude to log in.
Option A — Copy source files (recommended):
# From the claude-sub-proxy repo, copy these files into your project:
mkdir -p your-project/claude-proxy
cp src/server.js src/claude-executor.js src/format-bridge.js src/logger.js src/config.txt your-project/claude-proxy/
Option B — Git submodule:
git submodule add <repo-url> claude-proxy
npm install @anthropic-ai/claude-agent-sdk
For embedded use, set these environment variables in your app's startup:
| Variable | Recommended Value | Description |
|----------|------------------|-------------|
| CSP_PORT | 42069 (or any free port) | Proxy listening port |
| CSP_HOST | 127.0.0.1 | Localhost only — no external exposure |
| CSP_LOG_LEVEL | WARN | Quiet logging for embedded use |
No CSP_PROXY_API_KEY needed — the proxy runs on localhost as an internal service.
Option A — Background process in your start script:
// package.json
{
"scripts": {
"start": "concurrently \"node claude-proxy/server.js\" \"your-app-start-command\""
}
}
npm install concurrently --save-dev
Option B — Programmatic start:
import { startServer } from './claude-proxy/server.js';
startServer();
Option C — PM2:
pm2 start claude-proxy/server.js --name claude-proxy
Node.js:
const response = await fetch('http://127.0.0.1:42069/v1/messages', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'claude-sonnet-4-6',
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello!' }]
})
});
const data = await response.json();
Python:
import anthropic
client = anthropic.Anthropic(
base_url="http://127.0.0.1:42069",
api_key="not-needed"
)
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)
curl:
curl -X POST http://127.0.0.1:42069/v1/messages \
-H "Content-Type: application/json" \
-d '{"model":"claude-sonnet-4-6","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'
# Health check
curl -s http://127.0.0.1:42069/health
# → {"status":"ok","server":"claude-sub-proxy","timestamp":...}
# Auth check
curl -s http://127.0.0.1:42069/auth/status
# → {"authenticated":true,"source":"claude_credentials","expires_at":"..."}
CSP_HOST=127.0.0.1, no external exposuretools: [] by default, pure API proxy/plugin install embed-claude-proxy-locally@Ring8688Requires Claude Code CLI.
Backend developers add Claude API access to existing apps without separate servers or external exposure.
No reviews yet. Be the first to review this skill.