Skip to main content
The AI Assistant setting connects Bytebase to one AI model provider. It powers SQL Editor AI Assistant, the Page Agent, and AI-powered validation in SQL Review CI. You can connect it to OpenAI, Azure OpenAI, Gemini, or Claude. Each provider works with its hosted API or with a custom endpoint — a private deployment, self-hosted model, or LLM gateway — that implements that provider’s API. Bytebase calls the provider from the Bytebase server, so the API key never reaches the browser. See What Bytebase sends to the AI provider for the data each feature sends.

Enable AI Assistant

Go to Bytebase console, click Settings > General. Scroll down to AI Assistant and turn on Enable AI Assistant. AI Assistant settings with OpenAI selected: AI Provider, API Key, and the Model list set to gpt-5.6-terra Configure the following:
  • AI Provider. Choose OpenAI, Azure OpenAI, Gemini, or Claude. Selecting a provider fills in its default model and endpoint.
  • API Key. The API key for the selected provider. Use the Find my key link next to the field to reach the provider’s key page.
  • Model. Pick a model from the list; Bytebase sets the matching endpoint. To use another model or endpoint, choose Custom model, then enter:
    • Model Name (Deployment Name for Azure OpenAI). Free-form; Bytebase does not check it against a list, so a name the endpoint doesn’t serve fails only when you use AI.
    • API Endpoint. The provider’s API URL, or a private deployment, proxy, or gateway that implements the same API (see Connect to a custom endpoint).
  • API Endpoint (Azure OpenAI). Shown for every model; replace {resource name} with your Azure OpenAI resource name. See Azure OpenAI.
Each provider defaults to: For OpenAI and Azure OpenAI, the listed models use a /responses endpoint, except older models such as gpt-4o, which use /chat/completions.
In Bytebase Cloud, Bytebase manages the AI provider and the AI Assistant settings are hidden.

OpenAI and Azure OpenAI: Responses or Chat Completions

OpenAI-compatible endpoints offer two APIs: the newer Responses API and the older Chat Completions API. Bytebase picks one from the last path segment of API Endpoint: Query parameters such as ?api-version=… don’t affect the choice. The rule applies to every OpenAI or Azure OpenAI endpoint, including a gateway: to use the Responses API through a gateway, its URL must also end in /responses.
  • Use a /responses endpoint for GPT-5 and newer models. Some of them, especially on Azure, accept only the Responses API.
  • Use /chat/completions for older models such as gpt-4o, or for a gateway or self-hosted server that implements only Chat Completions.
Responses API support requires Bytebase 3.22.1 or later. Earlier versions call the Chat Completions API for every endpoint.

Azure OpenAI

AI Assistant settings with Azure OpenAI selected and the API Endpoint set to the v1 responses path
  • Endpoint. Use the v1 path, which needs no api-version: https://{resource name}.openai.azure.com/openai/v1/responses (or /openai/v1/chat/completions for older models). Dated paths with an api-version query parameter also work, for example https://{resource name}.openai.azure.com/openai/deployments/{deployment name}/chat/completions?api-version=2024-10-21 or https://{resource name}.openai.azure.com/openai/responses?api-version=2025-04-01-preview.
  • Model. Azure routes requests by deployment name, and Bytebase sends the model value as the deployment name. If your deployment has the same name as a listed model, pick it from Model; Bytebase keeps your resource host and switches the endpoint path to match the model. Otherwise, choose Custom model and enter your Deployment Name.
  • API Key. One of the keys from your Azure OpenAI resource. Bytebase sends it in the api-key header.

Connect to a custom endpoint

Every provider’s endpoint can point at a custom URL instead of the vendor’s hosted API — a private deployment, a self-hosted model, or an LLM gateway. Bytebase sends the selected provider’s native request format to whatever URL you set, so the endpoint must implement that provider’s API. To connect to one, select the matching AI Provider, choose Custom model, then set API Endpoint to your service’s URL and fill in the API Key and Model Name it expects. Follow the URL shape of the provider defaults above: OpenAI, Azure OpenAI, and Claude use the full request URL; Gemini uses the v1beta base URL. Pick the provider by the API your endpoint speaks. Most self-hosted models and gateways expose an OpenAI-compatible API, so OpenAI is the common choice; end the URL in /responses or /chat/completions to match the API the endpoint implements (see Responses or Chat Completions). Select Gemini or Claude if your endpoint implements Google’s or Anthropic’s API instead.

Tutorial: Self-host Llama3 for Bytebase AI Assistant

What Bytebase sends to the AI provider

Bytebase sends data to the configured provider only when an AI feature runs. What it sends depends on the feature: The Page Agent calls Bytebase APIs with your permissions, so it sees only what you can see, and query results are subject to data masking. It asks for your confirmation before it runs a query or calls any API that changes data. You can check the code: SQL Editor AI Assistant builds its prompt in prompt.ts, and the Page Agent lives in modules/agent.

Troubleshooting

Azure OpenAI: 400 The requested operation is unsupported

The deployment’s model accepts only the Responses API, but API Endpoint points at Chat Completions. Change it to https://{resource name}.openai.azure.com/openai/v1/responses. This requires Bytebase 3.22.1 or later.

Unsupported parameter: 'messages'

Bytebase sent a Chat Completions request to a /responses endpoint. Versions before 3.22.1 call Chat Completions for every endpoint; upgrade to 3.22.1 or later.

Features