mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-02 01:20:23 +08:00
When users provide their own API key but not a custom baseURL, the code was incorrectly falling back to the server's environment variable for baseURL. This caused user API keys to be sent to the server's custom proxy endpoint instead of the provider's official endpoint, resulting in 'API key format incorrect' errors. This fix ensures that when a user provides their own API key: - Only the user's baseUrl is used (if provided) - Otherwise, the provider's official/default endpoint is used - Server's baseURL env vars are never mixed with user credentials Affected providers: openai, anthropic, google, azure, openrouter, deepseek, siliconflow, sglang, gateway, doubao, modelscope Also fixes Azure's resourceName to not leak server config to user keys. Fixes #577