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 @@
{
".": "6.25.0"
".": "6.26.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: 147
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-6bfe886b5ded0fe3bf37ca672698814e16e0836a093ceef65dac37ae44d1ad6b.yml
openapi_spec_hash: 6b1344a59044318e824c8d1af96033c7
config_hash: 7f49c38fa3abe9b7038ffe62262c4912
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9c802d45a9bf2a896b5fd22ac22bba185e8a145bd40ed242df9bb87a05e954eb.yml
openapi_spec_hash: 97984ed69285e660b7d5c810c69ed449
config_hash: acb0b1eb5d7284bfedaddb29f7f5a691
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 6.26.0 (2026-03-05)

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

### Features

* **api:** gpt-5.4, tool search tool, and new computer tool ([1d1e5a9](https://github.com/openai/openai-node/commit/1d1e5a9b5aeb11b0e940b4532dcd6a3fcc23898a))


### Bug Fixes

* **api:** internal schema fixes ([6b401ad](https://github.com/openai/openai-node/commit/6b401ad7d3ff2ead9cfa577daf8381f62ea85b93))
* **api:** manual updates ([2b54919](https://github.com/openai/openai-node/commit/2b549195c70581022d9d64c443ab08202c6faeb7))
* **api:** readd phase ([4a0cf29](https://github.com/openai/openai-node/commit/4a0cf2974865519d3b512fb377bc4ba305dce7b7))
* **api:** remove phase from message types, prompt_cache_key param in responses ([088fca6](https://github.com/openai/openai-node/commit/088fca6a4d5d1a577500acb5579ee403292d8911))


### Chores

* **internal:** codegen related update ([6a0aa9e](https://github.com/openai/openai-node/commit/6a0aa9e2ff10e78f8b9afd777174d16537a29c8e))
* **internal:** codegen related update ([b2a4299](https://github.com/openai/openai-node/commit/b2a42991cbe83eee45a342f19a5a99ce1d78b36a))
* **internal:** move stringifyQuery implementation to internal function ([f9f4660](https://github.com/openai/openai-node/commit/f9f46609cf5c1fc51e437c23251c5a7d0519d55d))
* **internal:** reduce warnings ([7e19492](https://github.com/openai/openai-node/commit/7e194929156052b0efbda9ca48c3ed6de8c18d2f))

## 6.25.0 (2026-02-24)

Full Changelog: [v6.24.0...v6.25.0](https://github.com/openai/openai-node/compare/v6.24.0...v6.25.0)
Expand Down
1 change: 1 addition & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ client.example.list(undefined, { headers: { ... } });
- `client.fineTuning.jobs.listEvents()`
- `client.fineTuning.jobs.checkpoints.list()`
- `client.fineTuning.checkpoints.permissions.retrieve()`
- `client.fineTuning.checkpoints.permissions.list()`
- `client.vectorStores.list()`
- `client.vectorStores.files.list()`
- `client.beta.chatkit.threads.list()`
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,14 @@ Types:

- <code><a href="./src/resources/fine-tuning/checkpoints/permissions.ts">PermissionCreateResponse</a></code>
- <code><a href="./src/resources/fine-tuning/checkpoints/permissions.ts">PermissionRetrieveResponse</a></code>
- <code><a href="./src/resources/fine-tuning/checkpoints/permissions.ts">PermissionListResponse</a></code>
- <code><a href="./src/resources/fine-tuning/checkpoints/permissions.ts">PermissionDeleteResponse</a></code>

Methods:

- <code title="post /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.fineTuning.checkpoints.permissions.<a href="./src/resources/fine-tuning/checkpoints/permissions.ts">create</a>(fineTunedModelCheckpoint, { ...params }) -> PermissionCreateResponsesPage</code>
- <code title="get /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.fineTuning.checkpoints.permissions.<a href="./src/resources/fine-tuning/checkpoints/permissions.ts">retrieve</a>(fineTunedModelCheckpoint, { ...params }) -> PermissionRetrieveResponse</code>
- <code title="get /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions">client.fineTuning.checkpoints.permissions.<a href="./src/resources/fine-tuning/checkpoints/permissions.ts">list</a>(fineTunedModelCheckpoint, { ...params }) -> PermissionListResponsesPage</code>
- <code title="delete /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}">client.fineTuning.checkpoints.permissions.<a href="./src/resources/fine-tuning/checkpoints/permissions.ts">delete</a>(permissionID, { ...params }) -> PermissionDeleteResponse</code>

## Alpha
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.25.0",
"version": "6.26.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.25.0",
"version": "6.26.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <support@openai.com>",
"types": "dist/index.d.ts",
Expand Down
13 changes: 12 additions & 1 deletion scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version

npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
# Wait for server to come online (max 30s)
echo -n "Waiting for server"
attempts=0
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
attempts=$((attempts + 1))
if [ "$attempts" -ge 300 ]; then
echo
echo "Timed out waiting for Prism server to start"
cat .prism.log
exit 1
fi
echo -n "."
sleep 0.1
done
Expand Down
46 changes: 38 additions & 8 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
import { getPlatformHeaders } from './internal/detect-platform';
import * as Shims from './internal/shims';
import * as Opts from './internal/request-options';
import * as qs from './internal/qs';
import { stringifyQuery } from './internal/utils/query';
import { VERSION } from './version';
import * as Errors from './core/error';
import * as Pagination from './core/pagination';
Expand Down Expand Up @@ -467,8 +467,8 @@ export class OpenAI {
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
}

protected stringifyQuery(query: Record<string, unknown>): string {
return qs.stringify(query, { arrayFormat: 'brackets' });
protected stringifyQuery(query: object | Record<string, unknown>): string {
return stringifyQuery(query);
}

private getUserAgent(): string {
Expand Down Expand Up @@ -530,7 +530,7 @@ export class OpenAI {
}

if (typeof query === 'object' && query && !Array.isArray(query)) {
url.search = this.stringifyQuery(query as Record<string, unknown>);
url.search = this.stringifyQuery(query);
}

return url.toString();
Expand Down Expand Up @@ -865,9 +865,9 @@ export class OpenAI {
}
}

// If the API asks us to wait a certain amount of time (and it's a reasonable amount),
// just do what it says, but otherwise calculate a default
if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
// If the API asks us to wait a certain amount of time, just do what it
// says, but otherwise calculate a default
if (timeoutMillis === undefined) {
const maxRetries = options.maxRetries ?? this.maxRetries;
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
}
Expand Down Expand Up @@ -1001,7 +1001,7 @@ export class OpenAI {
) {
return {
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
body: this.stringifyQuery(body as Record<string, unknown>),
body: this.stringifyQuery(body),
};
} else {
return this.#encoder({ body, headers });
Expand All @@ -1028,24 +1028,54 @@ export class OpenAI {

static toFile = Uploads.toFile;

/**
* Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
*/
completions: API.Completions = new API.Completions(this);
chat: API.Chat = new API.Chat(this);
/**
* Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
*/
embeddings: API.Embeddings = new API.Embeddings(this);
/**
* Files are used to upload documents that can be used with features like Assistants and Fine-tuning.
*/
files: API.Files = new API.Files(this);
/**
* Given a prompt and/or an input image, the model will generate a new image.
*/
images: API.Images = new API.Images(this);
audio: API.Audio = new API.Audio(this);
/**
* Given text and/or image inputs, classifies if those inputs are potentially harmful.
*/
moderations: API.Moderations = new API.Moderations(this);
/**
* List and describe the various models available in the API.
*/
models: API.Models = new API.Models(this);
fineTuning: API.FineTuning = new API.FineTuning(this);
graders: API.Graders = new API.Graders(this);
vectorStores: API.VectorStores = new API.VectorStores(this);
webhooks: API.Webhooks = new API.Webhooks(this);
beta: API.Beta = new API.Beta(this);
/**
* Create large batches of API requests to run asynchronously.
*/
batches: API.Batches = new API.Batches(this);
/**
* Use Uploads to upload large files in multiple parts.
*/
uploads: API.Uploads = new API.Uploads(this);
responses: API.Responses = new API.Responses(this);
realtime: API.Realtime = new API.Realtime(this);
/**
* Manage conversations and conversation items.
*/
conversations: API.Conversations = new API.Conversations(this);
/**
* Manage and run evals in the OpenAI platform.
*/
evals: API.Evals = new API.Evals(this);
containers: API.Containers = new API.Containers(this);
skills: API.Skills = new API.Skills(this);
Expand Down
1 change: 1 addition & 0 deletions src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './utils/env';
export * from './utils/log';
export * from './utils/uuid';
export * from './utils/sleep';
export * from './utils/query';
7 changes: 7 additions & 0 deletions src/internal/utils/query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as qs from '../qs/stringify';

export function stringifyQuery(query: object | Record<string, unknown>) {
return qs.stringify(query, { arrayFormat: 'brackets' });
}
3 changes: 3 additions & 0 deletions src/resources/audio/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { APIPromise } from '../../core/api-promise';
import { buildHeaders } from '../../internal/headers';
import { RequestOptions } from '../../internal/request-options';

/**
* Turn audio into text or text into audio.
*/
export class Speech extends APIResource {
/**
* Generates audio from the input text.
Expand Down
3 changes: 3 additions & 0 deletions src/resources/audio/transcriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { type Uploadable } from '../../core/uploads';
import { RequestOptions } from '../../internal/request-options';
import { multipartFormRequestOptions } from '../../internal/uploads';

/**
* Turn audio into text or text into audio.
*/
export class Transcriptions extends APIResource {
/**
* Transcribes audio into the input language.
Expand Down
3 changes: 3 additions & 0 deletions src/resources/audio/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { type Uploadable } from '../../core/uploads';
import { RequestOptions } from '../../internal/request-options';
import { multipartFormRequestOptions } from '../../internal/uploads';

/**
* Turn audio into text or text into audio.
*/
export class Translations extends APIResource {
/**
* Translates audio into English.
Expand Down
3 changes: 3 additions & 0 deletions src/resources/batches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../core/paginati
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';

/**
* Create large batches of API requests to run asynchronously.
*/
export class Batches extends APIResource {
/**
* Creates and executes a batch from an uploaded file of requests
Expand Down
8 changes: 6 additions & 2 deletions src/resources/beta/assistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
import { AssistantStream } from '../../lib/AssistantStream';

/**
* Build Assistants that can call models and use tools.
*/
export class Assistants extends APIResource {
/**
* Create an assistant with a model and instructions.
Expand Down Expand Up @@ -1256,8 +1259,9 @@ export namespace AssistantCreateParams {

/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
* add to the vector store. There can be a maximum of 10000 files in a vector
* store.
* add to the vector store. For vector stores created before Nov 2025, there can be
* a maximum of 10,000 files in a vector store. For vector stores created starting
* in Nov 2025, the limit is 100,000,000 files.
*/
file_ids?: Array<string>;

Expand Down
2 changes: 2 additions & 0 deletions src/resources/beta/threads/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { RequestOptions } from '../../../internal/request-options';
import { path } from '../../../internal/utils/path';

/**
* Build Assistants that can call models and use tools.
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
export class Messages extends APIResource {
Expand Down
2 changes: 2 additions & 0 deletions src/resources/beta/threads/runs/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import { RunSubmitToolOutputsParamsStream } from '../../../../lib/AssistantStrea
import { path } from '../../../../internal/utils/path';

/**
* Build Assistants that can call models and use tools.
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
export class Runs extends APIResource {
Expand Down
2 changes: 2 additions & 0 deletions src/resources/beta/threads/runs/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { RequestOptions } from '../../../../internal/request-options';
import { path } from '../../../../internal/utils/path';

/**
* Build Assistants that can call models and use tools.
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
export class Steps extends APIResource {
Expand Down
12 changes: 8 additions & 4 deletions src/resources/beta/threads/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ import { AssistantStream, ThreadCreateAndRunParamsBaseStream } from '../../../li
import { path } from '../../../internal/utils/path';

/**
* Build Assistants that can call models and use tools.
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
export class Threads extends APIResource {
Expand Down Expand Up @@ -450,8 +452,9 @@ export namespace ThreadCreateParams {

/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
* add to the vector store. There can be a maximum of 10000 files in a vector
* store.
* add to the vector store. For vector stores created before Nov 2025, there can be
* a maximum of 10,000 files in a vector store. For vector stores created starting
* in Nov 2025, the limit is 100,000,000 files.
*/
file_ids?: Array<string>;

Expand Down Expand Up @@ -846,8 +849,9 @@ export namespace ThreadCreateAndRunParams {

/**
* A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
* add to the vector store. There can be a maximum of 10000 files in a vector
* store.
* add to the vector store. For vector stores created before Nov 2025, there can be
* a maximum of 10,000 files in a vector store. For vector stores created starting
* in Nov 2025, the limit is 100,000,000 files.
*/
file_ids?: Array<string>;

Expand Down
5 changes: 4 additions & 1 deletion src/resources/chat/completions/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import { ChatCompletionStreamingToolRunnerParams } from '../../../lib/ChatComple
import { ChatCompletionStream, type ChatCompletionStreamParams } from '../../../lib/ChatCompletionStream';
import { ExtractParsedContentFromParams, parseChatCompletion, validateInputTools } from '../../../lib/parser';

/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
export class Completions extends APIResource {
messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);

Expand Down Expand Up @@ -50,7 +53,7 @@ export class Completions extends APIResource {
* const chatCompletion = await client.chat.completions.create(
* {
* messages: [{ content: 'string', role: 'developer' }],
* model: 'gpt-4o',
* model: 'gpt-5.4',
* },
* );
* ```
Expand Down
3 changes: 3 additions & 0 deletions src/resources/chat/completions/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pa
import { RequestOptions } from '../../../internal/request-options';
import { path } from '../../../internal/utils/path';

/**
* Given a list of messages comprising a conversation, the model will return a response.
*/
export class Messages extends APIResource {
/**
* Get the messages in a stored chat completion. Only Chat Completions that have
Expand Down
3 changes: 3 additions & 0 deletions src/resources/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { APIPromise } from '../core/api-promise';
import { Stream } from '../core/streaming';
import { RequestOptions } from '../internal/request-options';

/**
* Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
*/
export class Completions extends APIResource {
/**
* Creates a completion for the provided prompt and parameters.
Expand Down
Loading