fix(site): add openai-compatible endpoint placeholder (#26017)

OpenAI-compatible provider endpoints need to include the upstream
OpenAI-compatible prefix, typically `/v1`, because Coder appends request
suffixes such as `/chat/completions`, `/responses`, and `/models`. The
generic OpenAI-compatible provider form did not show an example
endpoint, so it was easy to save a host-only URL that looked valid but
would fail when used.

Add `https://provider.example.com/v1` as the Endpoint placeholder for
the OpenAI-compatible provider, matching the documented example URL
shape.
This commit is contained in:
Ethan
2026-06-12 11:51:38 +10:00
committed by GitHub
parent 7632e73608
commit f13c858482
@@ -94,6 +94,10 @@ const providerDefaults: Partial<
vercel: { name: "vercel", baseUrl: "https://ai-gateway.vercel.sh/v1" },
};
const baseUrlPlaceholders: Partial<Record<AIProviderType, string>> = {
"openai-compat": "https://provider.example.com/v1",
};
const makeOpenAiAnthropicSchema = (editing: boolean) =>
Yup.object({
type: Yup.string()
@@ -243,6 +247,7 @@ const apiKeyPlaceholder = (provider: string) => {
};
const baseUrlPlaceholder = (provider: string) =>
baseUrlPlaceholders[provider as keyof typeof baseUrlPlaceholders] ??
providerDefaults[provider as keyof typeof providerDefaults]?.baseUrl;
export const ProviderForm: FC<ProviderFormProps> = ({