> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Gateway Config • AI Agent SDK

> GatewayConfig: Configuration for the gateway server.

# GatewayConfig

> Defined in the [**config**](../modules/config) module.

<Badge color="blue">AI Agent</Badge>

Configuration for the gateway server.

Attributes:
host: Host to bind to
port: Port to listen on
cors\_origins: Allowed CORS origins
allowed\_origins: Allowed origins for WebSocket connections (CSWSH defense)
auth\_token: Optional authentication token
max\_connections: Maximum concurrent connections
max\_sessions\_per\_agent: Maximum sessions per agent (0 = unlimited)
session\_config: Default session configuration
heartbeat\_interval: Heartbeat interval in seconds
reconnect\_timeout: Time to wait for reconnection before closing session
ssl\_cert: Path to SSL certificate (for HTTPS/WSS)
ssl\_key: Path to SSL key
max\_buffered\_bytes: Maximum buffered bytes before slow consumer disconnect (default 1MB)
max\_queued\_frames: Maximum queued outbound frames per client before slow
consumer disconnect (0 = unlimited frame count; byte ceiling still
applies). Default 1000.
push: Push notification service configuration
auth\_scopes: Optional operator scope policy mapping token -> list of
scope names (see OperatorScope). When None/empty (default), any
successfully authenticated client is granted all scopes — identical
to the previous binary behaviour. Single-operator setups are
unaffected.

## Properties

<ResponseField name="host" type="str">
  No description available.
</ResponseField>

<ResponseField name="port" type="int">
  No description available.
</ResponseField>

<ResponseField name="bind_host" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="cors_origins" type="List[str]">
  No description available.
</ResponseField>

<ResponseField name="allowed_origins" type="List[str]">
  No description available.
</ResponseField>

<ResponseField name="auth_token" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="max_connections" type="int">
  No description available.
</ResponseField>

<ResponseField name="max_sessions_per_agent" type="int">
  No description available.
</ResponseField>

<ResponseField name="session_config" type="SessionConfig">
  No description available.
</ResponseField>

<ResponseField name="heartbeat_interval" type="int">
  No description available.
</ResponseField>

<ResponseField name="reconnect_timeout" type="int">
  No description available.
</ResponseField>

<ResponseField name="per_turn_timeout" type="float">
  No description available.
</ResponseField>

<ResponseField name="ssl_cert" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="ssl_key" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="max_buffered_bytes" type="int">
  No description available.
</ResponseField>

<ResponseField name="max_queued_frames" type="int">
  No description available.
</ResponseField>

<ResponseField name="max_concurrent_runs" type="int">
  No description available.
</ResponseField>

<ResponseField name="queue_depth" type="int">
  No description available.
</ResponseField>

<ResponseField name="overflow_policy" type="str">
  No description available.
</ResponseField>

<ResponseField name="preauth_max_connections_per_ip" type="int">
  No description available.
</ResponseField>

<ResponseField name="max_unauthorized_frames" type="int">
  No description available.
</ResponseField>

<ResponseField name="push" type="PushConfig">
  No description available.
</ResponseField>

<ResponseField name="auth_scopes" type="Optional">
  No description available.
</ResponseField>

<ResponseField name="api" type="ApiConfig">
  No description available.
</ResponseField>

<ResponseField name="liveness" type="LivenessConfig">
  No description available.
</ResponseField>

<ResponseField name="turn_lock" type="TurnLockConfig">
  No description available.
</ResponseField>

<ResponseField name="control" type="EmergencyStopConfig">
  No description available.
</ResponseField>

<ResponseField name="executor" type="'Optional[TurnExecutorProtocol]'">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="has_scope_policy()" icon="function" href="../functions/GatewayConfig-has_scope_policy">
    Whether an operator scope policy is configured.
  </Card>

  <Card title="resolve_scopes()" icon="function" href="../functions/GatewayConfig-resolve_scopes">
    Resolve the operator scopes granted to `token`.
  </Card>

  <Card title="is_secure()" icon="function" href="../functions/GatewayConfig-is_secure">
    Whether SSL/TLS is enabled.
  </Card>

  <Card title="ws_url()" icon="function" href="../functions/GatewayConfig-ws_url">
    WebSocket URL for this gateway.
  </Card>

  <Card title="http_url()" icon="function" href="../functions/GatewayConfig-http_url">
    HTTP URL for this gateway.
  </Card>
</CardGroup>

<Accordion title="Internal & Generic Methods">
  * **to\_dict**: Convert to dictionary (hides sensitive data).
</Accordion>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/config.py#L779">
  `praisonaiagents/gateway/config.py` at line 779
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Configuration Overview" icon="gear" href="/docs/docs/configuration/index" />

  <Card title="Agent Config" icon="robot" href="/docs/docs/configuration/agent-config" />

  <Card title="Gateway Feature" icon="tower-broadcast" href="/docs/docs/features/gateway" />
</CardGroup>
