--- title: Tool Bridge emoji: 🔧 colorFrom: blue colorTo: purple sdk: docker app_port: 8080 pinned: false short_description: OpenAI/Anthropic tool-calling bridge for non-tool upstreams --- # newapi-tool-bridge OpenAI / Anthropic compatible tool-calling bridge proxy. Wraps an upstream API that lacks native tool calling (e.g. a ChatGPT reverse-proxy) into an OpenAI-compatible endpoint that supports `tools` / `tool_choice` / `parallel_tool_calls`, plus full Anthropic Messages API (`/v1/messages`) translation. ## Endpoints - `GET /v1/models` — list models - `POST /v1/chat/completions` — OpenAI Chat Completions - `POST /v1/messages` — Anthropic Messages API - `GET /health` — health check - other paths — proxied to upstream ## Auth (this deployment) Public Space, **bring-your-own-key**: `UPSTREAM_AUTH_HEADER` is unset, so the upstream key you send in `Authorization: Bearer ` (or `x-api-key`) is passed through to the upstream. No key is baked into this Space. ## Config (Space variables) | var | meaning | |-----|---------| | `UPSTREAM_BASE_URL` | upstream root (no `/v1`) | | `MODEL_MAP_JSON` | external model name → upstream model name | | `PUBLIC_MODEL_IDS_JSON` | model ids returned by `/v1/models` | | `NATIVE_TOOL_MODELS_JSON` | models with native tool calling (passthrough) | | `ALLOW_UNMAPPED_MODEL_PASSTHROUGH` | pass unmapped model names through | Virtual tool calling: for upstreams without native `tools`, the tool defs are injected into the system prompt, the model's JSON output is parsed back into standard `tool_calls`.