gitmyhub

Luna

Python ★ 4 updated 16d ago

Stop paying for API credits twice. Luna bridges your existing premium AI subscriptions apps into a seamless, OpenAI compatible local gateway

A local gateway that lets your code talk to AI subscription apps you already pay for through a single OpenAI-style API.

PythonFastAPIGrok CLICodex CLIsetup: moderatecomplexity 3/5

Luna is a small local server that sits between your own code and the AI subscription apps you already pay for, such as Claude, Grok, or Codex. Many programs and coding tools expect to talk to an AI service using the OpenAI API format, but not every app you subscribe to speaks that format natively. Luna translates between the two, so a tool built for OpenAI's API can instead send its requests through Luna to whichever subscription based app you have logged into on your own computer.

Once running, Luna exposes the same two endpoints that OpenAI's API uses, one for listing available models and one for chat responses. Any existing code, library, or command line tool built to talk to OpenAI can be pointed at Luna's local address instead, with no changes needed to that code. Behind the scenes, Luna decides which backend to use based on the model name in the request, then forwards it to the matching engine, whether that is the Grok API, the Codex command line tool, or the Windows Claude Desktop app.

Support for new backends is meant to be simple to add: a single Python file with two functions, one that lists the models a backend offers and one that generates a response, plugged into a small registration list inside the main gateway file. Luna also ships with an optional terminal based chat client for trying things out directly, complete with a moon phase animation while a response is being generated.

Right now Luna works with Codex, the Grok command line tool, and the Windows version of the Claude Desktop app, with streaming responses and support for more backends listed as planned but not yet built. It is written in Python using FastAPI, and requires the underlying tools such as Grok CLI or Codex CLI to already be installed and logged in separately. It is released under the MIT license.

Where it fits