http_client
relationalai.agent.cortex
http_client( conn: SnowflakeConnection, timeout: int = 300, host: str | None = None) -> httpx.ClientCreate an authenticated HTTP client for Snowflake Cortex API requests.
Parameters
Section titled “Parameters”
(connSnowflakeConnection) - An active Snowflake connection used to extract the session token.
(timeoutint, default:300) - Request timeout in seconds. Default: 300.
(hoststr, default:None) - Override for the base URL host. Accepts a bare hostname (e.g.amd01.east-us-2.azure.snowflakecomputing.com) or a full URL with scheme. When omitted,conn.hostis used if it is a regional Snowflake hostname; otherwise the URL is built fromCURRENT_ACCOUNT()so it matches Snowflake’s default REST TLS certificate.
Returns
Section titled “Returns”httpx.Client- A configured HTTP client with authentication headers and the correct Snowflake base URL.
Examples
Section titled “Examples”from relationalai.config import Config
conn = create_config().get_session().connectionclient = http_client(conn)