API template library

Simulate the Snowflake Cortex API

A WireMock simulation of Snowflake's REST API — covering Cortex LLM inference and embeddings, the OpenAI- and Anthropic-compatible routes, Cortex Search services, and Cortex Analyst.

Vendor
Snowflake
Functionality
LLM inference, embeddings, search, Analyst
Spec version
0.0.1
Endpoints
23
Stubs
56
Protocol
REST
Validation
AI-validated Before publication, an AI agent exercised these endpoints against the real Snowflake API through WireMock's recording proxy, and the recorded traffic was used to verify each stub's request and response shapes.

Live sandbox · no signup, no API key

Snowflake Cortex API

A running WireMock Cloud instance of this template, callable right now from a terminal, a script, or an AI agent.

Base URL
https://3z2lkg.wiremockapi.cloud

POST Suspend cortex search service - missing, ifExists

curl -s -X POST 'https://3z2lkg.wiremockapi.cloud/api/v2/databases/your-database/schemas/your-schema/cortex-search-services/your-name:suspend?ifExists=true' \
  -H 'Content-Type: application/json' \
  -d '{}'

GET List cortex search services

curl -s -X GET 'https://3z2lkg.wiremockapi.cloud/api/v2/databases/your-database/schemas/your-schema/cortex-search-services'

POST Resume cortex search service - missing, ifExists

curl -s -X POST 'https://3z2lkg.wiremockapi.cloud/api/v2/databases/your-database/schemas/your-schema/cortex-search-services/your-name:resume?ifExists=true' \
  -H 'Content-Type: application/json' \
  -d '{}'
Method Path Summary
GET /api/v2/cortex/analyst/agentic-optimization Get the status and state of a specified agentic optimization run
POST /api/v2/cortex/analyst/agentic-optimizations List all agentic optimization runs for a given base model
POST /api/v2/cortex/analyst/fast-generation Rapidly generate a semantic model given source material
POST /api/v2/cortex/analyst/feedback cortex_analyst_sendFeedback
POST /api/v2/cortex/analyst/filters-and-metrics-suggestions Generate filters, facts, and metrics suggestions for a semantic model
POST /api/v2/cortex/analyst/message Send a data question to the Cortex Analyst
POST /api/v2/cortex/analyst/pre-selection Retrieve relevant table information from input data for semantic model generation
GET /api/v2/cortex/analyst/token Internal endpoint to exchange a Cortex Analyst Oauth token
POST /api/v2/cortex/analyst/verified-query-suggestions Generate VQ suggestions for a semantic model
POST /api/v2/cortex/inference:complete Perform LLM text completion inference.
POST /api/v2/cortex/inference:embed Perform LLM embed
GET /api/v2/cortex/models Returns the LLMs available for the current session
POST /api/v2/cortex/v1/chat/completions Perform LLM text completion inference using Cortex Chat Completions API format.
POST /api/v2/cortex/v1/messages Perform LLM text completion inference using Cortex Messages API format.
GET /api/v2/databases/{database}/schemas/{schema}/cortex-search-services List cortex search services
POST /api/v2/databases/{database}/schemas/{schema}/cortex-search-services Create a cortex search service
DELETE /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{name} Delete a cortex search service
GET /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{name} Fetch a cortex search service.
POST /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{name}:feedback cortex_search_service_sendFeedback
POST /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{name}:resume Resume the cortex search service
POST /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{name}:suspend Suspend a cortex search service.
POST /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{service_name}:query Query a Cortex Search Service.
POST /api/v2/databases/{database}/schemas/{schema}/cortex-search-services/{service_name}:suggest Suggest from a Cortex Search Service

Unauthenticated WireMock Cloud demo sandbox for Snowflake — not an official Snowflake sandbox, and it returns simulated example data only.

What's inside the Cortex template

The template simulates the Cortex REST endpoints in Snowflake's API. Its inference:complete route always answers as a server-sent event stream, the only response type Snowflake documents for it, with delta chunks and a final usage object. The reply names the model and repeats your prompt, and a model outside the supported list gets a 400 naming it. Cortex Search services are stored per database and schema, so a service you create can be queried, suspended and dropped like a real one.

  • LLM inference — inference:complete streaming across Claude, OpenAI, Llama, Mistral, DeepSeek and Snowflake Arctic model names
  • OpenAI and Anthropic routes — chat.completion objects and Anthropic message objects, each with its own streaming event sequence
  • Embeddings — inference:embed with the dimensions of each supported model, 768 or 1024
  • Cortex Search — service create modes, list, suspend and resume of indexing or serving, query, suggest and feedback
  • Cortex Analyst — messages over a semantic model or view that return an interpretation and SQL, plus suggestions and generation helpers

Example implementation using the OpenAI Python SDK

Cortex exposes an OpenAI-compatible route under /api/v2/cortex/v1, so the standard OpenAI client connects with nothing more than a base URL:

Applications that already read OPENAI_BASE_URL can be pointed at Cortex, or at this mock, through the environment alone. The Anthropic SDK works the same way against the /api/v2/cortex prefix.

Deterministic replies take credit consumption and warehouse availability out of the test loop, so prompt plumbing, streaming parsers and retries can run on every commit.

from openai import OpenAI

# the Cortex OpenAI-compatible route on the sandbox —
# any bearer token is accepted
client = OpenAI(
    base_url="https://3z2lkg.wiremockapi.cloud/api/v2/cortex/v1",
    api_key="any-value",
)

reply = client.chat.completions.create(
    model="claude-4-sonnet",
    messages=[{"role": "user", "content": "Which region had the most orders?"}],
)
print(reply.choices[0].message.content)

Snowflake Cortex mock API FAQ

No. Every reply reads "This is a simulated response from" the model, followed by your last message, and token counts are estimated from the text length. Sampling options, tools and guardrail settings are accepted but don't change the reply.

They are deterministic, derived from the text's length and position, and sized correctly for each model. They aren't semantic, so they suit tests of vector storage and plumbing rather than retrieval quality.

No definition query runs. A query returns up to three rows whose search column repeats your query with a match number, plus similarity scores, so result handling is testable while relevance is not.

No. Search services created here don't appear in the Snowflake resource management template, and no database or warehouse checks are made.

Vendor names identify APIs represented by WireMock template sources. This page does not imply vendor endorsement, certification, partnership, or official integration status.