← Catalog

@ody./pi-llmgateway

LLM Gateway as a native pi model provider: live catalog, routing preferences, billed cost and DevPass usage.

Extension

Install

Install with PiG

pig install npm:@ody./pi-llmgateway

Install with Pi

pi install npm:@ody./pi-llmgateway
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

pi-llmgateway

A pi extension that adds LLM Gateway as a model provider for DevPass and pay-as-you-go keys.

Install

pi install npm:@ody./pi-llmgateway

To run from a checkout, pass pi -e ./src/index.ts.

Authentication

Create an API key in the LLM Gateway dashboard, then do one of the following:

  • Run /login, choose LLM Gateway, and paste the key. pi stores it in ~/.pi/agent/auth.json.
  • Set LLMGATEWAY_API_KEY in your environment.

Model selection

Open /model and filter by llmgateway or by author, such as anthropic/. On the command line, pass --model llmgateway/anthropic/claude-sonnet-4-6.

  • Live catalog: Includes active text models that stream and call tools. Refreshes at most once an hour or when the API key changes.
  • Billed cost: Sets each completed message's total cost to the USD amount LLM Gateway charged instead of the list-price estimate.

Commands

Run /llmgateway for interactive configuration, or use the typed commands with Tab completion. All settings live in ~/.pi/agent/llmgateway.json and apply immediately.

CommandPurpose
/llmgatewayOpen the settings menu for routing, per-model overrides, pins, footer statuses, and plan refresh
/llmgateway-usageShow pay-as-you-go spend or DevPass meters and reset timers
/llmgateway-routingShow or set routing strategy, service tier, and cross-provider fallback
/llmgateway-pinShow or pin a model to a serving provider or region

Routing and provider pins

Configure defaults or per-model overrides in /llmgateway, or run /llmgateway-routing and /llmgateway-pin:

CommandEffect
/llmgateway-routingShow effective routing for default and configured models
/llmgateway-routing <default|model> sort <auto|price|throughput|latency>Set the routing strategy
/llmgateway-routing <default|model> tier <auto|default|flex|priority>Set the service tier
/llmgateway-routing <default|model> fallback <on|off>Turn cross-provider failover on or off
/llmgateway-routing <default|model> resetRemove routing overrides and keep any pin
/llmgateway-pin [model]Show all pins, or one model's pin and pinnable provider[:region] options
/llmgateway-pin <model> <provider[:region]|off>Set or remove a model's pin

Plan and gateway rules apply in both the menu and typed commands:

  • DevPass: Accepts sort values auto and price, tier values auto, default, and flex, and no provider pins.
  • Pay-as-you-go: Accepts every strategy, every tier, and any provider or provider:region listed for the model.
  • Pinned requests: Omit sort because the gateway rejects combining a strategy with a pin. Set fallback off to stop low-uptime failover. Pins can also reach deployments with smaller context windows.
  • Ignored values: Requests omit stored settings that your plan or catalog rejects, and show commands mark them (ignored ...).

The extension sets no footer status by default. Toggle keys under Footer statuses in /llmgateway, or list them in "footer" in ~/.pi/agent/llmgateway.json.

KeyExampleShows
llmgateway-provideraws-bedrock:euServing provider and region of the last response
llmgateway-dayday 3.10/14.22DevPass daily meter
llmgateway-premiumprem 5.00/18.96DevPass weekly premium meter
llmgateway-monthmo 25.00/158.00DevPass monthly meter
llmgateway-spend$31.42/$50.00Pay-as-you-go spend and key limit
llmgateway-premium-model★Selected model costs at least $5/M input or $15/M output

Only keys that match your active plan render, and switching away from llmgateway clears every status.

License

MIT