@hushhenry/ai-gateway
v1.0.11
Published
A TypeScript AI proxy supporting CLI and Library modes, built with Vercel AI SDK and pi-mono TUI/OAuth logic.
Downloads
527
Maintainers
Readme
AI Gateway
A TypeScript AI proxy supporting CLI and Library modes, built with Vercel AI SDK.
Designed to be compatible with pi-mono authentication storage.
Installation
npm install -g ai-gatewayUsage
CLI
Start the server:
ai-gateway serve --port 8080The server provides OpenAI-compatible endpoints:
POST /v1/chat/completionsGET /v1/models
Library
import { AiGateway } from 'ai-gateway';
const gateway = new AiGateway();
// Use gateway.fetch with your Hono/Node serverConfiguration
Credentials are looked up in:
~/.config/ai-gateway/auth.json~/.config/pi/auth.json
Format:
{
"openai": {
"apiKey": "sk-..."
},
"anthropic": {
"apiKey": "sk-ant-..."
}
}