From 8151f2ad4366e3c3770be015ba949905c0a99f0c Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 12 Aug 2026 11:16:35 -0400 Subject: [PATCH] [Docs] Warn that --api-key does not gate all endpoints (#51999) Signed-off-by: Russell Bryant Co-authored-by: Claude Opus 4.8 (1M context) --- .../online_serving/openai_compatible_server.md | 11 +++++++++++ vllm/entrypoints/openai/cli_args.py | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/serving/online_serving/openai_compatible_server.md b/docs/serving/online_serving/openai_compatible_server.md index dfb78245b4..22e2e9a608 100644 --- a/docs/serving/online_serving/openai_compatible_server.md +++ b/docs/serving/online_serving/openai_compatible_server.md @@ -2,6 +2,17 @@ vLLM provides an HTTP server that implements OpenAI's [Completions API](https://platform.openai.com/docs/api-reference/completions), [Chat API](https://platform.openai.com/docs/api-reference/chat), and more! This functionality lets you serve models and interact with them using an HTTP client. +!!! warning "API key authentication does not protect every endpoint" + The `--api-key` option (or `VLLM_API_KEY` environment variable) only + authenticates requests to endpoints under the `/v1`, `/v2`, and + `/inference` path prefixes. Other endpoints on the same HTTP server are + **not** authenticated — most notably `/invocations`, which exposes the same + inference capabilities as the `/v1` endpoints. Do not rely on `--api-key` + alone to secure vLLM. See + [API Key Authentication Limitations](../../usage/security.md#api-key-authentication-limitations) + for the full list of protected and unprotected endpoints and recommended + hardening, such as deploying behind a reverse proxy. + ## Supported APIs We currently support the following OpenAI APIs: diff --git a/vllm/entrypoints/openai/cli_args.py b/vllm/entrypoints/openai/cli_args.py index fbb5a6df5f..64dab7416d 100644 --- a/vllm/entrypoints/openai/cli_args.py +++ b/vllm/entrypoints/openai/cli_args.py @@ -282,7 +282,15 @@ class FrontendArgs(BaseFrontendArgs): """Allowed headers.""" api_key: list[str] | None = None """If provided, the server will require one of these keys to be presented in - the header.""" + the header. + + Warning: this only authenticates endpoints under the `/v1`, `/v2`, and + `/inference` path prefixes. Other endpoints on the same server, including + `/invocations` (which exposes the same inference capabilities as `/v1`), + remain unauthenticated. Do not rely on `--api-key` alone to secure vLLM; + see + https://docs.vllm.ai/en/latest/usage/security.html#api-key-authentication-limitations + for what it does and does not protect.""" ssl_keyfile: str | None = None """The file path to the SSL key file.""" ssl_certfile: str | None = None