From 4d4f368ab0d7a7f31d1efcad7aff489980136508 Mon Sep 17 00:00:00 2001 From: Karataev Pavel Date: Mon, 22 Jun 2026 22:46:38 +0300 Subject: [PATCH] fix file upload endpoint --- src/client/endpoints.ts | 2 +- test/client/endpoints.test.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/endpoints.ts b/src/client/endpoints.ts index 6d44c70..0705729 100644 --- a/src/client/endpoints.ts +++ b/src/client/endpoints.ts @@ -43,7 +43,7 @@ export function quotaEndpoint(baseUrl: string): string { } export function fileUploadEndpoint(baseUrl: string): string { - return `${baseUrl}/v1/files`; + return `${baseUrl}/v1/files/upload`; } export function fileListEndpoint(baseUrl: string): string { diff --git a/test/client/endpoints.test.ts b/test/client/endpoints.test.ts index 9976cb2..2c12e37 100644 --- a/test/client/endpoints.test.ts +++ b/test/client/endpoints.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'bun:test'; -import { quotaEndpoint } from '../../src/client/endpoints'; +import { fileUploadEndpoint, quotaEndpoint } from '../../src/client/endpoints'; describe('quotaEndpoint', () => { it('uses token_plan/remains for global', () => { @@ -14,3 +14,9 @@ describe('quotaEndpoint', () => { expect(quotaEndpoint('https://gateway.example.com')).toBe('https://gateway.example.com/v1/token_plan/remains'); }); }); + +describe('fileUploadEndpoint', () => { + it('uses the documented file upload path', () => { + expect(fileUploadEndpoint('https://api.minimax.io')).toBe('https://api.minimax.io/v1/files/upload'); + }); +});