Skip to content

feat: Surplus inference callable from Luca on Hermes via Zetta proxy#167

Merged
danbuildss merged 1 commit into
mainfrom
claude/luca-aeon-skills-caYGZ
Jun 29, 2026
Merged

feat: Surplus inference callable from Luca on Hermes via Zetta proxy#167
danbuildss merged 1 commit into
mainfrom
claude/luca-aeon-skills-caYGZ

Conversation

@danbuildss

Copy link
Copy Markdown
Owner

Summary

  • Inference proxy now accepts X-Agent-Id / X-Agent-Name headers for correct spend attribution per calling agent
  • Skills catalog documents surplus-inference as a callable skill for Luca on Hermes
  • .env.example documents SURPLUS_API_KEY (Vercel only), LLM_API_KEY, LLM_BASE_URL, LLM_MODEL

Architecture answer

Luca (Hermes/VPS)
  ↓  POST /api/inference/v1/chat/completions
  ↓  x-internal-secret: <ZETTA_INTERNAL_SECRET>
  ↓  x-agent-id: luca
Zetta proxy (Vercel)
  ↓  uses SURPLUS_API_KEY server-side (never leaves Vercel)
  ↓  logs spend to inference_events + agent_economic_events
Surplus intelligence

SURPLUS_API_KEY never goes to Hermes. Hermes only needs ZETTA_INTERNAL_SECRET.

What Luca on Hermes needs to set

No new env vars required if ZETTA_INTERNAL_SECRET is already set. The call is:

curl -X POST https://www.zettaai.co/api/inference/v1/chat/completions \
  -H "x-internal-secret: $ZETTA_INTERNAL_SECRET" \
  -H "x-agent-id: luca" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-4-6", "messages": [...]}'

Spend logging

All inference calls through the proxy are automatically logged — no separate log call needed. Spend flows into inference_events (for inference ledger) and agent_economic_events (for financial books) under the agent ID passed in X-Agent-Id.

Files changed

File Change
src/app/api/inference/v1/chat/completions/route.ts X-Agent-Id / X-Agent-Name header support
src/app/api/luca/skills/route.ts surplus-inference skill entry
.env.example SURPLUS_API_KEY, LLM_API_KEY, LLM_BASE_URL, LLM_MODEL documented

Generated by Claude Code

- inference proxy: accept X-Agent-Id / X-Agent-Name headers so spend is
  attributed to the calling agent, not hardcoded to "luca"
- skills catalog: add surplus-inference skill entry documenting the endpoint,
  auth (ZETTA_INTERNAL_SECRET only), headers, and spend-logging behaviour
- .env.example: document SURPLUS_API_KEY (Vercel only), LLM_API_KEY,
  LLM_BASE_URL, LLM_MODEL for Hermes gateway config

SURPLUS_API_KEY stays on Vercel. Hermes only needs ZETTA_INTERNAL_SECRET.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RjpGP3kYKnQuQAUoK6RZky
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zetta Ready Ready Preview, Comment Jun 29, 2026 10:14pm

@danbuildss danbuildss merged commit c6ddb1a into main Jun 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants