http_client
relationalai.agent.cortex
http_client( conn: SnowflakeConnection, timeout: int = 300, host: str | None = None) -> requests.SessionCreate an authenticated HTTP client for Snowflake Cortex API requests.
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 when it is a usable Snowflake hostname; otherwise the URL is built fromCURRENT_ACCOUNT().
Returns
requests.Session- A configured HTTP client with authentication headers and the correct Snowflake base URL. Relative URLs passed to the session’s request methods are joined against the base URL.
Examples
from relationalai.config import Config
conn = create_config().get_session().connectionclient = http_client(conn)