Bring Your Own AI Endpoint & Model

AI SQL Tuner Studio Bring Your Own AI Endpoint architecture: the Windows desktop app first checks the license with the AI SQL Tuner licensing service (EMS), sending only a token, then sends the analysis over HTTPS with your API key straight to your own Microsoft Foundry or Azure OpenAI resource. Deployment names starting with claude- (claude-opus-5-5, claude-sonnet-4-6) use the Anthropic Messages API; any other name (gpt-5.6-luna, gpt-6-sol, gpt-6.1-sol or your own) uses the Azure OpenAI Responses API.

This guide explains how to connect AI SQL Tuner Studio to your own Microsoft Foundry or Azure OpenAI resource, so your analyses run on models in your own Azure subscription instead of AI SQL Tuner’s hosted models.

Bring your own AI endpoint (BYO AI) is available on the Pro, Team and Enterprise editions. When it is on:

  • AI SQL Tuner’s licensing service (EMS) checks your license before each analysis. It receives only your license token, never your API key, your prompt or your SQL Server diagnostics.
  • Studio sends the analysis straight from your PC to your endpoint.
  • Analyses do not count against your monthly quota. Your Azure subscription pays for the model.

Studio supports two APIs and picks one from the deployment name:

  • Azure OpenAI Responses API for GPT-family deployments such as gpt-5.6-luna, gpt-6-sol and gpt-6.1-sol
  • Anthropic Messages API on Microsoft Foundry for Claude deployments such as claude-opus-5-5, used whenever the name starts with claude-

Version note: Naming your own deployment in Primary model requires AI SQL Tuner Studio 3.0.7 or later. On 3.0.6 or earlier, see section 2.4.

Bring Your Own AI Endpoint architecture: AI SQL Tuner Studio checks the license with the AI SQL Tuner licensing service (EMS), sending only a token, then sends the analysis with your API key straight to your own Microsoft Foundry or Azure OpenAI resource. Deployment names starting with claude- use the Anthropic Messages API; any other name uses the Azure OpenAI Responses API.
Bring Your Own AI Endpoint & Model 3

1) Prerequisites

  • An active Pro, Team or Enterprise license in AI SQL Tuner Studio (Help → Manage license…). See compare AI SQL Tuner Studio editions.
  • A Microsoft Foundry or Azure OpenAI resource in your Azure subscription
  • A model deployment on that resource
  • The resource’s endpoint URL and an API key

1.1) Create a Microsoft Foundry resource

Microsoft Foundry (formerly Azure AI Foundry) is where you create resources and projects and deploy models. Learn more about Microsoft Foundry.

  1. Open Microsoft Foundry: https://ai.azure.com/
  2. Create a Foundry resource and a Foundry project, or select existing ones.
  3. In your project, find the details you’ll enter in AI SQL Tuner Studio:
    • Endpoint URL
    • API key

Notes:

  • Use the root endpoint only, for example https://your-resource.cognitiveservices.azure.com/. Do not append /openai, /models, /anthropic/v1/messages or any other path.
  • End the endpoint with /.

1.1.1) Alternative: Create an Azure OpenAI resource (Azure Portal)

  1. In the Azure Portal, search for Azure OpenAI and choose Create.
  2. Select your subscription, resource group, region and name (the name becomes part of the endpoint host).
  3. Create the resource.
  4. Open the resource:
    • Copy the Endpoint, which looks like https://<resource>.cognitiveservices.azure.com/.
    • Go to Keys and Endpoint and copy Key 1 or Key 2.

An Azure OpenAI resource serves GPT-family models only. For Claude, use a Microsoft Foundry resource.

1.2) Deploy a model

  1. Open Microsoft Foundry: https://ai.azure.com/
  2. Select your Foundry project.
  3. Go to the project’s models and deployments.
  4. Select Deploy model and choose a model available in your region.
  5. Note the deployment name. Examples:
    • GPT: gpt-5.6-luna, gpt-6-sol, gpt-6.1-sol, or a name of your own such as sqltuner-gpt
    • Claude: claude-opus-5-5, claude-sonnet-4-6
  6. Create the deployment.

You’ll enter the deployment name in the Primary model field in Studio. A Claude deployment must keep a name that starts with claude-; under any other name, Studio calls it through the Azure OpenAI API and the call fails.

Not sure which model to deploy? See section 4.

2) Configure your AI endpoint in AI SQL Tuner Studio

  1. Launch AI SQL Tuner Studio and make sure your license is activated.
  2. In the left panel, expand AI Configuration.
  3. In Primary model, enter your deployment name, for example gpt-6-sol or claude-opus-5-5.
  4. Check Use my own AI endpoint (uncapped). It appears only for Pro, Team and Enterprise licenses.
  5. Fill in:
    • BYO endpoint: your resource’s root URL, for example https://your-resource.cognitiveservices.azure.com/
    • API key: your key
  6. Optionally check Save key to keep the key for future sessions. Otherwise Studio keeps it only until you close the app.
  7. Click Save AI settings.
  8. Check the status bar at the bottom of the window: it shows the deployment name the next analysis will use.

Settings are saved to %LOCALAPPDATA%\AISQLTuner\AISQLTunerStudio\settings.json. The API key is saved there only if you tick Save key.

2.1) What happens when you click Run Analysis

  1. You approve the run plan, which lists everything Studio will collect from your server.
  2. Studio asks EMS whether your license is active and above Free. Only your license token is sent.
  3. Studio sends the prompt and the SQL Server diagnostics from your PC to your endpoint over HTTPS, with your API key.
  4. The report appears in the Report panel when the model finishes. BYO runs don’t stream the report as it is written. The report footer names the model that answered.

Nothing from a BYO analysis is stored by AI SQL Tuner, and the Keep my analyses setting doesn’t apply.

2.2) Which deployment Studio calls

  • If Primary model is filled in, Studio calls that deployment.
  • If it is empty, Studio calls a deployment named after the model selected in the MODEL dropdown: gpt-5.6-luna, or gpt-6-sol on Team and Enterprise.
  • The REASONING dropdown (Low, Medium, High) applies to BYO runs as well.
  • There is no fallback deployment. If your deployment is rate-limited or at capacity, the analysis fails with your endpoint’s error.
  • Requests above 600,000 characters are blocked with a Request too large dialog, the same as on the hosted service.

2.3) Running an analysis with your endpoint

  1. Select a SQL Server connection in Connections.
  2. Select a Tuning Goal: Server Health Check, Fix Deadlocks, Code Review, Index Tuning, Query Tuner or Locking and Blocking Analysis.
  3. Click Run Analysis.
  4. Follow progress in the console drawer. The HTML report appears in the Report panel when it is complete.

2.4) Using AI SQL Tuner Studio 3.0.6 or earlier

In 3.0.6 and earlier, BYO runs ignore the Primary model field and always call a deployment named after the model selected in the MODEL dropdown. On those versions:

  • Name your deployment exactly gpt-5.6-luna, or gpt-6-sol on Team and Enterprise.
  • Claude deployments, and GPT deployments with names of your own, need 3.0.7 or later.

3) API behavior by provider

3.1) Azure OpenAI: Responses API

Studio uses the Azure OpenAI Responses API for every deployment whose name doesn’t start with claude-.

  • Studio calls the endpoint exactly as you entered it.
  • Use a deployment that supports the Responses API. Current GPT models do.
  • The REASONING setting is sent as the model’s reasoning effort.
  • Don’t paste a REST route such as /openai/responses into the endpoint field.

3.2) Anthropic Claude: Messages API on Microsoft Foundry

For a deployment whose name starts with claude-, Studio calls the native Anthropic Messages API hosted on Microsoft Foundry.

  • Studio changes a …cognitiveservices.azure.com endpoint to the matching …services.ai.azure.com host, so either form works in the endpoint field.
  • It calls POST /anthropic/v1/messages with Authorization: Bearer <key> and anthropic-version: 2023-06-01.
  • For Claude Opus and Sonnet 4.6 and later, including claude-opus-5-5, Studio turns on adaptive thinking at the REASONING setting you choose.
  • Keep the endpoint field set to the root URL. Don’t append /models or /anthropic/v1/messages.

4) Which model should I deploy?

Any model that supports the Azure OpenAI Responses API or the Anthropic Messages API works. These are the ones we test. The notes come from our AI SQL tuning benchmark, which applies each model’s advice to real Index Tuning, Query Tuner and Code Review workloads and measures the result.

Deployment API Notes
gpt-5.6-luna Azure OpenAI Our default for every edition. Ranked first on Code Review and close to the leader elsewhere, with no wrong results. The lowest cost of the models here.
gpt-6-sol Azure OpenAI Strongest on Index Tuning and Query Tuner, and answers in about a minute. Use Medium or High reasoning, not Low.
gpt-6.1-sol Azure OpenAI Level with gpt-6-sol on results, but about 1.5 to 2 times slower.
claude-opus-5-5 Anthropic For teams that standardize on Anthropic. Improvements in the same range as the GPT models and no wrong results, but answers take about three to four times longer.
claude-sonnet-4-6 Anthropic Supported. Not in our current benchmark.

Your choice also depends on what your organization has approved and which models are available in your region.

5) Common configuration problems

The “Use my own AI endpoint” checkbox is missing

  • It appears only for Pro, Team and Enterprise licenses. Activate your license with Help → Manage license….

“BYO AI is available for Pro, Team, and Enterprise editions only”

  • EMS didn’t confirm a paid license. Re-activate your license key or check your subscription.

“License check failed. Re-activate your license and try again.”

  • Studio couldn’t get a valid license token from EMS. Check your network connection, then re-activate your license.

The endpoint looks correct but the call fails

  • Use the resource root endpoint, not a portal URL.
  • Don’t append /openai, /models or /anthropic/v1/messages.
  • Check that a deployment with the exact name in Primary model exists on that resource, and that the key belongs to the same resource.
  • For GPT deployments, check that the model supports the Responses API.

“The BYO Anthropic endpoint returned an error.”

  • Check that the deployment name starts with claude- and matches your Foundry deployment exactly.
  • Use a Microsoft Foundry resource. An Azure OpenAI resource can’t host Claude models.

The status bar shows a different model than you expected

  • Click Save AI settings after changing Primary model or the BYO checkbox.
  • On 3.0.6 or earlier, Primary model is ignored; see section 2.4.

Rate limit or capacity errors

  • Studio doesn’t fall back to another deployment. Wait and run again, lower the REASONING level, or raise the deployment’s quota in Microsoft Foundry.

Request too large

  • Studio shows a dialog when a request is over 600,000 characters. Reduce the scope of the analysis, for example fewer objects for Code Review.

6) Quick checklist

  • License is Pro, Team or Enterprise and activated
  • Deployment name entered in Primary model (Claude names start with claude-)
  • Use my own AI endpoint (uncapped) checked
  • Endpoint set to the resource root, such as https://...cognitiveservices.azure.com/
  • API key entered
  • Clicked Save AI settings
  • Status bar shows your deployment name

7) Examples

7.1) Use a GPT deployment

  1. Deploy gpt-6-sol (or another GPT model) on your Foundry or Azure OpenAI resource.
  2. In AI Configuration, set Primary model to the deployment name, for example gpt-6-sol, or a name of your own such as sqltuner-gpt.
  3. Check Use my own AI endpoint (uncapped) and enter your endpoint and key.
  4. Click Save AI settings.
  5. Select Medium reasoning, a connection and a tuning goal, then click Run Analysis.

7.2) Use Claude on Microsoft Foundry

  1. Deploy claude-opus-5-5 on a Microsoft Foundry resource.
  2. In AI Configuration, set Primary model to claude-opus-5-5.
  3. Check Use my own AI endpoint (uncapped).
  4. Set BYO endpoint to your resource root, for example https://your-resource.cognitiveservices.azure.com/ or https://your-resource.services.ai.azure.com/.
  5. Set API key to the resource’s key.
  6. Click Save AI settings and run an analysis.

If you need support, please include:

  • Your edition and AI SQL Tuner Studio version
  • The deployment name you used (shown in the status bar and the report footer)
  • The exact error message

Frequently Asked Questions

What is a BYO AI endpoint and why would I use one?

By default, AI SQL Tuner Studio sends analyses to AI SQL Tuner’s hosted models on Microsoft Foundry. On the Pro, Team and Enterprise editions you can instead connect your own Microsoft Foundry or Azure OpenAI resource. You then control which model runs, where it runs and how it is billed, and your analyses don’t count against your monthly quota. This suits organizations with strict compliance, data-residency or procurement requirements.

Which AI models can I use with my own endpoint?

Any GPT-family deployment that supports the Azure OpenAI Responses API, such as gpt-5.6-luna, gpt-6-sol and gpt-6.1-sol, and Claude models on Microsoft Foundry, such as claude-opus-5-5 and claude-sonnet-4-6. Studio uses the Anthropic Messages API when the deployment name starts with claude-, and the Azure OpenAI Responses API otherwise. Entering your own deployment name requires AI SQL Tuner Studio 3.0.7 or later.

Which editions include bring your own AI endpoint?

Pro, Team and Enterprise. The Free edition uses AI SQL Tuner’s hosted models only. Studio checks your license with the AI SQL Tuner licensing service before each BYO analysis.

Do analyses on my own endpoint count against my monthly quota?

No. The licensing service only confirms that your license is active; it doesn’t count the analysis. The model cost is billed to your Azure subscription.

How do I find my Azure OpenAI or Foundry endpoint URL?

For an Azure OpenAI resource, open it in the Azure Portal, go to Keys and Endpoint, and copy the URL. It looks like https://<your-resource>.cognitiveservices.azure.com/. For a Microsoft Foundry project, open https://ai.azure.com/, select your project and find the endpoint details. Always use the root endpoint, ending with /. Don’t append /openai, /models or /anthropic/v1/messages.

What should I do if my AI endpoint connection fails?

Check that your license is Pro, Team or Enterprise and activated, that the endpoint is the resource root ending with /, that the API key belongs to that resource, and that a deployment with the exact name in Primary model exists. Claude deployment names must start with claude-. Section 5 of this guide lists the common errors and their fixes.

Is my data secure when using my own AI endpoint?

Your API key, prompts and SQL Server diagnostics go only from your PC to your own Azure resource. AI SQL Tuner’s licensing service receives only your license token, and nothing from a BYO analysis is stored by AI SQL Tuner. Studio sends diagnostic metadata such as query text, execution plans, index statistics and configuration; it never sends table data, query results or passwords. You can restrict your resource further with private endpoints, network rules and role-based access control.

What’s the difference between using Azure OpenAI and Anthropic Claude in AI SQL Tuner Studio?

GPT-family deployments are called through the Azure OpenAI Responses API, and the REASONING setting is sent as reasoning effort. Claude deployments on Microsoft Foundry are called through the native Anthropic Messages API, with adaptive thinking at the REASONING setting for Opus and Sonnet 4.6 and later. Both run in your Azure subscription. In our benchmark, GPT-5.6 Luna and GPT-6 Sol answered fastest; Claude Opus 5.5 gave improvements in the same range but took about three to four times longer.

Why does AI SQL Tuner need the root endpoint instead of /anthropic/v1/messages?

Studio builds the full API route itself. For Claude, it changes a cognitiveservices.azure.com endpoint to the matching services.ai.azure.com host and calls /anthropic/v1/messages with the Authorization: Bearer and anthropic-version headers. A full route pasted into the endpoint field would break that.