@openhoo/hoopilot 0.7.5 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/%40openhoo%2Fhoopilot?label=npm)](https://www.npmjs.com/package/@openhoo/hoopilot)
4
4
  [![CI](https://github.com/openhoo/hoopilot/actions/workflows/ci.yml/badge.svg)](https://github.com/openhoo/hoopilot/actions/workflows/ci.yml)
5
5
 
6
- OpenAI-compatible local proxy for GitHub Copilot accounts. It runs on Bun and exposes `/v1/chat/completions`, `/v1/responses`, `/v1/completions`, and `/v1/models` for clients that can point at a custom OpenAI base URL.
6
+ OpenAI- and Anthropic-compatible local proxy for GitHub Copilot accounts. It runs on Bun and exposes OpenAI-style `/v1/chat/completions`, `/v1/responses`, `/v1/completions`, and `/v1/models` routes plus Claude Code-compatible `/v1/messages` and `/v1/messages/count_tokens` routes.
7
7
 
8
8
  This project uses GitHub Copilot's service endpoints and is not an official GitHub product. The upstream API can change without notice. Use it only with accounts and usage patterns you are allowed to use.
9
9
 
@@ -97,6 +97,18 @@ $env:OPENAI_BASE_URL = "http://127.0.0.1:4141/v1"
97
97
  $env:OPENAI_API_KEY = "local-key"
98
98
  ```
99
99
 
100
+ Point Claude Code at the same server through its Anthropic base URL:
101
+
102
+ ```powershell
103
+ $env:ANTHROPIC_BASE_URL = "http://127.0.0.1:4141"
104
+ $env:ANTHROPIC_AUTH_TOKEN = "local-key"
105
+ claude
106
+ ```
107
+
108
+ Hoopilot accepts the local key as either `Authorization: Bearer <key>` or
109
+ `x-api-key: <key>`, so `ANTHROPIC_API_KEY` also works for clients that send
110
+ Anthropic's `x-api-key` header.
111
+
100
112
  Use with Codex CLI after Hoopilot is running, via the bundled `codexx` command. It runs Codex against the local server with the right model provider — selecting `gpt-5.5` over Copilot's Responses API, which a plain `openai_base_url` override does not configure (see the note below):
101
113
 
102
114
  ```powershell
@@ -251,11 +263,13 @@ Options:
251
263
  - `GET /metrics`
252
264
  - `GET /v1/models`
253
265
  - `GET /v1/usage`
266
+ - `POST /v1/messages`
267
+ - `POST /v1/messages/count_tokens`
254
268
  - `POST /v1/chat/completions`
255
269
  - `POST /v1/responses`
256
270
  - `POST /v1/completions`
257
271
 
258
- `/v1/chat/completions` and `/v1/responses` are proxied to the matching Copilot endpoints as directly as possible. `/v1/completions` translates legacy completion requests and responses to the closest chat completions equivalent. `GET /metrics` and `GET /v1/usage` report proxy metrics and Copilot quota (see [Metrics and usage](#metrics-and-usage)).
272
+ `/v1/chat/completions` and `/v1/responses` are proxied to the matching Copilot endpoints as directly as possible. `/v1/messages` translates Anthropic Messages requests and responses to Copilot's Responses endpoint for Claude Code and other Anthropic-compatible clients. `/v1/messages/count_tokens` returns a local token estimate for Claude Code preflights because Copilot does not expose Anthropic's count-tokens route. `/v1/completions` translates legacy completion requests and responses to the closest chat completions equivalent. `GET /metrics` and `GET /v1/usage` report proxy metrics and Copilot quota (see [Metrics and usage](#metrics-and-usage)).
259
273
 
260
274
  ## Development
261
275