Skip to content

Green-PT/honey-llm-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Honey LLM Proxy — by GreenPT

Local translation proxy so Codex and Claude Code can use GreenPT models. GreenPT speaks OpenAI Chat Completions; Codex requires the OpenAI Responses API and Claude Code requires the Anthropic Messages API. This proxy translates both, including streaming and tool calling. One small Rust binary — no Python, no LiteLLM.

Codex ──(/v1/responses)──┐
                         ├── greenpt-proxy ──(/v1/chat/completions)── api.greenpt.ai
Claude Code ─(/v1/messages)┘

Install & run

cargo install --path .
export GREENPT_API_KEY="your-greenpt-key"
greenpt-proxy            # listens on http://127.0.0.1:4000

Options: --port N (or PORT env), GREENPT_BASE_URL (default https://api.greenpt.ai/v1).

Codex

~/.codex/config.toml (user-level only — project-local provider config is ignored):

model = "glm-5.2"
model_provider = "greenpt"

[model_providers.greenpt]
name = "GreenPT (via greenpt-proxy)"
base_url = "http://localhost:4000/v1"
env_key = "GREENPT_API_KEY"
wire_api = "responses"

Restart Codex after config changes. Switch models with codex --model minimax-m2.5.

Claude Code

export ANTHROPIC_BASE_URL="http://localhost:4000"
export ANTHROPIC_AUTH_TOKEN="dummy"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.2"
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.2"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="minimax-m2.5"
claude

The ANTHROPIC_DEFAULT_*_MODEL variables map Claude Code's internal model tiers to GreenPT model IDs (glm-5.2, minimax-m2.5, kimi-k2.6, kimi-k2.7-code) — the proxy passes model names through verbatim.

Verify

curl -s localhost:4000/v1/messages -H 'content-type: application/json' \
  -d '{"model":"glm-5.2","max_tokens":50,"messages":[{"role":"user","content":"Say hi"}]}'

curl -s localhost:4000/v1/responses -H 'content-type: application/json' \
  -d '{"model":"glm-5.2","input":"Say hi"}'

Notes

  • Stateless: previous_response_id is rejected (Codex sends full context each turn).
  • Unknown request params are dropped, not errored (the drop_params equivalent).
  • The proxy binds to 127.0.0.1 and does not validate incoming auth headers — the upstream key comes from GREENPT_API_KEY only. Don't expose it beyond localhost.
  • Token/cost display in the agents is approximate; treat GreenPT's dashboard as the source of truth.

About

Local proxy so Codex and Claude Code can use GreenPT models — translates OpenAI Responses and Anthropic Messages to Chat Completions

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors