Skip to content

Commit 848c166

Browse files
fix: send correct Accept header for certain endpoints (#26)
1 parent e830080 commit 848c166

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/resources/audio/audio.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ export class Audio extends APIResource {
1616
* Generates audio from the input text.
1717
*/
1818
speech(body: AudioSpeechParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
19-
return this._client.post('/audio/speech', { body, ...options, __binaryResponse: true });
19+
return this._client.post('/audio/speech', {
20+
body,
21+
...options,
22+
headers: { Accept: 'application/octet-stream', ...options?.headers },
23+
__binaryResponse: true,
24+
});
2025
}
2126
}
2227

src/resources/files/content.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ export class Content extends APIResource {
88
* Returns the contents of the specified file.
99
*/
1010
retrieve(fileId: string, options?: Core.RequestOptions): Core.APIPromise<string> {
11-
return this._client.get(`/files/${fileId}/content`, {
12-
...options,
13-
headers: { Accept: 'application/json', ...options?.headers },
14-
});
11+
return this._client.get(`/files/${fileId}/content`, options);
1512
}
1613
}
1714

0 commit comments

Comments
 (0)