↓ Skip to main content
All methods

stakepd.kalshi_data.KalshiAuthError

Exception
Exception class
kd.KalshiAuthError

Raised when credentials are missing, incomplete or unreadable.

Also raised when a portfolio method is called on a client without credentials. That check happens before any request is sent. Inherits from KalshiError.

See also

KalshiClient
Create a client for the Kalshi Trade API v2.
KalshiClient.from_env
Create an authenticated client from environment variables.
KalshiError
Base class for every exception raised by stakepd.kalshi_data.

Examples
#

Example:

client = kd.KalshiClient()          # no credentials
try:
    client.get_positions()
except kd.KalshiAuthError as e:
    print(e)

This method is also covered, alongside the rest of the module, in the overview guide.