Skip to content

tangle-network/agent-gateway

Repository files navigation

@tangle-network/agent-gateway

Hono middleware that turns any Tangle agent app into a paid API. Wrap your chat endpoint to accept API keys, x402 SpendAuth, or MPP credentials — with scope enforcement, per-key rate limits, nonce replay protection, prompt-injection detection, and publish routes for the marketplace.

Install

npm install @tangle-network/agent-gateway

Usage

import { createAgentGateway } from '@tangle-network/agent-gateway'
import { Hono } from 'hono'

const app = new Hono()
app.use('/chat/*', createAgentGateway({
  apiKeyStore: myKeyStore,
  x402: { verifierUrl: 'https://router.tangle.tools/x402/verify' },
  rateLimits: { perKey: { rpm: 60 } },
}))

Tier

Marketplace tier of the agent-builder three-tier architecture (Forge / Workbench / Marketplace). Used by every *.tangle.tools agent app that publishes a paid API.

Related

License

MIT

About

x402 + MPP + API-key payment gateway middleware for Tangle agent APIs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors