Private
Public Access
1
0

Updated openai base url

Some providers don't expect `/v1/chat/completions` but instead
`/v1/openai/chat/completions`
This commit is contained in:
2025-07-28 23:45:08 +00:00
parent 3cd897d494
commit 54da088dee
2 changed files with 2 additions and 2 deletions

View File

@@ -225,7 +225,7 @@ func (c *Context) GetModelProvider(model string, provider string) (*ModelConfig,
} }
return c.fillModelConfig(cfg, m), nil return c.fillModelConfig(cfg, m), nil
case "openai": case "openai":
url := "https://api.openai.com" url := "https://api.openai.com/v1"
if p.BaseURL != "" { if p.BaseURL != "" {
url = p.BaseURL url = p.BaseURL
} }

View File

@@ -194,7 +194,7 @@ func (c *OpenAIClient) sendRequest(ctx context.Context, r ChatCompletionRequest)
return nil, err return nil, err
} }
req, err := http.NewRequestWithContext(ctx, "POST", c.BaseURL+"/v1/chat/completions", bytes.NewBuffer(jsonData)) req, err := http.NewRequestWithContext(ctx, "POST", c.BaseURL+"/chat/completions", bytes.NewBuffer(jsonData))
if err != nil { if err != nil {
return nil, err return nil, err
} }