feat: Surplus inference callable from Luca on Hermes via Zetta proxy#167
Merged
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
X-Agent-Id/X-Agent-Nameheaders for correct spend attribution per calling agentsurplus-inferenceas a callable skill for Luca on Hermes.env.exampledocumentsSURPLUS_API_KEY(Vercel only),LLM_API_KEY,LLM_BASE_URL,LLM_MODELArchitecture answer
SURPLUS_API_KEYnever goes to Hermes. Hermes only needsZETTA_INTERNAL_SECRET.What Luca on Hermes needs to set
No new env vars required if
ZETTA_INTERNAL_SECRETis already set. The call is:Spend logging
All inference calls through the proxy are automatically logged — no separate log call needed. Spend flows into
inference_events(for inference ledger) andagent_economic_events(for financial books) under the agent ID passed inX-Agent-Id.Files changed
src/app/api/inference/v1/chat/completions/route.tsX-Agent-Id/X-Agent-Nameheader supportsrc/app/api/luca/skills/route.tssurplus-inferenceskill entry.env.exampleSURPLUS_API_KEY,LLM_API_KEY,LLM_BASE_URL,LLM_MODELdocumentedGenerated by Claude Code