> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# SET DEFAULT AI PROVIDER

> Set an AI provider as the default for its type.

Sets a Provider as the default for AI functions of its type. You can set the `chat` and `embedding` defaults independently.

`provider` and `model` must be constant VARCHAR expressions. If `provider` is omitted, an empty string, or SQL NULL, the cluster default Provider for the function type is used: `chat` for completion and text helpers, `embedding` for embeddings. If `model` is omitted, an empty string, or SQL NULL, the selected Provider's default model is used; an explicit model takes precedence. Values containing only whitespace are invalid. An explicit Provider call does not require a cluster default.

## Syntax

```SQL theme={null}
SET <provider_name> AS DEFAULT AI PROVIDER
```

## Parameters

| Parameter | Description |
| - | - |
| `provider_name` | Name of an existing provider to make default. |

## Examples

```sql theme={null}
SET openai AS DEFAULT AI PROVIDER;          -- default embedding provider
SET dashscope_chat AS DEFAULT AI PROVIDER;  -- default chat provider
```

## See also

* [`CREATE AI PROVIDER`](/documents/4.2/sql-reference/sql-statements/cluster-management/ai_provider/CREATE_AI_PROVIDER)
* [`SHOW AI PROVIDERS`](/documents/4.2/sql-reference/sql-statements/cluster-management/ai_provider/SHOW_AI_PROVIDERS)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.