From f3466affc0878b8b794a5c0766d5954316d4145f Mon Sep 17 00:00:00 2001 From: Kamesh Sampath Date: Fri, 29 May 2026 19:37:33 +0530 Subject: [PATCH] feat(snowflake-cortex): add Snowflake Cortex provider Adds the snowflake-cortex provider which exposes Snowflake's Cortex REST API (OpenAI Chat Completions-compatible endpoint) to opencode. Provider details: - npm: @ai-sdk/openai-compatible - API: https://${SNOWFLAKE_ACCOUNT}.snowflakecomputing.com/api/v2/cortex/v1 - Auth: SNOWFLAKE_ACCOUNT + SNOWFLAKE_CORTEX_PAT (Programmatic Access Token) Models (11, all with tool_call support): - Anthropic: claude-opus-4-7 (beta/preview), claude-sonnet-4-6, claude-sonnet-4-5, claude-haiku-4-5 - OpenAI: openai-gpt-5.4 (beta), openai-gpt-5.2, openai-gpt-5.1, openai-gpt-5 (beta), openai-gpt-5-mini (beta), openai-gpt-5-nano (beta), openai-gpt-4.1 Models without tool_call support (deepseek-r1, llama3.1-70b, snowflake-llama-3.3-70b, mistral-large2) are excluded per Snowflake docs: "Tool calling is supported for OpenAI and Claude models only." Preview/not-GA models are marked with status = "beta". Cost fields are intentionally omitted on all models. The Cortex REST API is billed in USD (AI_INFERENCE service type) at rates defined in the Snowflake Service Consumption Table. Closes #1895 --- providers/snowflake-cortex/logo.svg | 3 +++ providers/snowflake-cortex/models/claude-haiku-4-5.toml | 7 +++++++ providers/snowflake-cortex/models/claude-opus-4-7.toml | 5 +++++ providers/snowflake-cortex/models/claude-sonnet-4-5.toml | 7 +++++++ providers/snowflake-cortex/models/claude-sonnet-4-6.toml | 7 +++++++ providers/snowflake-cortex/models/openai-gpt-4.1.toml | 3 +++ providers/snowflake-cortex/models/openai-gpt-5-mini.toml | 9 +++++++++ providers/snowflake-cortex/models/openai-gpt-5-nano.toml | 5 +++++ providers/snowflake-cortex/models/openai-gpt-5.1.toml | 3 +++ providers/snowflake-cortex/models/openai-gpt-5.2.toml | 3 +++ providers/snowflake-cortex/models/openai-gpt-5.4.toml | 5 +++++ providers/snowflake-cortex/models/openai-gpt-5.toml | 5 +++++ providers/snowflake-cortex/provider.toml | 5 +++++ 13 files changed, 67 insertions(+) create mode 100644 providers/snowflake-cortex/logo.svg create mode 100644 providers/snowflake-cortex/models/claude-haiku-4-5.toml create mode 100644 providers/snowflake-cortex/models/claude-opus-4-7.toml create mode 100644 providers/snowflake-cortex/models/claude-sonnet-4-5.toml create mode 100644 providers/snowflake-cortex/models/claude-sonnet-4-6.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-4.1.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-5-mini.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-5-nano.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-5.1.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-5.2.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-5.4.toml create mode 100644 providers/snowflake-cortex/models/openai-gpt-5.toml create mode 100644 providers/snowflake-cortex/provider.toml diff --git a/providers/snowflake-cortex/logo.svg b/providers/snowflake-cortex/logo.svg new file mode 100644 index 0000000000..b4ce519ea3 --- /dev/null +++ b/providers/snowflake-cortex/logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/providers/snowflake-cortex/models/claude-haiku-4-5.toml b/providers/snowflake-cortex/models/claude-haiku-4-5.toml new file mode 100644 index 0000000000..ac5151d83e --- /dev/null +++ b/providers/snowflake-cortex/models/claude-haiku-4-5.toml @@ -0,0 +1,7 @@ +[extends] +from = "anthropic/claude-haiku-4-5" +omit = ["cost"] + +[limit] +context = 200_000 +output = 16_384 diff --git a/providers/snowflake-cortex/models/claude-opus-4-7.toml b/providers/snowflake-cortex/models/claude-opus-4-7.toml new file mode 100644 index 0000000000..a6dbd9477a --- /dev/null +++ b/providers/snowflake-cortex/models/claude-opus-4-7.toml @@ -0,0 +1,5 @@ +status = "beta" + +[extends] +from = "anthropic/claude-opus-4-7" +omit = ["cost"] diff --git a/providers/snowflake-cortex/models/claude-sonnet-4-5.toml b/providers/snowflake-cortex/models/claude-sonnet-4-5.toml new file mode 100644 index 0000000000..ba1dc8189f --- /dev/null +++ b/providers/snowflake-cortex/models/claude-sonnet-4-5.toml @@ -0,0 +1,7 @@ +[extends] +from = "anthropic/claude-sonnet-4-5" +omit = ["cost"] + +[limit] +context = 200_000 +output = 16_384 diff --git a/providers/snowflake-cortex/models/claude-sonnet-4-6.toml b/providers/snowflake-cortex/models/claude-sonnet-4-6.toml new file mode 100644 index 0000000000..79b14c4e74 --- /dev/null +++ b/providers/snowflake-cortex/models/claude-sonnet-4-6.toml @@ -0,0 +1,7 @@ +[extends] +from = "anthropic/claude-sonnet-4-6" +omit = ["cost"] + +[limit] +context = 1_000_000 +output = 16_384 diff --git a/providers/snowflake-cortex/models/openai-gpt-4.1.toml b/providers/snowflake-cortex/models/openai-gpt-4.1.toml new file mode 100644 index 0000000000..8db7aa1e2e --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-4.1.toml @@ -0,0 +1,3 @@ +[extends] +from = "openai/gpt-4.1" +omit = ["cost"] diff --git a/providers/snowflake-cortex/models/openai-gpt-5-mini.toml b/providers/snowflake-cortex/models/openai-gpt-5-mini.toml new file mode 100644 index 0000000000..189c7ef847 --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-5-mini.toml @@ -0,0 +1,9 @@ +status = "beta" + +[extends] +from = "openai/gpt-5-mini" +omit = ["cost"] + +[limit] +context = 272_000 +output = 8_192 diff --git a/providers/snowflake-cortex/models/openai-gpt-5-nano.toml b/providers/snowflake-cortex/models/openai-gpt-5-nano.toml new file mode 100644 index 0000000000..312b023f3b --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-5-nano.toml @@ -0,0 +1,5 @@ +status = "beta" + +[extends] +from = "openai/gpt-5-nano" +omit = ["cost"] diff --git a/providers/snowflake-cortex/models/openai-gpt-5.1.toml b/providers/snowflake-cortex/models/openai-gpt-5.1.toml new file mode 100644 index 0000000000..dd623d406e --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-5.1.toml @@ -0,0 +1,3 @@ +[extends] +from = "openai/gpt-5.1" +omit = ["cost"] diff --git a/providers/snowflake-cortex/models/openai-gpt-5.2.toml b/providers/snowflake-cortex/models/openai-gpt-5.2.toml new file mode 100644 index 0000000000..a9eda75f8d --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-5.2.toml @@ -0,0 +1,3 @@ +[extends] +from = "openai/gpt-5.2" +omit = ["cost"] diff --git a/providers/snowflake-cortex/models/openai-gpt-5.4.toml b/providers/snowflake-cortex/models/openai-gpt-5.4.toml new file mode 100644 index 0000000000..e5c4e2e30f --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-5.4.toml @@ -0,0 +1,5 @@ +status = "beta" + +[extends] +from = "openai/gpt-5.4" +omit = ["cost"] diff --git a/providers/snowflake-cortex/models/openai-gpt-5.toml b/providers/snowflake-cortex/models/openai-gpt-5.toml new file mode 100644 index 0000000000..d3f3019c6a --- /dev/null +++ b/providers/snowflake-cortex/models/openai-gpt-5.toml @@ -0,0 +1,5 @@ +status = "beta" + +[extends] +from = "openai/gpt-5" +omit = ["cost"] diff --git a/providers/snowflake-cortex/provider.toml b/providers/snowflake-cortex/provider.toml new file mode 100644 index 0000000000..7340773e58 --- /dev/null +++ b/providers/snowflake-cortex/provider.toml @@ -0,0 +1,5 @@ +name = "Snowflake Cortex" +npm = "@ai-sdk/openai-compatible" +api = "https://${SNOWFLAKE_ACCOUNT}.snowflakecomputing.com/api/v2/cortex/v1" +env = ["SNOWFLAKE_ACCOUNT", "SNOWFLAKE_CORTEX_PAT"] +doc = "https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-rest-api"