Gateway
Gateway information tells a bot where to open its connection to the main Gateway. The object has that URL, a shard count, and a session start budget. Framing, opcodes, heartbeats, resumption, and close codes belong to the Gateway overview.
The one route here reads Authorization itself. Only the bot token form is accepted. A user client instead reads the same WebSocket URL from endpoints.gateway in the instance discovery document and presents its session token inside Identify.
Gateway information object
Section titled “Gateway information object”Every field is always present.
Structure
Section titled “Structure”| Field | Type | Description |
|---|---|---|
| url1 | string | The ws or wss URL of the main Gateway endpoint |
| shards2 | integer | The shard count recommended for the authenticated bot |
| session_start_limit3 | session start limit object | The advertised session start budget |
1 The deployment’s configured Gateway endpoint, byte for byte the string instance endpoints publishes as endpoints.gateway
2 Always the literal 1
3 Every member of the object is a constant
Fluxer appends no query string, so a client appends the connection parameters itself. A client MUST NOT upgrade a published ws value, because a deliberately plain HTTP deployment advertises one.
Example
Section titled “Example”{ "url": "wss://gateway.example.com", "shards": 1, "session_start_limit": { "total": 1000, "remaining": 999, "reset_after": 14400000, "max_concurrency": 1 }}Identify accepts a shard pair whose shard_count element is from 1 through 16,384 under the sharding contract, whatever shards reports. A bot session whose shard is assigned more than 2,500 guilds closes with 4011, and the bot must shard further. A user session is never checked against the guild ceiling.
Session start limit object
Section titled “Session start limit object”A session start limit reports how many new Gateway sessions a bot may open in a window. Fluxer publishes four constants here for client-library compatibility.
Structure
Section titled “Structure”| Field | Type | Description |
|---|---|---|
| total1 | integer | The session starts allowed across the window, always 1000 |
| remaining1 | integer | The session starts reported as left, always 999 |
| reset_after2 | integer | The milliseconds reported until the budget resets, always 14400000 |
| max_concurrency3 | integer | The number of concurrent Identify buckets, always 1 |
1 Fluxer keeps no session-start ledger, so neither a request nor an Identify changes either value
2 14400000 ms is four hours, and Fluxer runs no timer against it
3 Fluxer runs no Identify concurrency bucket, so a bot MAY identify its shards without pacing them against this value
The limits the Gateway actually enforces live in Session lifecycle. Fluxer budgets Identify per source address. It caps a user account at a fixed number of concurrent sessions. Neither bound is reported here.
Get Gateway information
Section titled “Get Gateway information”GET/v1/gateway/botReturns a Gateway information object.
The route matches the scheme prefix without regard to case and accepts Bot , Bearer , or a bare token, then trims the remainder. An empty remainder returns 401 MISSING_AUTHORIZATION. A remainder beginning with flx_ returns 401 INVALID_AUTH_TOKEN, because that is the user session token prefix. The route accepts any other remainder only when it has a full stop that is neither its first nor its last character, with decimal digits before it.
Validate a token with Identify or Get bot application instead.
A 200 has the informational rate limit headers only for the Bot prefix. Fluxer keys the bare form and the Bearer form on the client IP address.
Response
Section titled “Response”| Status | Body | Condition |
|---|---|---|
| 200 | Gateway information object | The credential is in bot token form |
| 4011 | error response | The credential is absent, is empty after its scheme prefix, or is not in bot token form |
1 An absent or empty credential uses MISSING_AUTHORIZATION, and every other rejected value uses INVALID_AUTH_TOKEN
Side effects
Section titled “Side effects”Fluxer records an authentication failure signal of weight 1 against the client IP address for every credential it does not resolve to an account. A bot token resolves only under the Bot prefix, so the bare form and the Bearer form record that signal even on the requests this route answers 200. A client avoids that signal by presenting the Bot prefix.
A 401 adds a client error signal of weight 0.75, but only when the request resolved no account. A live user session token resolves an account under the Bearer prefix and under no prefix, so the 401 it receives records no signal. Both signals feed the automatic address ban described in Errors.
Rate limit
Section titled “Rate limit”60 requests per minute for each authenticated account, or for each client IP address when no account resolved, on the gateway:bot_info bucket.