diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9721abd6f..09242e06f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.8.4" + ".": "5.9.0" } diff --git a/.stats.yml b/.stats.yml index 535155f4a..816f05df5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ea7bf52..7bffa2bfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/jsr.json b/jsr.json index 20dc50bb8..da53f0b43 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "5.8.4", + "version": "5.9.0", "exports": { ".": "./index.ts", "./helpers/zod": "./helpers/zod.ts", diff --git a/package.json b/package.json index bd2058b08..7f13e8196 100644 --- a/package.json +++ b/package.json @@ -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 ", "types": "dist/index.d.ts", diff --git a/src/resources/audio/transcriptions.ts b/src/resources/audio/transcriptions.ts index 1a3e22af7..6fbbf8c3a 100644 --- a/src/resources/audio/transcriptions.ts +++ b/src/resources/audio/transcriptions.ts @@ -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. @@ -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. diff --git a/src/resources/beta/realtime/realtime.ts b/src/resources/beta/realtime/realtime.ts index c7e7712ec..b2a0397f0 100644 --- a/src/resources/beta/realtime/realtime.ts +++ b/src/resources/beta/realtime/realtime.ts @@ -309,6 +309,13 @@ 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. */ @@ -316,6 +323,68 @@ export interface ConversationItemInputAudioTranscriptionCompletedEvent { } 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. */ diff --git a/src/resources/files.ts b/src/resources/files.ts index e0b66b77a..3db009f20 100644 --- a/src/resources/files.ts +++ b/src/resources/files.ts @@ -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' @@ -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 diff --git a/src/resources/responses/responses.ts b/src/resources/responses/responses.ts index adf2aafb1..d7bfbf8cf 100644 --- a/src/resources/responses/responses.ts +++ b/src/resources/responses/responses.ts @@ -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. */ @@ -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'; } /** @@ -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'; } /** @@ -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'; } /** @@ -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 { diff --git a/src/version.ts b/src/version.ts index 1d7e6fe66..33ac81765 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.8.4'; // x-release-please-version +export const VERSION = '5.9.0'; // x-release-please-version