What vLLM --api-key protects and why it is not enough alone
The --api-key flag protects only part of what a vLLM server exposes, so it is not a complete control on its own. A team that has just started vllm serve and wants to expose it should know that the flag covers endpoints under /v1, /v2, /inference and /cohere. It does not cover /invocations, /pause, /resume, /abort_requests, /metrics or /health. The vLLM security documentation warns against relying on the key alone and recommends a reverse proxy that allowlists only the endpoints meant for users. Before any network exposure, the team should list every route the server answers, check which of them the key guards, and confirm the result against the current vLLM security documentation for the release they run.
A single key is a reasonable first layer when the server sits on a private network, only a small set of trusted internal services call the /v1 routes, and the operators are the only people who can reach the host. It also helps as a guard against accidental exposure during testing. Teams need more once the server is reachable from outside its trust boundary, several users or applications need separate credentials, or they need per-user quotas and audit trails. The key also does nothing to stop a caller with access to the control endpoints from pausing generation, aborting requests or reading operational metrics, so those paths must be blocked at the network or proxy layer, not left to the flag.
The practical decision is which layer enforces what. Keep the built-in key as defense in depth, put a reverse proxy in front that exposes only the user-facing inference routes, and keep metrics, health and control routes on an internal interface reachable by monitoring and operators. Ask your security team to confirm which identity system will issue credentials, and plan the rate limits and per-user accounting that a single shared key cannot provide. Test the result by calling each excluded path from outside the allowed network and confirming it fails.
Which vLLM paths the API key covers and which stay open
This table compares the path prefixes that vLLM's --api-key option protects with the endpoints it leaves open, and states the risk each open endpoint carries. Read each row as a question to answer for your installed version: is this path reachable from users, and if so, who should be able to reach it. The main takeaway is that the key alone does not make the server safe to expose.
| Path | Covered by --api-key | Risk if reachable by users | How to keep it internal |
|---|---|---|---|
| /v1 (OpenAI-compatible API) | Yes | Inference and model access; the key is the only check at the server | Expose through a gateway or proxy that holds the key and enforces per-user limits |
| /v2 | Yes | Versioned API paths covered by the key; confirm which routes exist in your version | Allowlist only the specific routes users need at the proxy |
| /inference | Yes | Covered by the key; confirm the routes it serves and whether users need them | Allowlist at the proxy only if a documented user workflow needs it |
| /cohere | Yes | Covered by the key; confirm whether your deployment serves this compatibility route | Block at the proxy if no client uses it |
| /invocations | No | Not covered by the key, so a caller with network access may send inference requests without it | Deny at the proxy and restrict network access to the server port |
| /pause and /resume | No | Control operations that can interrupt or halt serving for all users | Keep off user-facing routes; reach them only from an internal operator network |
| /abort_requests | No | Lets a caller without the key cancel in-flight requests belonging to others | Deny at the proxy; restrict to internal operators |
| /metrics | No | Exposes request counts, throughput, latency and KV cache use that reveal workload and capacity | Scrape from the monitoring network only; deny at the proxy |
| /health | No | Reveals server liveness; low sensitivity but still an unauthenticated surface | Allow only for load balancer and orchestrator probes on the internal network |
How the single shared key behaves in practice
The --api-key option gives every caller the same static secret, so the server can tell whether a request carries the key but not who sent it. There is no per-user identity, no per-user audit trail, and no per-user budget or rate limit. A request from a data scientist, a batch job and a customer-facing app all look the same to the server. Rotating the key means updating every client at the same moment, so a planned rotation becomes a coordinated change across all consumers, and an unplanned one can take every integration offline at once.
If the key leaks, the exposure is total for the endpoints it protects. Anyone holding it can call the full set of /v1 routes until the key is changed, and the operator has no way to separate legitimate traffic from misuse by the holder. Server logs and the /metrics output do not identify a caller by key holder, so an operator cannot easily tell which team, application or person generated a given burst of tokens or a suspicious pattern of requests. Incident response therefore depends on what the upstream layer records. Confirm in the installed version how the key is passed (an Authorization: Bearer header is the usual OpenAI-style form), whether the server ever writes the key into logs, and how it is loaded from the command line, environment or file, since that decides who can read it on the host.
Plan for these limits before users arrive. Treat the static key as a service credential for one trusted client, store it in a secret manager with a named owner and a rotation procedure, and keep it out of shell history and container images. For multi-user access, the gateway pattern described later on this page moves identity, quotas and attribution to a layer that issues separate credentials per user or team. Ask your engineers to test a key rotation in a staging environment and to record which clients break, so the first rotation under pressure is not also the first test.
How to configure the key and close the open endpoints
This sequence starts vLLM with an API key, confirms which paths reject unauthenticated calls, and puts a reverse proxy in front so that only the user-facing endpoints are reachable from user networks. Monitoring and probe endpoints stay limited to the systems that need them.
Inventory the endpoints your users need
Before changing anything, list every path your applications call, such as /v1/chat/completions, /v1/completions, /v1/responses and /v1/embeddings, and every path your operators use. Record which team owns each path and which network each caller sits on. The output is a written allowlist draft that the platform and application teams both sign off. Confirm the exact path set against the vLLM security documentation for the release you run, because the set of endpoints changes between releases.
Start the server with the API key set
The platform engineer starts vLLM with the --api-key option and stores the key in the secret store used for your other services, not in a shell history or a plain configuration file. Restart the service and confirm the process starts without errors in the logs. Done means the server is running with the key enabled, and the key value is recorded only in the secret store.
Verify covered paths reject unauthenticated calls
From a test host, send a request to a covered endpoint under /v1 without the bearer token and expect a rejection. Repeat with a wrong key and then with the correct key, and expect the correct key to succeed. Record the status codes for each case. Done means the three results match, which shows the key guards the paths it is documented to cover.
Confirm uncovered paths are not reachable from user networks
Send requests to /invocations, /pause, /resume, /abort_requests, /metrics and /health from a user network host, without a key. The key does not protect these paths, so the test shows whether they answer at all. Any response from a user network means the path is exposed and must be blocked at the network layer before the proxy step is considered complete. Done means user-network hosts get no response from these paths.
Place a reverse proxy with an endpoint allowlist
The network or platform team deploys a reverse proxy in front of vLLM that forwards only the user endpoints agreed in the first step and returns a denial for everything else. Limit the upstream connection so that only the proxy can reach the vLLM port. Done means a request to any path outside the allowlist fails at the proxy and never reaches the vLLM process, and the proxy configuration is kept in version control for review.
Restrict metrics and health checks to monitoring
Keep /metrics and /health reachable only from the Prometheus scraper, the load balancer or Kubernetes probe addresses, and the operations jump host. The monitoring team confirms that scrapes and probes still succeed, and the security team confirms that a request from a user subnet is refused. Done means both checks pass, and the source address list is documented alongside the allowlist.
Retest after each vLLM upgrade and proxy change
Repeat the covered-path, uncovered-path and allowlist checks whenever vLLM is upgraded or the proxy configuration changes. Because vLLM publishes new minor releases about every two weeks, a retest should be part of the upgrade runbook, not a one-time task. Ask the team that owns the proxy to confirm which paths were added or renamed in the new release. Done means the test results are attached to the change record.
Where the key check sits in the request path
The path starts with a user or application sending a request to the reverse proxy or gateway, which allowlists only the endpoints meant for users. Allowed requests pass to the vLLM server, where --api-key is checked on the covered prefixes such as /v1. Operators and monitoring systems reach /metrics, /health and control endpoints on a separate internal path that never crosses the public boundary. Check that the proxy blocks every path not on the allowlist, because the key check does not cover /metrics, /health or the control endpoints.
Trust boundaries separating user traffic, the gateway, and internal-only vLLM endpoints.
Choosing between the built-in key, a proxy and a gateway
The --api-key option is the simplest control. It places one shared secret in front of the endpoints under /v1, /v2, /inference and /cohere, so a caller without the key cannot use the OpenAI-compatible routes. It suits a single trusted internal client, such as one backend service that calls vLLM on a private network.
- What it fixes: unauthenticated calls to the covered inference paths from the network segment where vLLM listens.
- What it leaves open:
/metrics,/health,/pause,/resume,/abort_requestsand/invocationsare not protected by the key, so they need network controls. - Shared secret risk: every caller holds the same key, so you cannot tell users apart, revoke one person's access or set per-user limits.
- Rotation: changing the key means updating every client at once, so plan a coordinated rotation window.
- What it needs to run: a secret delivery method for the key, a private network path to the server, and confirmation of the key behavior in the vLLM release you run.
Before relying on this pattern, confirm with your security team that no other client, dashboard or scraper needs direct access to the unprotected endpoints.
A reverse proxy in front of vLLM turns the server's own documentation advice into enforced policy. The proxy accepts only the paths users need, returns refusals for everything else, and terminates TLS so traffic from clients is encrypted before it reaches the server. The vLLM security documentation recommends this approach because the server's key does not cover every endpoint.
- What it fixes: exposure of control and operator endpoints such as pause, resume, abort and metrics to callers who should not reach them.
- What it leaves open: the proxy usually sees one identity, or none, so per-user accounting and budgets still require a separate layer.
- Authentication placement: the proxy can check tokens from your identity provider, or hold the vLLM key, but it does not issue keys to people.
- Rate limits: basic request limits are possible at the proxy, but token budgets per team are not.
- What it needs to run: a proxy you operate, a certificate and key management process, a maintained allowlist tied to the endpoints your release exposes, and monitoring of proxy logs.
Check the allowlist against the endpoints in the vLLM release you deploy, because the path list changes between releases.
An AI gateway sits between applications and model servers and issues its own keys. LiteLLM is one example: its proxy accepts the OpenAI request format, can call vLLM as one of several providers, and supports virtual keys with budgets, TPM and RPM limits, and model restrictions per key, user or team. This pattern fits many users, several teams or shared budgets.
- What it fixes: a single shared secret, because each user or team holds a revocable key with its own limits and usage record.
- What it leaves open: the gateway is another production service with its own patching, database and availability needs, and vLLM still needs network isolation behind it.
- Database and cache: LiteLLM virtual keys need PostgreSQL, and more than one proxy instance requires Redis 7.0 or newer for shared rate limits.
- Identity: SSO in the free tier is limited to 5 users, so confirm the license needed for your user count and whether SCIM or JWT authentication is required.
- What it needs to run: a gateway deployment, database operations, a secret manager for the master key, and a decision on which team owns key issuance.
Ask the gateway vendor to confirm current limits and license terms against the version you plan to run, since releases change quickly.
Security and operational risks to plan for
The --api-key option is a single shared secret checked on some path prefixes and skipped on others. The risks below follow from that design: the key itself, the endpoints it does not cover, the data those endpoints expose, and the lack of attribution. Each one has a check you can run before users depend on the server.
Shared key leakage and rotation
Every client that calls the server holds the same single shared key, so one leaked copy grants full access to every covered endpoint. Rotating it means restarting the server and updating every application at once, which makes rotation disruptive and often postponed. Confirm who holds the key, where copies are stored, and how a rotation would be coordinated across teams before go-live.
vLLM security docsUncovered control endpoints reachable from users
The key does not protect /invocations, /pause, /resume or /abort_requests. If the port is reachable by users, any caller can pause serving or abort other users' requests without a key. Test each of these paths from a client that has no key, and confirm that a reverse proxy blocks everything except the inference paths your users need.
Metrics exposing usage data
The /metrics endpoint is not covered by the key and publishes request counts, token throughput, latency histograms and KV cache use. Those figures reveal how heavily the service is used and when, and may hint at workload patterns. Keep /metrics on an internal network that your monitoring system reaches, and check it returns nothing to an unauthenticated external caller.
Missing per-user audit and attribution
A shared key tells you that a request was authorized, but not which person or application sent it. Server logs cannot separate one team's traffic from another's, and you cannot disable one user without disabling everyone. If your controls require user-level records, plan an identity-aware gateway in front of vLLM before users are onboarded.
Keys in process listings or config files
Passing --api-key on the command line can expose the value in process listings on the host, and a key written into a service file or container definition spreads through version control and backups. Check how the key reaches the process, restrict who can read process lists and deployment files, and load the value from a secret store where your platform supports it.
Drift when vLLM versions change path behavior
vLLM ships new minor releases about every two weeks, and the set of protected paths can change between versions. A proxy rule that worked on one release may leave a new or renamed path open after an upgrade. Read the release notes and security advisories for each version, and rerun your path tests after every upgrade rather than assuming the allowlist still holds.
- Typical minor release cadence
- Two weeks
Moving multi-user access to a gateway
For more than a handful of users, the sound design is a gateway in front of vLLM that holds user identity and vLLM keeps one internal credential. Users authenticate to the gateway, receive their own keys, and the gateway forwards approved requests to vLLM using a service credential that users never see. Budgets, rate limits, model restrictions and usage attribution then live in the gateway, where they can be assigned per user or team. vLLM only has to accept traffic from the gateway, which is the same network boundary the vLLM security docs recommend for the endpoints users need.
LiteLLM is one option for that layer, and it is open source under the MIT license outside its enterprise directory. Its virtual keys need a PostgreSQL database, and once more than one proxy instance runs, Redis 7.0 or newer is needed for shared rate limits and router state. SSO for the admin UI is free for up to five users, and SCIM, audit logs and IP allowlisting are Enterprise features. Confirm the current license terms and feature split with the vendor before you build around them, and compare at least one other gateway, since the requirements above apply to the pattern, not to one product.
Before choosing a gateway, confirm which identity provider the gateway will trust, whether per-user budgets and model restrictions meet your chargeback needs, and where usage logs are retained for your audit team. Also confirm that the gateway is the only path to the vLLM port, using firewall rules or network policy, so a user cannot bypass the budgets by calling vLLM directly. Test that bypass explicitly, and rotate the internal vLLM key on a schedule you can document, since every user now depends on it.
Limits to confirm in your environment
The --api-key option is a small control with a narrow scope, so its value depends on details that differ by deployment. The cards below cover the items to verify against your own vLLM version, network layout and access policy before you treat the key as a gate.
Exact path coverage for your version
The docs say the key protects /v1, /v2, /inference and /cohere, and leaves /invocations, /pause, /resume, /abort_requests, /metrics and /health open. Confirm that list against the release you run, because path handling can change between releases. Test each path with and without the key and record the results as evidence.
- Latest release listed
- v0.31.0
How clients send the key
Confirm which header the server accepts for the key and whether your applications send it the same way. Some OpenAI-compatible clients put the key in an Authorization: Bearer header by default, while others need configuration. Check that the key never appears in query strings, where it can land in proxy and access logs.
Where TLS terminates
The key travels in plain text unless the connection is encrypted. Decide whether TLS ends at the reverse proxy, the gateway or the vLLM server itself, and confirm that traffic between the proxy and vLLM stays on a network you control. A key sent over an unencrypted hop between internal services is exposed to anyone who can observe that segment.
How the key is stored
The key is usually passed as a command-line argument or environment variable, which can expose it in process listings, shell history and deployment manifests. Confirm who can read the startup command, container spec and Kubernetes secrets, and whether rotation requires a restart. Keep the key in a secret manager and restrict read access to the operators who need it.
Network access to metrics and probes
/metrics exposes request counts, token throughput, latency and KV cache use, and /health is open without the key. Decide which networks, such as your monitoring subnet or the load balancer range, need these paths, and block them from user-facing networks at the proxy or firewall. Confirm that your Prometheus scrapers and health checks still work after the block.
Fit of the gateway identity model
A single shared key cannot show which user or team made a request, and it cannot be revoked for one person without rotating it for everyone. Check whether the gateway you choose issues per-user or per-team keys, supports your identity provider, and writes audit logs that name the caller. Compare these features against the access policy your compliance team has approved, and confirm which of them need a paid license.
Questions teams ask before relying on the vLLM API key
Is the vLLM API key enough to protect a production deployment?
No. The key is a single shared secret that protects only some paths. The --api-key option covers endpoints under /v1, /v2, /inference and /cohere, but it does not cover /invocations, /pause, /resume, /abort_requests, /metrics or /health. The vLLM security documentation warns against relying on the key alone and recommends a reverse proxy that allowlists only the endpoints meant for users. For production, treat the key as one control among several: a proxy in front of the server, network restrictions on the management paths, and a plan for who holds the key and how it rotates. Confirm the exact behavior against the release you run, because path coverage can change between versions.
What does it cost to run vLLM with an API key and a proxy?
vLLM has no paid edition, so the license itself costs nothing. The recurring cost comes from accelerator capacity (GPUs or other supported hardware), the surrounding infrastructure such as networking, storage, load balancers and monitoring, and the people who operate it. The one-time cost is implementation: designing the proxy allowlist, configuring keys and testing the exposed paths. Costs rise with the number of models, the size of each model, the number of nodes and the uptime the service must meet. When you request a quote, ask for the scope of endpoints tested, the environments covered, the handover documentation and whether retesting after each vLLM upgrade is included. Ask for the cost components separately so you can see which ones your own team already pays for.
How long does a basic hardening pass for vLLM take?
The duration depends on scope, and DeployOpen sets it out in a written quote before work starts. The main variables are the number of endpoints to review, whether a reverse proxy already exists, how many environments (development, staging, production) need the same controls, whether multi-node networking must be isolated, and how much evidence your compliance team expects. A pass limited to the API key and an endpoint allowlist is much smaller than one that also covers TLS, rate limits, model supply chain and monitoring access. Ask for a list of the tasks, the environments included and the points at which your team must review or approve the work.
What must our team provide before a hardening engagement starts?
Your team should provide the following so the work can be scoped accurately:
- The vLLM version and the exact
vllm serveflags in use, including whether--api-keyis set and where the key is stored. - A list of the clients and applications that call the server, with the paths each one uses.
- The network layout: where the server, any proxy, the monitoring stack and multi-node workers sit, and which subnets can reach them.
- Access to a staging environment that matches production, and a named owner for approvals.
- Your identity provider details if user access will be tied to SSO, and your logging and retention requirements.
Missing items usually add time at the start of the work, not at the end.
Can our own team harden vLLM without an outside partner?
Yes, if your team has engineers who understand reverse proxies, network policy and the vLLM server's command-line options. The work is mostly configuration and testing: restricting the paths the proxy forwards, blocking management endpoints at the network layer, checking that /metrics and /health are reached only from monitoring systems, and confirming the server does not run development endpoints. The harder part is repeating these checks after each release, since vLLM ships new minor versions about every two weeks. A partner is most useful when you need an independent test, a written evidence trail for auditors, or a retainer that covers testing and upgrades. Decide based on who will own the check after the first pass.
How does a gateway change the workload compared with a single shared key?
A gateway replaces a single shared key with per-user or per-team identity, so the work shifts from managing one secret to managing accounts, budgets and limits. For example, an illustrative setup might place LiteLLM in front of vLLM so that each team receives a virtual key with its own model access, token limits and request limits. The gateway needs its own database and, once more than one instance runs, shared state such as Redis. Its SSO features and some enterprise controls, such as audit logs and IP allowlisting, depend on the license tier, so confirm which features your plan includes. The vLLM server then accepts traffic only from the gateway, which keeps the internal endpoints out of user reach. Plan for the gateway to be patched, backed up and monitored like any other production service.
Should we rely on an API key for multi-user access to vLLM?
Usually not. A single shared key cannot tell you which user or application made a request, cannot be revoked for one person without rotating it for everyone, and gives no per-user limits. The key is adequate for a small, trusted group behind a controlled network, but multi-user access normally needs identity-based access through a proxy or gateway. Ask your security team whether the access model meets your internal policy, and confirm how requests will be attributed in the logs before you open access to more people.
What should we check first if we already expose vLLM to users?
Start by listing every path the server answers, then test each one from outside the intended network. Confirm that /metrics, /health, /pause, /resume and /abort_requests cannot be reached by users, and that /invocations is blocked unless you have a specific need for it. Next, check whether the server is reachable on the node or pod network directly, bypassing the proxy. Review the monitoring configuration, since Prometheus metrics expose request counts and latency. Record the results with the vLLM version tested, so the same checks can be repeated after the next release.
How DeployOpen scopes and delivers vLLM access controls
DeployOpen treats vLLM --api-key as one layer of access control, not the whole answer. We scope which paths users may reach, which operator endpoints stay internal, and how a gateway with per-user identity replaces a single shared key when several teams need access. Each step is written down and tested before handover.
How we scope
- Inventory every path your vLLM server exposes, including /metrics, /health and control endpoints, against the paths the API key covers.
- Agree in writing which endpoints users need, which stay internal, and who owns each decision.
- Define whether a single shared key is acceptable or whether per-user identity and budgets are required.
- Fixed-scope engagements set deliverables and timelines in writing before any work starts.
How we build
- Configure the API key where it fits, and place a reverse proxy in front that allowlists only user-facing paths.
- Keep metrics, health and operator endpoints on a network segment that user traffic cannot reach.
- Where several users or teams need access, deploy a gateway with individual keys, budgets and rate limits.
- Test each path from outside the trusted network, including the endpoints the API key does not cover.
How we hand over
- Deliver the endpoint allowlist, network rules and gateway configuration as versioned files your team can review.
- Document which paths are open, which are internal, and why each decision was made.
- Provide a findings report with fixes and a retest, so your security team can verify the result.
- Walk your operators through key rotation, adding a path to the allowlist and reviewing logs.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers.
- Re-check the allowlist when vLLM releases change endpoints, since minor releases arrive about every two weeks.
- Confirm the scope of any retainer in writing, including how new endpoints and advisories are handled.

