MIT License

项目介绍

sozercan/vekil 是一个托管在 GitHub 上的开源项目,主要使用 Go 编写,采用 MIT License 许可证,目前获得 22 个 Star、11 次 Fork。

仓库全名
sozercan/vekil
开源许可证
MIT License
Star 数
22
Fork 数
11
未关闭 Issue
37

README 摘要

vekil One local endpoint for Anthropic, Gemini, and OpenAI clients — backed by the provider of your choice. Vekil is a Go reverse proxy that exposes Anthropic, Gemini, and OpenAI-compatible APIs behind one local endpoint. Run it in zero-config mode against GitHub Copilot, or route selected models to providers like Azure OpenAI, OpenAI Codex, and generic OpenAI-compatible or Anthropic-compatible upstreams. The…

完整内容见 GitHub 原始 README 或本页 。

常见问题

vekil 用什么语言开发?

主要使用 Go 编写,采用 MIT License 许可证,目前有 22 个 Star。

vekil 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 vekil 的源码?

可以直接克隆仓库:git clone https://github.com/sozercan/vekil.git,默认分支为 main;安装与运行步骤见仓库 README。

vekil 最近还在维护吗?

仓库最近一次更新为 1 天前,当前有 37 个未关闭 Issue;Star 数为 22,可作为社区活跃度的参考。

关于

🧑‍💼 Reverse proxy exposing Anthropic, Gemini, and OpenAI-compatible APIs over GitHub Copilot, OpenAI Codex, Microsoft Foundry and compatible model servers

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

C
Dockerfile
Go
Makefile
Objective-C
Shell

Release

README

Vekil

vekil

One local endpoint for Anthropic, Gemini, and OpenAI clients — backed by the provider of your choice.


Vekil is a Go reverse proxy that exposes Anthropic, Gemini, and OpenAI-compatible APIs behind one local endpoint. Run it in zero-config mode against GitHub Copilot, or route selected models to providers like Azure OpenAI, OpenAI Codex, and generic OpenAI-compatible or Anthropic-compatible upstreams. The client-facing API surface stays the same while model ownership is configured behind the proxy.

Why Vekil?

Use your GitHub Copilot subscription with Claude Code, point the Codex CLI at Azure OpenAI, or send Gemini-CLI traffic through any OpenAI-compatible upstream — all without touching client config. Swap providers behind the proxy; your tools never notice.

Looking for free models? Vekil can route to OpenCode Zen’s free tier with no signup — see how. It is a shared, rate-limited trial tier (models rotate; not for sensitive prompts).

Features

  • Anthropic Messages API — drop-in compatible with Claude clients
  • Gemini API — Generate Content, Stream Generate Content, and Count Tokens
  • OpenAI Chat Completions and Responses APIs, including optional Codex websocket bridging
  • Multi-provider routing across GitHub Copilot, Azure OpenAI, OpenAI Codex, and generic compatible providers
  • Optional tool optimizers for opt-in shell command rewrites and tool-output reduction across supported API surfaces; see Tool Optimizers
  • Codex compatibility shims for compaction and memory summarization
  • Streaming, tool use, parallel tool calls, compressed request bodies, and auth/token caching

Quick Start

Grab a binary from GitHub Releases, or run the container from GHCR:

docker run -p 1337:1337 \
  -v ~/.config/vekil:/home/nonroot/.config/vekil \
  ghcr.io/sozercan/vekil:latest

On Apple Silicon Macs, install the native tray app via Homebrew:

brew install --cask sozercan/repo/vekil

The app is not signed. Clear quarantine with xattr -cr /Applications/Vekil.app. Manual vekil-macos-arm64.zip downloads are also on Releases. See Tray App (macOS/Linux).

For explicit provider routing, start the proxy with --providers-config /path/to/providers.{json,yaml}.

First-run auth depends on your providers:

  • Copilot — vekil login uses Vekil-managed GitHub device-code sign-in; first proxy startup starts the same flow when needed. To use your current GitHub CLI account instead, opt in with vekil login --github-cli (or --gh). vekil logout clears cached auth and disables future silent gh reuse until you opt in again. COPILOT_GITHUB_TOKEN remains the explicit non-interactive override.
  • Azure OpenAI and generic hosted providers — use api_key or api_key_env in your provider config.
  • OpenAI Codex — requires codex login so ~/.codex/auth.json exists. In Docker, mount your Codex home into CODEX_HOME (default /home/nonroot/.codex).
  • Local generic providers — use auth_type: none.

For full setup details, see Getting Started, Configuration, and Provider Routing.

Docs

Documentation lives under docs/; start with these:

Getting Started Install, run, first auth
Configuration Config map and generic flags
Provider Routing Provider auth and model ownership
Provider API Keys Where to get provider keys
Tool Optimizers Shell rewrite/output reduction
Responses WebSocket Websocket bridge tuning
Client Examples Copy-paste snippets per client
API Reference Endpoint behavior and compatibility
Architecture Package layout and design notes
Tray App macOS/Linux menubar usage
Development Build, test, benchmarks, CI

Client Examples

Use any public model ID exposed by /v1/models — your client config is the same regardless of which provider owns the model upstream.

Claude Code

env ANTHROPIC_BASE_URL=http://localhost:1337 \
  ANTHROPIC_API_KEY=dummy \
  claude --model claude-sonnet-4 --print --output-format text "Reply with exactly PROXY_OK"

OpenAI Codex CLI

env OPENAI_API_KEY=dummy \
  OPENAI_BASE_URL=http://localhost:1337/v1 \
  codex exec --skip-git-repo-check -m gpt-5.5 "Reply with exactly PROXY_OK"

GitHub Copilot CLI

env COPILOT_PROVIDER_BASE_URL=http://localhost:1337/v1 \
  COPILOT_PROVIDER_TYPE=openai \
  COPILOT_PROVIDER_WIRE_API=responses \
  COPILOT_MODEL=gpt-5.5 \
  COPILOT_OFFLINE=true \
  copilot -p "Reply with exactly PROXY_OK" -s

Gemini CLI

env GEMINI_API_KEY=dummy \
  GOOGLE_GEMINI_BASE_URL=http://localhost:1337 \
  GOOGLE_GENAI_API_VERSION=v1beta \
  GEMINI_CLI_NO_RELAUNCH=true \
  gemini -m gemini-2.5-pro -p "Reply with exactly PROXY_OK" -o json

评论

暂无评论