Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

Allow usage of openai compatible apis

Creative-Geekc8edcd3dadb8
diff --git a/apps/client/src/pages/dashboard/settings/_sections/openai.tsx b/apps/client/src/pages/dashboard/settings/_sections/openai.tsx
index ce3aa578c..82b46a871 100644
--- a/apps/client/src/pages/dashboard/settings/_sections/openai.tsx
+++ b/apps/client/src/pages/dashboard/settings/_sections/openai.tsx
@@ -22,12 +22,12 @@ const formSchema = z.object({
apiKey: z
.string()
// eslint-disable-next-line lingui/no-unlocalized-strings
- .regex(/^sk-.+$/, "That doesn't look like a valid OpenAI API key.")
+ .min(1, "API key cannot be empty.") //allow api keys like hf-.. and gsk_..
.default(""),
baseURL: z
.string()
// eslint-disable-next-line lingui/no-unlocalized-strings
- .regex(/^https?:\/\/[^/]+\/?$/, "That doesn't look like a valid URL")
+ .regex(/^https?:\/\/[^\s]+$/, "That doesn't look like a valid URL") //allow different openai compatible endpoints like https://api.groq.com/openai/v1 and https://api-inference.huggingface.co/v1/
.or(z.literal(""))
.default(""),
model: z.string().default(DEFAULT_MODEL),