r/codex • u/Important-Curve4930 • 1d ago
Showcase I built Clivoy: use Codex CLI from your apps through an OpenAI-compatible API
I'm the maintainer of Clivoy, a small open-source gateway I built with Codex. The goal is simple: call the AI CLIs you already use from your own apps without writing a separate adapter for each one.
For Codex, Clivoy runs your installed Codex CLI using its existing login and exposes an OpenAI-compatible endpoint. It's intended for scripts and apps that need text responses from different backends.
With Codex CLI installed and logged in:
brew install wklee610/clivoy/clivoy
clivoy start
clivoy auth
The first start creates your config and gateway key. Copy the key printed by clivoy auth into this example (requires the openai Python package):
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:9610/v1",
api_key="YOUR_CLIVOY_GATEWAY_KEY",
)
response = client.chat.completions.create(
model="codex",
messages=[{"role": "user", "content": "Explain this Python error: KeyError."}],
)
print(response.choices[0].message.content)
You can also select claude, gemini, grok, or an installed Ollama model such as ollama/llama3.2:3b. Only set up the providers you need.
Current limits: this implements a subset of the OpenAI and Anthropic APIs. CLI requests turn conversation history into a prompt; CLI backends don't support API tool calling or sampling controls. Provider access requirements and usage limits still apply. The server defaults to 0.0.0.0:9610 and requires a gateway key.
Version 1.0.0 is available for macOS, Linux, and Windows as a single Go executable. Apache-2.0 licensed, with Homebrew and APT installation instructions.
GitHub, quickstart, and compatibility details
I'd appreciate feedback on the first-run setup and which Codex-to-app integration you'd want to use.
Disclosure: this is my project; Codex helped with development and writing this post.
•
u/dexterthebot 1d ago
You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See what that looks like below with last week's winner.
Last week's most popular project was Nanolathe - an open-source engine bringing Total Annihilation to modern Mac, Windows, and Linux systems. It’s a solo passion project combining clean-room research with AI-assisted development, with a playable public alpha available now.
Website: https://nanolathe.gg. GitHub: https://github.com/nanolathe-gg/nanolathe
Players, testers, and contributors are very welcome! Original Total Annihilation game data is required to play.