OpenAI Responses API support in Cortex REST API
You can now call OpenAI models using the OpenAI-compatible Responses API on the Cortex REST API and Cortex AI Gateway within Snowflake's governance perimeter.
What changed
Snowflake released preview support for the Responses API endpoint on both the Cortex REST API and Cortex AI Gateway. This allows applications built around OpenAI's Responses API specification to access supported OpenAI models directly within Snowflake.
Use cases
Imagine you maintain microservices or tools designed specifically for OpenAI's Responses API specification and want to migrate execution into Snowflake without refactoring clients to the Chat Completions format. You can:
- Point official OpenAI SDKs or compatible clients to your Snowflake account endpoint.
- Run inference against OpenAI models while keeping queries within Snowflake's governance boundaries.
- Centralize token monitoring and access control using Snowflake database roles.
How to use
You can configure the OpenAI SDK to use the Cortex REST API base endpoint (/api/v2/cortex/v1) or the Cortex AI Gateway (/v1/responses) using a Snowflake Programmatic Access Token (PAT) for authentication.
from openai import OpenAI
client = OpenAI(
api_key="<SNOWFLAKE_PAT>",
base_url="https://<account-identifier>.snowflakecomputing.com/api/v2/cortex/v1"
)
response = client.responses.create(
model="openai-gpt-5.6-sol",
instructions="You are a helpful assistant.",
input="How does a snowflake get its unique pattern?",
store=False,
)
print(response.output_text)
What happens in this code:
- The OpenAI client initializes with the Snowflake Cortex REST API base URL and your PAT credentials.
- The
client.responses.createcall submits the target model, system instructions, and input query. - Setting
store=Falsedisables prompt persistence, and the output text is read fromresponse.output_text.
You can also execute the call via cURL:
curl "https://<account-identifier>.snowflakecomputing.com/api/v2/cortex/v1/responses" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <SNOWFLAKE_PAT>" \
-d '{
"model": "openai-gpt-5.6-sol",
"input": "How does a snowflake get its unique pattern?",
"store": false
}'
What happens in this code:
- A POST request is sent to the Cortex
/responsesendpoint with the PAT token in the Bearer authorization header. - The JSON payload specifies the desired OpenAI model and the text input.
- The service evaluates the prompt and returns the output JSON directly.
Limitations and requirements
- Stage: Public preview, enabled across all accounts.
- Supported models: Restricted to OpenAI models only (Claude models use the
/messagesendpoint, and general models use/chat/completions). - Stateless behavior: The API does not persist conversation state; the full conversation must be passed inside
inputon each request. - Unsupported options: Neither
previous_response_idnor background execution mode is supported. - Authorization: The executing user's default role must have either
SNOWFLAKE.CORTEX_USERorSNOWFLAKE.CORTEX_REST_API_USERdatabase role assigned. - Observability: Usage is not logged to
AI_OBSERVABILITY_EVENTS; monitor credits and token usage through theCORTEX_REST_API_USAGE_HISTORYview in theACCOUNT_USAGEschema.
- snowflake cortex
- cortex rest api
- cortex ai gateway
- openai
- responses api
Responses API for the Cortex REST API (Preview)
Summary and explanation generated by AI from the official release note. When in doubt, the platform's official documentation prevails.
Related
- SnowflakePublic Preview
Query Cortex Search Directly in SQL with the CORTEX_SEARCH_RETRIEVE Function
The CORTEX_SEARCH_RETRIEVE table function lets you query Cortex Search services directly in SQL with low latency, supporting single queries or row-by-row lookups with LATERAL joins for RAG and chatbots.
snowflake cortex · cortex search - SnowflakeGA
SPCS GEN_ARM_G1 and GEN_X64_G1 instances are now GA on Google Cloud
GEN_ARM_G1 and GEN_X64_G1 instance families for Snowpark Container Services are now GA on Google Cloud, offering options from 1 to 28 vCPUs for ARM and x86 workloads.
snowflake · snowpark container services - SnowflakeGA
Custom runtime images now generally available for ML Jobs
Build and register your own container images as Custom Runtime Environments (CREs) to use in ML Jobs on Snowflake.
snowflake ml · ml jobs