Custom
Register any OpenAI-compatible endpoint or AI gateway as a Custom LLM provider on SonarQube Server 2026.5.
Use the Custom provider type when you reach your models through an endpoint that exposes an OpenAI-compatible API. That covers a model service's own endpoint, an AI gateway, and a proxy you run yourself.
This page covers how to register a Custom provider so SonarQube Server can reach your endpoint and list its models. For the steps that apply to every provider type, see LLM providers; to select this provider and choose a model for an AI agent, see Selecting a provider and model for an agent.
Supported API
Your API provider must expose two OpenAI-compatible endpoints:
GET /models, so SonarQube Server can list the models your provider servesPOST /chat/completions, so an agent can run against the model you select
SonarQube Server calls GET /models when you add the provider, and POST /chat/completions when you select a model for an agent.
Gateways often expose an OpenAI-compatible API on one path and their own format on another, and some expose it only in certain configurations. Check your provider's documentation for the base URL to use, and for any headers that path requires.
Prerequisites
An endpoint that exposes an OpenAI-compatible API, serving both
GET /modelsandPOST /chat/completions.A credential for that endpoint, usually an API key, unless the endpoint authenticates another way.
Fields
Endpoint
Yes
The base URL, including the version path if your provider uses one. Don't include /models or /chat/completions; SonarQube Server appends those paths.
API key
No
The credential for the endpoint. Leave it empty if your endpoint authenticates another way.
Custom headers
No
Any headers your provider or gateway requires, as name and value pairs. Mark a value as secret to hide it after you save.
Example endpoints
Enter the values your own provider documents. The notes after the table cover the providers that need more than an endpoint and a key.
Portkey
https://api.portkey.ai/v1
API key generated in Portkey
OpenRouter
https://openrouter.ai/api/v1
API key generated in OpenRouter
Azure AI Foundry through APIM, with a header other than api-key
Your APIM base URL. See Fields for the Custom type
Your APIM subscription-key header name and value, marked as secret. Check your own APIM policy for the exact header name
Self-hosted gateway
Your own OpenAI-compatible base URL, for example https://litellm.internal.example.com/v1
API key or a custom header, depending on how you configured the gateway
For a direct connection to Azure AI Foundry, or for an APIM policy that uses the api-key header, use the dedicated Azure AI Foundry type instead; see Azure AI Foundry. To reach OpenAI or Anthropic's own API directly, or AWS Bedrock Mantle, use their dedicated provider types instead; see Choosing a provider type.
Portkey
In Portkey, configure your API key for the specific provider that serves the model you plan to select. A key with no provider configured, or one configured for a different provider, fails when you select a model in SonarQube Server.
Entering the endpoint
Enter the base URL exactly as your provider documents it, including any version path. A self-hosted gateway, for example, might expose https://litellm.internal.example.com/v1. See Example endpoints for the endpoints documented for supported gateways.
Authenticating with a header
If your provider or gateway authenticates through a header rather than a bearer token, leave API key empty in SonarQube Server and add the header under Custom headers. Mark the value as secret so it's hidden after you save.
Entering the model identifier
Naming conventions differ from one provider and gateway to the next, and some gateways let you define your own model names.
Find the model in your provider or gateway's model catalog.
Copy the identifier exactly as your provider or gateway names it.
In SonarQube Server, go to the agent's page under Administration > Configuration > AI capabilities, paste the identifier into the model field, and select Save.
Copy the identifier from your own catalog rather than from another organization's examples.
If adding the provider fails, see Troubleshooting.
Last updated
Was this helpful?

