# 511 Network Authentication Required

> The client needs to authenticate to gain network access.

Source: https://apiguide.dev/status-codes/511
Class: server-error
Defined in: RFC 6585 <https://www.rfc-editor.org/rfc/rfc6585.html>
Updated: 2026-07-09

## What does HTTP status code 511 mean?

The 511 Network Authentication Required status code indicates that the client must authenticate to gain network access (e.g., captive portals).

## When to use it in APIs

Typically generated by public Wi-Fi networks or proxies before letting request traffic through to the internet.

## How it compares to other codes

* **401 Unauthorized**: Identifies authentication needed for the target API host, whereas 511 is for access to the network itself.
