feat(core): add Snowflake Cortex provider (#29901)

Co-authored-by: Cortex Code <noreply@snowflake.com>
This commit is contained in:
Kamesh Sampath 2026-06-05 08:49:55 +05:30 committed by GitHub
commit 2859ce6e73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 434 additions and 0 deletions

View file

@ -1940,6 +1940,65 @@ To use [Scaleway Generative APIs](https://www.scaleway.com/en/docs/generative-ap
---
### Snowflake Cortex
[Snowflake Cortex](https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-rest-api) gives you access to frontier models (Claude, OpenAI GPT-5, and more) via an OpenAI-compatible API. All inference runs within the Snowflake perimeter and is billed in Snowflake credits. For per-model rates, see the [Snowflake Service Consumption Table](https://www.snowflake.com/legal-files/CreditConsumptionTable.pdf).
Don't have a Snowflake account? [Sign up for a free trial](https://signup.snowflake.com/?utm_source=opencode&utm_medium=docs&utm_campaign=cortex-provider).
opencode's core workflow for coding, editing files, and running commands relies on tool calling. Only the Claude and OpenAI families within Snowflake Cortex support this. The provider is limited to those families to support the core workflow.
1. Generate a [Programmatic Access Token (PAT)](https://docs.snowflake.com/en/user-guide/programmatic-access-tokens) in your Snowflake account.
2. Run the `/connect` command and search for **Snowflake Cortex**.
```txt
/connect
```
3. Enter your [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier) when prompted (e.g. `myorg-myaccount` or `xy12345.us-east-1`).
```txt
┌ Snowflake Account Identifier
└ enter
```
4. Enter your **PAT**.
```txt
┌ Programmatic Access Token (PAT)
└ enter
```
5. Run the `/models` command to select a model.
```txt
/models
```
Alternatively, set environment variables before starting opencode:
```bash
export SNOWFLAKE_ACCOUNT=myorg-myaccount
export SNOWFLAKE_CORTEX_PAT=your-pat
```
The model catalog is provided automatically. A minimal `opencode.json` is all that's needed:
```json title="opencode.json"
{
"$schema": "https://opencode.ai/config.json",
"model": "snowflake-cortex/claude-sonnet-4-6",
"small_model": "snowflake-cortex/claude-haiku-4-5"
}
```
---
### Together AI
1. Head over to the [Together AI console](https://api.together.ai), create an account, and click **Add Key**.