Skip to content

Commit bd52360

Browse files
authored
Merge pull request #183 from minmax/fix/file-upload-endpoint
fix file upload endpoint
2 parents 8e876a9 + 4d4f368 commit bd52360

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/client/endpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function quotaEndpoint(baseUrl: string): string {
4343
}
4444

4545
export function fileUploadEndpoint(baseUrl: string): string {
46-
return `${baseUrl}/v1/files`;
46+
return `${baseUrl}/v1/files/upload`;
4747
}
4848

4949
export function fileListEndpoint(baseUrl: string): string {

test/client/endpoints.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, it, expect } from 'bun:test';
2-
import { quotaEndpoint } from '../../src/client/endpoints';
2+
import { fileUploadEndpoint, quotaEndpoint } from '../../src/client/endpoints';
33

44
describe('quotaEndpoint', () => {
55
it('uses token_plan/remains for global', () => {
@@ -14,3 +14,9 @@ describe('quotaEndpoint', () => {
1414
expect(quotaEndpoint('https://gateway.example.com')).toBe('https://gateway.example.com/v1/token_plan/remains');
1515
});
1616
});
17+
18+
describe('fileUploadEndpoint', () => {
19+
it('uses the documented file upload path', () => {
20+
expect(fileUploadEndpoint('https://api.minimax.io')).toBe('https://api.minimax.io/v1/files/upload');
21+
});
22+
});

0 commit comments

Comments
 (0)