oscar-chw

GPT Cc — AI skill for Claude Code

AI community

Local Python gateway that lets Claude Code run on OpenAI Chat Completions-compatible models or a locally authenticated Codex CLI by translating Anthropic Messages requests, tools and streaming.

How to install GPT Cc

This entry records only its repository, not the path inside it, so there is no exact command to give. Open oscar-chw/gpt-cc and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What GPT Cc does

Local Python gateway that lets Claude Code run on OpenAI Chat Completions-compatible models or a locally authenticated Codex CLI by translating Anthropic Messages requests, tools and streaming. Unsupported features fail closed; 29 offline unit tests cover request mapping, model selection and tool translation.

Alternatives in AI

  • CliRelay — Self-hosted AI gateway for coding CLIs — one OpenAI/Claude/Gemini/Codex-compatible endpoint, with a multi-tena 1k ★
  • My Free Code — Open-source multi-provider AI gateway for Claude Code and other coding agents, with model routing, streaming 633 ★
  • Wechat Acp — Bridge WeChat chat messages to any ACP-compatible AI agent (Claude, Codex, Copilot, Qwen, Gemini, OpenCode and 488 ★

README

gpt-cc: Claude Code on OpenAI-Compatible Models via a Local Gateway

[![quality](https://github.com/oscar-chw/gpt-cc/actions/workflows/quality.yml/badge.svg)](https://github.com/oscar-chw/gpt-cc/actions/workflows/quality.yml)

A local Python gateway that presents an Anthropic Messages-compatible endpoint to Claude Code and translates supported requests to either an OpenAI Chat Completions-compatible API or a local Codex CLI invocation. Claude Code keeps its prompts, permissions, hooks and tool loop; only the model endpoint changes. Request mapping, model and backend selection, tool/message translation, context edits and fail-closed cases pass 29 offline unit tests; no latency, accuracy or cost has been measured.

One request through the gateway: checked against `model-map.json`, edited, translated, sent to one backend, and translated back.

flowchart TB
    CC["Claude Code
owns prompts, tools,
permissions, the loop"] MM[("model-map.json")] subgraph GW["gateway: anthropic_openai_gateway.py"] H["do_POST
/v1/messages"] V{"validate_request"} CM["apply_context_
management
two documented edits"] P["build_openai_payload
model via model-map"] B{"active_backend()"} end subgraph BK["backends"] API["OpenAI-compatible
/chat/completions"] CX["local Codex CLI
codex exec,
read-only"] end subgraph BACK["back in the gateway"] RA["_complete_message or
_stream_message"] RC["codex_response
_to_anthropic"] end ERR["400
unsupported_feature"] OUT["response to Claude Code
Messages JSON or SSE"] CC == "Anthropic Messages
request" ==> H H == "body" ==> V MM -- "allowed, ignored,
unsupported" --> V V -- "unknown field:
fail closed" --> ERR V == "known fields" ==> CM CM == "edited messages" ==> P P == "Chat Completions
payload" ==> B B == "openai: API key
or base URL set"