embedding— supplies an endpoint for ai_embed. The semantic-context module uses an OpenAI-compatible/v1/embeddingsendpoint forCONTEXT UPSERTandquery_textsearches.chat— supplies a chat completion endpoint for ai_complete and other chat functions.
api_key property — is persisted on the FE metadata journal and
image, so cluster restarts and upgrades retain the credential. There is no fe.conf knob for these
settings.
CAUTION
Anyone with read access to the FE meta image / BDB journal directory can read provider api_key
values; protect those files with filesystem permissions.
For SQL AI functions, both openai and dashscope Providers support HTTP and HTTPS with or without an API key. A nonempty key produces an Authorization: Bearer ... header. URL format, control-character, DNS, and address validation still apply. Use a trusted endpoint and data approved for transmission.
Set a default with SET <provider_name> AS DEFAULT AI PROVIDER. If the corresponding default is absent, FE rejects implicit Provider calls, including EXPLAIN. Each execution plan captures its selected Provider configuration. ALTER and default changes affect newly planned queries; each prepared EXECUTE replans against current metadata.
Privileges
Creating or managing providers requires SYSTEMOPERATE. Calling a provider through an AI function requires both the AI function privilege and USAGE on that AI PROVIDER. Creating a provider does not automatically grant usage to ordinary users.
Syntax
Parameters
PROPERTIES
SQL AI function endpoints
For Alibaba Cloud Model Studio (Bailian), useopenai with /compatible-mode/v1/... endpoints and dashscope with native endpoints.
For dashscope, set endpoint to the full native URL for the operation. Its path must match the Provider TYPE. Overriding model in SQL still sends requests to the configured endpoint.
See the supported inputs by endpoint and the Model Studio multimodal embedding API.
Examples
Register an embedding provider and make it the default for theembedding type:
chat Provider using the native Model Studio multimodal generation endpoint.
See also
ALTER AI PROVIDER— change an existing provider’s properties.DROP AI PROVIDER— remove a provider.SHOW AI PROVIDERS— list providers (optionally filtered byTYPE).DESC AI PROVIDER— show one provider’s full configuration.SET DEFAULT AI PROVIDER— set the default provider for its type.