Skip to main content

Claude Code to OpenAI-compatible API proxy

Project description

clodxy

A simple custom proxy for Claude Code -> Any (OpenAI-compatible) Backend.

Supports the bare minimum necessary (messages, streaming, tools, vision).

Security Warning

NEVER expose this proxy to the public internet. This proxy is designed for local-only use and has no authentication or authorization mechanisms. The moment you bind this to a public-facing interface, you're inviting anyone on the internet to use your API keys and backend credentials. That's a skill issue waiting to happen. Keep it local.

Requirements

Installation

No installation needed - run directly via uvx:

uvx clodxy

Configuration

Create a config file at ~/.config/clodxy/config.json (or set CLODXY_CONFIG to customize the path).

See config.example.json for reference:

{
  "backends": {
    "openai": {
      "api_base": "https://api.openai.com/v1",
      "api_key": "sk-your-api-key-here",
      "skip_last_assistant_message": false,
      "models": {
        "gpt-4o": {
          "context_size": 128000,
          "reasoning": false,
          "vision": true
        }
      }
    }
  },
  "default": {
    "backend": "openai",
    "model": "gpt-4o"
  }
}

Configuration Options

Backend fields

  • api_base - The base URL of the OpenAI-compatible API
  • api_key - API key for the backend (optional, defaults to "not-needed")
  • skip_last_assistant_message - Skip the last assistant message in the Anthropic→OpenAI conversion. Only applies when both this is true AND the model has reasoning: true. Enable this for backends like llama.cpp that don't accept assistant prefills as the final message.

Model fields

  • context_size - Maximum context window size in tokens
  • reasoning - Whether this is a reasoning/thinking model (e.g., o1, o3-mini, deepseek-reasoner)
  • vision - Whether this model supports vision/images

Usage

Run clodxy - it will start the proxy and launch Claude Code:

clodxy
clodxy /path/to/project

CLI Options

clodxy --help              # Show help
clodxy --version           # Show version
clodxy --list              # List available backends and models
clodxy --validate-config   # Validate configuration
clodxy --port 9000         # Custom port (default: auto-assign)
clodxy --host 0.0.0.0      # Custom host

Passthrough

Use -- to separate clodxy options from claude options:

clodxy --port 9000 -- --prompt "help me debug"

Logs

Logs are written to ~/.cache/clodxy/:

  • clodxy.log - Application logs
  • uvicorn.log - Server logs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clodxy-0.1.6.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clodxy-0.1.6-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file clodxy-0.1.6.tar.gz.

File metadata

  • Download URL: clodxy-0.1.6.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for clodxy-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d790f48b07eaeba2c19fcec5a9242d984cc7f5f02aa9dd0757e28f44b7b92f58
MD5 b26b7319bf4efb0b6a1925ca48fa36f3
BLAKE2b-256 8d20b62a2c0c119f31cfc33220a6de12114559ad80ca6d92b82dc83181e677f2

See more details on using hashes here.

File details

Details for the file clodxy-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: clodxy-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"26.05","id":"yarara","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for clodxy-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e2965f9aaaa2328d9688e314b8ae73af759f179c2df4f7f4a242aadbcac5eba3
MD5 c2bb9fb10d61bb4c7eba35013ffc2491
BLAKE2b-256 93c1fa9e3355b754f033f5a35dbb9671a70b04e3bb18c72f60674076c3a839c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page