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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.8.4"
".": "5.9.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 111
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a473967d1766dc155994d932fbc4a5bcbd1c140a37c20d0a4065e1bf0640536d.yml
openapi_spec_hash: 67cdc62b0d6c8b1de29b7dc54b265749
config_hash: 7b53f96f897ca1b3407a5341a6f820db
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2d116cda53321baa3479e628512def723207a81eb1cdaebb542bd0555e563bda.yml
openapi_spec_hash: 809d958fec261a32004a4b026b718793
config_hash: e74d6791681e3af1b548748ff47a22c2
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 5.9.0 (2025-07-10)

Full Changelog: [v5.8.4...v5.9.0](https://github.com/openai/openai-node/compare/v5.8.4...v5.9.0)

### Features

* **api:** add file_url, fix event ID ([5f5d39e](https://github.com/openai/openai-node/commit/5f5d39e9e11224bf18a0301041b69548727ed4f3))

## 5.8.4 (2025-07-10)

Full Changelog: [v5.8.3...v5.8.4](https://github.com/openai/openai-node/compare/v5.8.3...v5.8.4)
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
"version": "5.8.4",
"version": "5.9.0",
"exports": {
".": "./index.ts",
"./helpers/zod": "./helpers/zod.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "5.8.4",
"version": "5.9.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/resources/audio/transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export namespace Transcription {
/**
* Duration of the input audio in seconds.
*/
duration: number;
seconds: number;

/**
* The type of the usage object. Always `duration` for this variant.
Expand Down Expand Up @@ -416,7 +416,7 @@ export namespace TranscriptionVerbose {
/**
* Duration of the input audio in seconds.
*/
duration: number;
seconds: number;

/**
* The type of the usage object. Always `duration` for this variant.
Expand Down
69 changes: 69 additions & 0 deletions src/resources/beta/realtime/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,82 @@ export interface ConversationItemInputAudioTranscriptionCompletedEvent {
*/
type: 'conversation.item.input_audio_transcription.completed';

/**
* Usage statistics for the transcription.
*/
usage:
| ConversationItemInputAudioTranscriptionCompletedEvent.TranscriptTextUsageTokens
| ConversationItemInputAudioTranscriptionCompletedEvent.TranscriptTextUsageDuration;

/**
* The log probabilities of the transcription.
*/
logprobs?: Array<ConversationItemInputAudioTranscriptionCompletedEvent.Logprob> | null;
}

export namespace ConversationItemInputAudioTranscriptionCompletedEvent {
/**
* Usage statistics for models billed by token usage.
*/
export interface TranscriptTextUsageTokens {
/**
* Number of input tokens billed for this request.
*/
input_tokens: number;

/**
* Number of output tokens generated.
*/
output_tokens: number;

/**
* Total number of tokens used (input + output).
*/
total_tokens: number;

/**
* The type of the usage object. Always `tokens` for this variant.
*/
type: 'tokens';

/**
* Details about the input tokens billed for this request.
*/
input_token_details?: TranscriptTextUsageTokens.InputTokenDetails;
}

export namespace TranscriptTextUsageTokens {
/**
* Details about the input tokens billed for this request.
*/
export interface InputTokenDetails {
/**
* Number of audio tokens billed for this request.
*/
audio_tokens?: number;

/**
* Number of text tokens billed for this request.
*/
text_tokens?: number;
}
}

/**
* Usage statistics for models billed by audio input duration.
*/
export interface TranscriptTextUsageDuration {
/**
* Duration of the input audio in seconds.
*/
seconds: number;

/**
* The type of the usage object. Always `duration` for this variant.
*/
type: 'duration';
}

/**
* A log probability object.
*/
Expand Down
7 changes: 4 additions & 3 deletions src/resources/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export interface FileObject {

/**
* The intended purpose of the file. Supported values are `assistants`,
* `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`
* and `vision`.
* `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
* `vision`, and `user_data`.
*/
purpose:
| 'assistants'
Expand All @@ -154,7 +154,8 @@ export interface FileObject {
| 'batch_output'
| 'fine-tune'
| 'fine-tune-results'
| 'vision';
| 'vision'
| 'user_data';

/**
* @deprecated Deprecated. The current status of the file, which can be either
Expand Down
22 changes: 16 additions & 6 deletions src/resources/responses/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,11 @@ export interface ResponseInputFile {
*/
file_id?: string | null;

/**
* The URL of the file to be sent to the model.
*/
file_url?: string;

/**
* The name of the file to be sent to the model.
*/
Expand Down Expand Up @@ -2864,9 +2869,9 @@ export interface ResponseMcpCallArgumentsDeltaEvent {
sequence_number: number;

/**
* The type of the event. Always 'response.mcp_call.arguments_delta'.
* The type of the event. Always 'response.mcp_call_arguments.delta'.
*/
type: 'response.mcp_call.arguments_delta';
type: 'response.mcp_call_arguments.delta';
}

/**
Expand Down Expand Up @@ -2894,9 +2899,9 @@ export interface ResponseMcpCallArgumentsDoneEvent {
sequence_number: number;

/**
* The type of the event. Always 'response.mcp_call.arguments_done'.
* The type of the event. Always 'response.mcp_call_arguments.done'.
*/
type: 'response.mcp_call.arguments_done';
type: 'response.mcp_call_arguments.done';
}

/**
Expand Down Expand Up @@ -3554,9 +3559,9 @@ export interface ResponseOutputTextAnnotationAddedEvent {
sequence_number: number;

/**
* The type of the event. Always 'response.output_text_annotation.added'.
* The type of the event. Always 'response.output_text.annotation.added'.
*/
type: 'response.output_text_annotation.added';
type: 'response.output_text.annotation.added';
}

/**
Expand Down Expand Up @@ -4375,6 +4380,11 @@ export namespace Tool {
* Specify which of the MCP server's tools require approval.
*/
require_approval?: Mcp.McpToolApprovalFilter | 'always' | 'never' | null;

/**
* Optional description of the MCP server, used to provide more context.
*/
server_description?: string;
}

export namespace Mcp {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '5.8.4'; // x-release-please-version
export const VERSION = '5.9.0'; // x-release-please-version
Loading