diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml index e2815913b..98eab6843 100644 --- a/.github/workflows/create-releases.yml +++ b/.github/workflows/create-releases.yml @@ -40,8 +40,6 @@ jobs: if: ${{ steps.release.outputs.releases_created }} run: | bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }} - name: Publish to JSR if: ${{ steps.release.outputs.releases_created }} diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index ee4b8cca3..ed69aa12e 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -8,6 +8,9 @@ jobs: publish: name: publish runs-on: ubuntu-latest + permissions: + contents: read + id-token: write environment: publish steps: @@ -25,5 +28,3 @@ jobs: - name: Publish to NPM run: | bash ./bin/publish-npm - env: - NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 7ea865b83..729301c4d 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -20,5 +20,4 @@ jobs: bash ./bin/check-release-environment env: STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} - NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 515ac7d61..3ed996f7b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "6.29.0" + ".": "6.30.0" } diff --git a/.stats.yml b/.stats.yml index 900598b98..167fa29d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 151 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-cb3e4451108eed58d59cff25bf77ec0dc960ec9c6f3dba68f90e7a9847c09d21.yml -openapi_spec_hash: dec6d9be64a5ba8f474a1f2a7a4fafef -config_hash: e922f01e25accd07d8fd3641c37fbd62 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2ab0731e8c94b7c783b55939d2d2a46c2594c1da2ec444c543e17a9eea6d9164.yml +openapi_spec_hash: 5557d4cd48565e8b98dfcb96a5804965 +config_hash: 1e4cbbae1fcd20c0b729289210c04d1a diff --git a/CHANGELOG.md b/CHANGELOG.md index a79651cc9..30498a258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 6.30.0 (2026-03-16) + +Full Changelog: [v6.29.0...v6.30.0](https://github.com/openai/openai-node/compare/v6.29.0...v6.30.0) + +### Features + +* **api:** add /v1/videos endpoint option to batches ([271d879](https://github.com/openai/openai-node/commit/271d87979f16950900f4253915bdda319b7fe935)) +* **api:** add defer_loading field to NamespaceTool ([7cc8f0a](https://github.com/openai/openai-node/commit/7cc8f0a736ea7ba0aa3e7860b4c30eaaa5795966)) + + +### Bug Fixes + +* **api:** oidc publishing for npm ([fa50066](https://github.com/openai/openai-node/commit/fa500666e38379f2241ac43d60e2eb7eef7d39cb)) + ## 6.29.0 (2026-03-13) Full Changelog: [v6.28.0...v6.29.0](https://github.com/openai/openai-node/compare/v6.28.0...v6.29.0) diff --git a/bin/check-release-environment b/bin/check-release-environment index bcf856d18..a0e7396c8 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -6,10 +6,6 @@ if [ -z "${STAINLESS_API_KEY}" ]; then errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") fi -if [ -z "${NPM_TOKEN}" ]; then - errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/bin/publish-npm b/bin/publish-npm index 45e8aa808..3d05c0bd1 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,7 +2,12 @@ set -eux -npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +if [[ ${NPM_TOKEN:-} ]]; then + npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then + echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission" + exit 1 +fi yarn build cd dist @@ -57,5 +62,9 @@ else TAG="latest" fi +# Install OIDC compatible npm version +npm install --prefix ../oidc/ npm@11.6.2 + # Publish with the appropriate tag -yarn publish --tag "$TAG" +export npm_config_registry='https://registry.npmjs.org' +../oidc/node_modules/.bin/npm publish --tag "$TAG" diff --git a/jsr.json b/jsr.json index f023b9058..deee67744 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "6.29.0", + "version": "6.30.0", "exports": { ".": "./index.ts", "./helpers/zod": "./helpers/zod.ts", diff --git a/package.json b/package.json index 9e317a7a7..ef61fbe8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "6.29.0", + "version": "6.30.0", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/resources/batches.ts b/src/resources/batches.ts index 6825e19c5..37f3ef45a 100644 --- a/src/resources/batches.ts +++ b/src/resources/batches.ts @@ -291,9 +291,10 @@ export interface BatchCreateParams { /** * The endpoint to be used for all requests in the batch. Currently * `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`, - * `/v1/moderations`, `/v1/images/generations`, and `/v1/images/edits` are - * supported. Note that `/v1/embeddings` batches are also restricted to a maximum - * of 50,000 embedding inputs across all requests in the batch. + * `/v1/moderations`, `/v1/images/generations`, `/v1/images/edits`, and + * `/v1/videos` are supported. Note that `/v1/embeddings` batches are also + * restricted to a maximum of 50,000 embedding inputs across all requests in the + * batch. */ endpoint: | '/v1/responses' @@ -302,7 +303,8 @@ export interface BatchCreateParams { | '/v1/completions' | '/v1/moderations' | '/v1/images/generations' - | '/v1/images/edits'; + | '/v1/images/edits' + | '/v1/videos'; /** * The ID of an uploaded file that contains requests for the new batch. diff --git a/src/resources/responses/responses.ts b/src/resources/responses/responses.ts index c1a77550d..408cb80ef 100644 --- a/src/resources/responses/responses.ts +++ b/src/resources/responses/responses.ts @@ -898,6 +898,11 @@ export namespace NamespaceTool { type: 'function'; + /** + * Whether this function should be deferred and discovered via tool search. + */ + defer_loading?: boolean; + description?: string | null; parameters?: unknown | null; diff --git a/src/version.ts b/src/version.ts index f747ad8ac..aad8b8514 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '6.29.0'; // x-release-please-version +export const VERSION = '6.30.0'; // x-release-please-version