Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ export class Speech extends APIResource {
* Generates audio from the input text.
*/
create(body: SpeechCreateParams, options?: Core.RequestOptions): Core.APIPromise<Response> {
return this._client.post('/audio/speech', { body, ...options, __binaryResponse: true });
return this._client.post('/audio/speech', {
body,
...options,
headers: { Accept: 'application/octet-stream', ...options?.headers },
__binaryResponse: true,
});
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/resources/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export class Files extends APIResource {
* Returns the contents of the specified file.
*/
content(fileId: string, options?: Core.RequestOptions): Core.APIPromise<Response> {
return this._client.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true });
return this._client.get(`/files/${fileId}/content`, {
...options,
headers: { Accept: 'application/binary', ...options?.headers },
__binaryResponse: true,
});
}

/**
Expand All @@ -76,10 +80,7 @@ export class Files extends APIResource {
* @deprecated The `.content()` method should be used instead
*/
retrieveContent(fileId: string, options?: Core.RequestOptions): Core.APIPromise<string> {
return this._client.get(`/files/${fileId}/content`, {
...options,
headers: { Accept: 'application/json', ...options?.headers },
});
return this._client.get(`/files/${fileId}/content`, options);
}
}

Expand Down