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
90 changes: 90 additions & 0 deletions .github/workflows/detect-breaking-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI
on:
pull_request:
branches:
- main
- next

jobs:
detect_breaking_changes:
runs-on: 'ubuntu-latest'
name: detect-breaking-changes
if: github.repository == 'openai/openai-node'
steps:
- name: Calculate fetch-depth
run: |
echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
# Ensure we can check out the pull request base in the script below.
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: |
yarn install

- name: Detect breaking changes
run: |
# Try to check out previous versions of the breaking change detection script. This ensures that
# we still detect breaking changes when entire files and their tests are removed.
git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}
agents_sdk:
runs-on: 'ubuntu-latest'
name: Detect Agents SDK regressions
if: github.repository == 'openai/openai-node'
steps:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.25.0
run_install: false

# Setup this sdk
- uses: actions/checkout@v4
with:
path: openai-node

- name: Bootstrap
working-directory: openai-node
run: ./scripts/bootstrap

- name: Build
working-directory: openai-node
run: ./scripts/build

# Setup the agents packages
- uses: actions/checkout@v4
with:
repository: openai/openai-agents-js
path: openai-agents-js

- name: Link agents packages to local SDKs
working-directory: openai-agents-js
run: pnpm --filter @openai/agents-core --filter @openai/agents-openai --filter @openai/agents add file:../../../openai-node/dist

- name: Install dependencies
working-directory: openai-agents-js
run: pnpm install

- name: Build all packages
working-directory: openai-agents-js
run: pnpm build

- name: Run linter
working-directory: openai-agents-js
run: pnpm lint

- name: Type-check docs scripts
working-directory: openai-agents-js
run: pnpm docs:scripts:check
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "6.15.0"
".": "6.16.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: 136
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-75926226b642ebb2cb415694da9dff35e8ab40145ac1b791cefb82a83809db4d.yml
openapi_spec_hash: 6a0e391b0ba5747b6b4a3e5fe21de4da
config_hash: adcf23ecf5f84d3cadf1d71e82ec636a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9442fa9212dd61aac2bb0edd19744bee381e75888712f9098bc6ebb92c52b557.yml
openapi_spec_hash: f87823d164b7a8f72a42eba04e482a99
config_hash: ad7136f7366fddec432ec378939e58a7
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 6.16.0 (2026-01-09)

Full Changelog: [v6.15.0...v6.16.0](https://github.com/openai/openai-node/compare/v6.15.0...v6.16.0)

### Features

* **api:** add new Response completed_at prop ([ca40534](https://github.com/openai/openai-node/commit/ca40534778311def52bc7dbbab043d925cdaf847))
* **ci:** add breaking change detection workflow ([a6f3dea](https://github.com/openai/openai-node/commit/a6f3deaf89ea0ef85cc57e1150032bb6b807c3b9))


### Chores

* break long lines in snippets into multiline ([80dee2f](https://github.com/openai/openai-node/commit/80dee2fe64d1b13f181bd482b31eb06fd6c5f3f4))
* **internal:** codegen related update ([b2fac3e](https://github.com/openai/openai-node/commit/b2fac3ecdc3aecc3303c26304c4c94deda061edb))

## 6.15.0 (2025-12-19)

Full Changelog: [v6.14.0...v6.15.0](https://github.com/openai/openai-node/compare/v6.14.0...v6.15.0)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 OpenAI
Copyright 2026 OpenAI

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ await client.files.create({ file: fs.createReadStream('input.jsonl'), purpose: '
await client.files.create({ file: new File(['my bytes'], 'input.jsonl'), purpose: 'fine-tune' });

// You can also pass a `fetch` `Response`:
await client.files.create({ file: await fetch('https://somesite/input.jsonl'), purpose: 'fine-tune' });
await client.files.create({
file: await fetch('https://somesite/input.jsonl'),
purpose: 'fine-tune',
});

// Finally, if none of the above are convenient, you can use our `toFile` helper:
await client.files.create({
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": "6.15.0",
"version": "6.16.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": "6.15.0",
"version": "6.16.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
7 changes: 4 additions & 3 deletions src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ export interface SpeechCreateParams {
model: (string & {}) | SpeechModel;

/**
* The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
* `verse`. Previews of the voices are available in the
* The voice to use when generating the audio. Supported built-in voices are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
* `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available
* in the
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
*/
voice:
Expand Down
5 changes: 3 additions & 2 deletions src/resources/chat/completions/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,9 @@ export interface ChatCompletionAudioParam {
format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16';

/**
* The voice the model uses to respond. Supported voices are `alloy`, `ash`,
* `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
* The voice the model uses to respond. Supported built-in voices are `alloy`,
* `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
* `marin`, and `cedar`.
*/
voice:
| (string & {})
Expand Down
3 changes: 2 additions & 1 deletion src/resources/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export class Images extends APIResource {

/**
* Creates an edited or extended image given one or more source images and a
* prompt. This endpoint only supports `gpt-image-1` and `dall-e-2`.
* prompt. This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`,
* and `gpt-image-1-mini`) and `dall-e-2`.
*
* @example
* ```ts
Expand Down
16 changes: 8 additions & 8 deletions src/resources/realtime/realtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1256,10 +1256,10 @@ export interface RealtimeAudioConfigOutput {
speed?: number;

/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
* and `cedar`. We recommend `marin` and `cedar` for best quality.
* The voice the model uses to respond. Supported built-in voices are `alloy`,
* `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
* `cedar`. Voice cannot be changed during the session once the model has responded
* with audio at least once. We recommend `marin` and `cedar` for best quality.
*/
voice?:
| (string & {})
Expand Down Expand Up @@ -2121,10 +2121,10 @@ export namespace RealtimeResponseCreateAudioOutput {
format?: RealtimeAPI.RealtimeAudioFormats;

/**
* The voice the model uses to respond. Voice cannot be changed during the session
* once the model has responded with audio at least once. Current voice options are
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`,
* and `cedar`. We recommend `marin` and `cedar` for best quality.
* The voice the model uses to respond. Supported built-in voices are `alloy`,
* `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and
* `cedar`. Voice cannot be changed during the session once the model has responded
* with audio at least once.
*/
voice?:
| (string & {})
Expand Down
4 changes: 1 addition & 3 deletions src/resources/responses/input-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ export interface InputTokenCountParams {
text?: InputTokenCountParams.Text | null;

/**
* How the model should select which tool (or tools) to use when generating a
* response. See the `tools` parameter to see how to specify which tools the model
* can call.
* Controls which tool the model should use, if any.
*/
tool_choice?:
| ResponsesAPI.ToolChoiceOptions
Expand Down
56 changes: 47 additions & 9 deletions src/resources/responses/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,14 @@ export interface Response {
background?: boolean | null;

/**
* The conversation that this response belongs to. Input items and output items
* from this response are automatically added to this conversation.
* Unix timestamp (in seconds) of when this Response was completed. Only present
* when the status is `completed`.
*/
completed_at?: number | null;

/**
* The conversation that this response belonged to. Input items and output items
* from this response were automatically added to this conversation.
*/
conversation?: Response.Conversation | null;

Expand Down Expand Up @@ -727,12 +733,12 @@ export namespace Response {
}

/**
* The conversation that this response belongs to. Input items and output items
* from this response are automatically added to this conversation.
* The conversation that this response belonged to. Input items and output items
* from this response were automatically added to this conversation.
*/
export interface Conversation {
/**
* The unique ID of the conversation.
* The unique ID of the conversation that this response was associated with.
*/
id: string;
}
Expand Down Expand Up @@ -1159,13 +1165,19 @@ export interface ResponseCompactionItem {
*/
id: string;

/**
* The encrypted content that was produced by compaction.
*/
encrypted_content: string;

/**
* The type of the item. Always `compaction`.
*/
type: 'compaction';

/**
* The identifier of the actor that created the item.
*/
created_by?: string;
}

Expand All @@ -1174,6 +1186,9 @@ export interface ResponseCompactionItem {
* [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).
*/
export interface ResponseCompactionItemParam {
/**
* The encrypted content of the compaction summary.
*/
encrypted_content: string;

/**
Expand Down Expand Up @@ -2172,13 +2187,16 @@ export interface ResponseFunctionCallArgumentsDoneEvent {
}

/**
* A text input to the model.
* A piece of message content, such as text, an image, or a file.
*/
export type ResponseFunctionCallOutputItem =
| ResponseInputTextContent
| ResponseInputImageContent
| ResponseInputFileContent;

/**
* An array of content outputs (text, image, file) for the function tool call.
*/
export type ResponseFunctionCallOutputItemList = Array<ResponseFunctionCallOutputItem>;

/**
Expand Down Expand Up @@ -2285,7 +2303,7 @@ export namespace ResponseFunctionShellToolCall {
}

/**
* The output of a shell tool call.
* The output of a shell tool call that was emitted.
*/
export interface ResponseFunctionShellToolCallOutput {
/**
Expand Down Expand Up @@ -2315,12 +2333,15 @@ export interface ResponseFunctionShellToolCallOutput {
*/
type: 'shell_call_output';

/**
* The identifier of the actor that created the item.
*/
created_by?: string;
}

export namespace ResponseFunctionShellToolCallOutput {
/**
* The content of a shell call output.
* The content of a shell tool call output that was emitted.
*/
export interface Output {
/**
Expand All @@ -2329,10 +2350,19 @@ export namespace ResponseFunctionShellToolCallOutput {
*/
outcome: Output.Timeout | Output.Exit;

/**
* The standard error output that was captured.
*/
stderr: string;

/**
* The standard output that was captured.
*/
stdout: string;

/**
* The identifier of the actor that created the item.
*/
created_by?: string;
}

Expand Down Expand Up @@ -2471,7 +2501,7 @@ export namespace ResponseFunctionWebSearch {
*/
export interface Search {
/**
* The search query.
* [DEPRECATED] The search query.
*/
query: string;

Expand All @@ -2480,6 +2510,11 @@ export namespace ResponseFunctionWebSearch {
*/
type: 'search';

/**
* The search queries.
*/
queries?: Array<string>;

/**
* The sources used in the search.
*/
Expand Down Expand Up @@ -5731,6 +5766,9 @@ export namespace Tool {
*/
file_ids?: Array<string>;

/**
* The memory limit for the code interpreter container.
*/
memory_limit?: '1g' | '4g' | '16g' | '64g' | null;
}
}
Expand Down
Loading