mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
resolved bug with doing a raw call to anthropic compatible apis (#21336)
This commit is contained in:
@@ -313,8 +313,14 @@ async function requestAnthropicVerification(params: {
|
||||
apiKey: string;
|
||||
modelId: string;
|
||||
}): Promise<VerificationResult> {
|
||||
// Use a base URL with /v1 injected for this raw fetch only. The rest of the app uses the
|
||||
// Anthropic client, which appends /v1 itself; config should store the base URL
|
||||
// without /v1 to avoid /v1/v1/messages at runtime. See docs/gateway/configuration-reference.md.
|
||||
const baseUrlForRequest = /\/v1\/?$/.test(params.baseUrl.trim())
|
||||
? params.baseUrl.trim()
|
||||
: params.baseUrl.trim().replace(/\/?$/, "") + "/v1";
|
||||
const endpoint = resolveVerificationEndpoint({
|
||||
baseUrl: params.baseUrl,
|
||||
baseUrl: baseUrlForRequest,
|
||||
modelId: params.modelId,
|
||||
endpointPath: "messages",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user