`nexus-claude-api` is a local Python API proxy that lets Claude Code use company-approved Claude models through AI Nexus.
AI Nexus currently documents that the Anthropic Messages API is temporarily unsupported and recommends AWS Bedrock Converse API as the workaround. Claude Code expects an Anthropic-compatible Messages API. This project bridges that gap locally.
The proxy defaults to Opus because this deployment is intended for users whose Nexus access is limited to `claude-opus-4.6`. Sonnet and Haiku aliases are accepted for compatibility and resolved to Opus before calling Nexus.
- As a developer, I can store my Nexus key in ignored local config or set `NEXUS_API_KEY`, then run `nexus-claude-api start --claude-code` to get a Claude Code launch command.
- As a Claude Code user, I can run coding workflows through local `http://127.0.0.1:4141`.
- As a Claude Code user, I can receive streaming model output.
- As a Claude Code user, I can use tool calls and tool results.
- As a multimodal user, I can send images through Claude-compatible image content blocks.
- As a developer debugging setup, I can enable verbose logs without exposing tokens.
## Acceptance Criteria
-`uv run nexus-claude-api start --port 4141 --claude-code` starts a local server.
- The server binds to `127.0.0.1` by default.
- Missing Nexus credentials fail fast with a clear error.
-`GET /health` returns healthy status.
-`GET /v1/models` returns the supported Claude models.
-`POST /v1/messages` works for non-streaming text generation.
-`POST /v1/messages` works for streaming text generation.
- Tool use and tool result conversion are covered by tests.
- Image block conversion is covered by tests.
-`POST /v1/messages/count_tokens` returns an Anthropic-compatible token count response.
- Claude Code can be launched with the printed environment command.
## Security Requirements
- Do not persist API keys automatically.
- If the user chooses hardcoded local configuration, keep it in ignored `nexus-claude-api.local.json`.