Files
openclaw/extensions/openai/shared.ts
2026-03-27 23:58:42 +00:00

18 lines
551 B
TypeScript

import { findCatalogTemplate } from "openclaw/plugin-sdk/provider-catalog-shared";
import {
cloneFirstTemplateModel,
matchesExactOrPrefix,
} from "openclaw/plugin-sdk/provider-model-shared";
export const OPENAI_API_BASE_URL = "https://api.openai.com/v1";
export function isOpenAIApiBaseUrl(baseUrl?: string): boolean {
const trimmed = baseUrl?.trim();
if (!trimmed) {
return false;
}
return /^https?:\/\/api\.openai\.com(?:\/v1)?\/?$/i.test(trimmed);
}
export { cloneFirstTemplateModel, findCatalogTemplate, matchesExactOrPrefix };