Skip to content
Fluxer API

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.

Every field is always present.

FieldTypeDescription
url1stringThe ws or wss URL of the main Gateway endpoint
shards2integerThe shard count recommended for the authenticated bot
session_start_limit3session start limit objectThe 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.

{
"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.

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.

FieldTypeDescription
total1integerThe session starts allowed across the window, always 1000
remaining1integerThe session starts reported as left, always 999
reset_after2integerThe milliseconds reported until the budget resets, always 14400000
max_concurrency3integerThe 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/v1/gateway/botBot

Returns 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.

StatusBodyCondition
200Gateway information objectThe credential is in bot token form
4011error responseThe 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

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.

60 requests per minute for each authenticated account, or for each client IP address when no account resolved, on the gateway:bot_info bucket.