78 lines
2.7 KiB
Markdown
78 lines
2.7 KiB
Markdown
# nexus-claude-api
|
|
|
|
Local Anthropic-compatible API proxy for using AI Nexus Claude models with Claude Code.
|
|
|
|
AI Nexus currently documents AWS Bedrock Converse API as the workaround while Anthropic Messages API support is unavailable. This service exposes local Anthropic-compatible endpoints and translates them to Nexus Converse requests.
|
|
|
|
## Quick Start
|
|
|
|
```powershell
|
|
cd nexus-claude-api
|
|
uv sync --extra dev
|
|
uv run nexus-claude-api config set --api-key "your-nexus-api-key"
|
|
uv run nexus-claude-api start --port 4141 --claude-code
|
|
```
|
|
|
|
If the `nexus-claude-api` command is not on your `PATH`, run the module entrypoint instead:
|
|
|
|
```powershell
|
|
py -m nexus_claude_api start --port 4141 --claude-code
|
|
```
|
|
|
|
Use the printed Claude Code command in the same shell.
|
|
|
|
`ANTHROPIC_AUTH_TOKEN='dummy'` in the printed command is only a local Claude Code compatibility placeholder. Claude Code expects an Anthropic auth token variable to exist, but this local proxy does not validate it by default. It is not your Nexus key.
|
|
|
|
The printed command ends with `claude --model <configured-model>` so the current Claude Code process uses this proxy's configured model instead of any model saved in your global Claude settings. The helper does not edit `C:\Users\A200477427\.claude\settings.json` or any other global Claude Code configuration.
|
|
|
|
## Endpoints
|
|
|
|
- `GET /`
|
|
- `HEAD /`
|
|
- `GET /health`
|
|
- `GET /v1/models`
|
|
- `POST /v1/messages`
|
|
- `POST /v1/messages/count_tokens`
|
|
|
|
## Environment
|
|
|
|
Credential lookup order:
|
|
|
|
1. `--api-key`
|
|
2. user config `~/.config/nexus-claude-api/config.json`
|
|
3. `NEXUS_API_KEY`
|
|
4. `AWS_BEARER_TOKEN_BEDROCK`
|
|
|
|
To write user config:
|
|
|
|
```powershell
|
|
uv run nexus-claude-api config set --api-key "your-nexus-api-key"
|
|
```
|
|
|
|
This creates `~/.config/nexus-claude-api/config.json`:
|
|
|
|
```json
|
|
{
|
|
"api_key": "your-nexus-api-key"
|
|
}
|
|
```
|
|
|
|
Logs are written to dated files under `~/.config/nexus-claude-api/logs/` by default, for example `nexus-claude-api-2026-06-27.log`. The service keeps the latest 7 daily log files and prunes older dated log files automatically.
|
|
|
|
For repository-local development only, pass `--dev` and create `nexus-claude-api.local.json` in the current directory:
|
|
|
|
```powershell
|
|
uv run nexus-claude-api start --dev --port 4141 --claude-code
|
|
```
|
|
|
|
In development mode, config is read from `nexus-claude-api.local.json` and daily logs are written to `logs/nexus-claude-api-YYYY-MM-DD.log` in the current directory. The local config file and `logs/` directory are ignored by git.
|
|
|
|
The service binds to `127.0.0.1` by default and does not persist API keys.
|
|
|
|
## Docs
|
|
|
|
- [PRD](docs/PRD.md)
|
|
- [Requirements Design](docs/REQUIREMENTS_DESIGN.md)
|
|
- [AI Nexus Claude Documentation](docs/AI_NEXUS_CLAUDE.md)
|
|
- [Python Internal Distribution Guide](docs/PACKAGING_DISTRIBUTION.md)
|