Skip to content
Official · LobstackMigrationv1.0.0MIT

Put Cursor or Aider behind the Gateway

lobstack-local-proxy

Route Cursor, Aider, Continue or any OpenAI-compatible tool through the Lobstack Gateway with a local proxy, and see a cost line per request. Use when asked to route an editor or coding CLI through Lobstack, to find what an AI coding tool is costing, or to use one key across several tools.

#migration#cli#proxy#tools

Install

Copy the file and save it at the path below, then start a new session. Any agent that reads a skills directory will pick it up; the path shown is Claude Code's. Delete the folder to uninstall.

mkdir -p .claude/skills/lobstack-local-proxy
# paste SKILL.md into .claude/skills/lobstack-local-proxy/SKILL.md

No package, no registry client, no telemetry. 105 lines of text, licensed MIT.


What the agent matches on

Frontmatter

An agent decides whether to load a skill from name and description alone — it does not read the body first. That is why the description says when to use this, not only what it is.

---
name: lobstack-local-proxy
description: "Route Cursor, Aider, Continue or any OpenAI-compatible tool through the Lobstack Gateway with a local proxy, and see a cost line per request. Use when asked to route an editor or coding CLI through Lobstack, to find what an AI coding tool is costing, or to use one key across several tools."
license: MIT
metadata:
  title: "Put Cursor or Aider behind the Gateway"
  version: 1.0.0
  author: lobstack
  category: migration
  tags: [migration, cli, proxy, tools]
---

105 lines · MIT

SKILL.md

.claude/skills/lobstack-local-proxy/SKILL.md105 lines
---name: lobstack-local-proxydescription: "Route Cursor, Aider, Continue or any OpenAI-compatible tool through the Lobstack Gateway with a local proxy, and see a cost line per request. Use when asked to route an editor or coding CLI through Lobstack, to find what an AI coding tool is costing, or to use one key across several tools."license: MITmetadata:  title: "Put Cursor or Aider behind the Gateway"  version: 1.0.0  author: lobstack  category: migration  tags: [migration, cli, proxy, tools]--- # Put Cursor or Aider behind the Gateway Most AI coding tools have an OpenAI-compatible setting and no way to tell you whatthey cost. The proxy fixes both with one base URL: the tool keeps working exactlyas it did, every call is routed and metered, and each request prints a line sayingwhat it was. ## Two commands ```bashnpx lobstack init                 # saves a key to ~/.lobstack/config.json, mode 0600npx lobstack proxy                # http://127.0.0.1:8787/v1``` ```Listening on http://127.0.0.1:8787/v1  -> https://www.lobstack.ai Point any OpenAI-compatible tool at it:  OPENAI_BASE_URL=http://127.0.0.1:8787/v1  OPENAI_API_KEY=anything``` OPENAI_API_KEY really is anything. The proxy holds your Lobstack key andattaches it upstream; the tool never sees it. That is the main reason to use aproxy rather than pasting a key into five different editor configs. Per request, to stderr: ```- model claude-haiku-4-5  -  asked claude-opus-5  -  tokens 400/140  -  cost $0.001100  -  saved $0.004400``` ## Pointing the tools at it - Cursor — Settings → Models → add an OpenAI-compatible provider with base URL  http://127.0.0.1:8787/v1 and any key. Add the Lobstack model keys you want to  appear in the picker.- Aider — OPENAI_API_BASE=http://127.0.0.1:8787/v1 OPENAI_API_KEY=x aider --model auto- Continue — in config.json, a model with "provider": "openai",  "apiBase": "http://127.0.0.1:8787/v1", "apiKey": "x".- Anything else — if it has a base URL field, it works. If it only speaks  Anthropic's Messages API, it does not: the Gateway is OpenAI-shaped, and so is  the proxy. Set --model auto where the tool allows it and the router picks per request;name a specific Lobstack key where you want it pinned. ## Read this before leaving it running It binds loopback only, and that is load-bearing. This is a process holding acredential and answering *unauthenticated* requests. Anything that can reach theport can spend your money. Do not bind it to 0.0.0.0, do not port-forward it,do not run it on a shared box, and do not tunnel it to a teammate — give themtheir own key instead. Also worth knowing: - It serves the OpenAI paths under /v1 and 404s anything else locally, so a  mistyped path is a local error rather than a confusing one from upstream.- Streams are piped straight through and the receipt is parsed from a copy of the  tail, so the first token is not delayed by the last one. Interactive tools stay  interactive.- It has no dependencies — fetch, node:http and node:readline are all in  the runtime — so npx lobstack starts rather than resolving a tree first, and  there is no supply chain between your key and the Gateway.- Point --base at the bare apex and the CLI rewrites it to the www host and  says so out loud, because a redirect across hosts makes every HTTP client drop  the Authorization header. A silent fix would teach you nothing about why your  own code fails the same way. ## The rest of the CLI ```bashnpx lobstack chat "explain a b-tree in two sentences"   # answer to stdout, receipt to stderrnpx lobstack models                                     # what the Gateway serves, with pricesnpx lobstack spend --days 7                             # what you spent (needs the usage:read scope)``` chat puts the answer on stdout and the receipt on stderr, so > out.txt givesyou the answer alone and the cost still lands on your terminal. Cost is read from the response, never computed from token counts and a bundledrate card. cost_usd is null and prints as unpriced when the Gateway couldnot price a call — a zero would render as free, and writing off a real charge isthe most expensive way to be wrong about money. ## What this does not do It is a forwarder, not a policy engine: no per-tool budget, no allow-list ofmodels, no request rewriting. If you need a hard cap, put it on the plan's tierceiling and allowance, where the Gateway enforces it — seelobstack-spend-budget.

Also in Migration